Mercurial > hg > xemacs-beta
changeset 849:503b6a57cf47
[xemacs-hg @ 2002-05-21 10:29:07 by stephent]
revert-buffer docs, eldap.c <87hel1er8q.fsf@tleepslib.sk.tsukuba.ac.jp> <87d6vper2g.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Tue, 21 May 2002 10:29:15 +0000 |
parents | 0cb55b2a2c66 |
children | f915ad7befaf |
files | lisp/ChangeLog lisp/files.el src/ChangeLog src/eldap.c |
diffstat | 4 files changed, 25 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri May 17 18:28:45 2002 +0000 +++ b/lisp/ChangeLog Tue May 21 10:29:15 2002 +0000 @@ -1,3 +1,9 @@ +2002-05-20 Stephen J. Turnbull <stephen@xemacs.org> + + * files.el (revert-buffer): + (revert-buffer-internal): + Update docstrings from 21.4. + 2002-04-17 Nickolay Pakoulin <npak@ispras.ru> * cus-edit.el (custom-save-delete-any): New function
--- a/lisp/files.el Fri May 17 18:28:45 2002 +0000 +++ b/lisp/files.el Tue May 21 10:29:15 2002 +0000 @@ -2764,7 +2764,9 @@ (defvar revert-buffer-insert-file-contents-function nil "Function to use to insert contents when reverting this buffer. Gets two args, first the nominal file name to use, -and second, t if reading the auto-save file.") +and second, t if reading the auto-save file. +If the current buffer contents are to be discarded, the function must do +so itself.") (defvar before-revert-hook nil "Normal hook for `revert-buffer' to run before reverting. @@ -2789,10 +2791,10 @@ With a prefix argument, offer to revert from latest auto-save file, if that is more recent than the visited file. -This command also works for special buffers that contain text which -doesn't come from a file, but reflects some other data base instead: -for example, Dired buffers and buffer-list buffers. In these cases, -it reconstructs the buffer contents from the appropriate data base. +This command also refreshes certain special buffers that contain text +which doesn't come from a file, but reflects some other data base +instead: for example, Dired buffers and buffer-list buffers. This is +implemented by having the modes set `revert-buffer-function'. When called from Lisp, the first argument is IGNORE-AUTO; only offer to revert from the auto-save file when this is nil. Note that the @@ -2804,7 +2806,7 @@ all. Optional third argument PRESERVE-MODES non-nil means don't alter -the files modes. Normally we reinitialize them using `normal-mode'. +the buffer's modes. Otherwise, reinitialize them using `normal-mode'. If the value of `revert-buffer-function' is non-nil, it is called to do all the work for this command. Otherwise, the hooks @@ -2812,10 +2814,9 @@ and the end, and if `revert-buffer-insert-file-contents-function' is non-nil, it is called instead of rereading visited file contents. -If the buffer has not been obviously modified, and no auto-save file -exists, then `revert-buffer-internal' is -called. `revert-buffer-internal' will not actually change the buffer -at all if reversion would not cause any user-visible changes." +If the buffer-modified flag is nil, and we are not reverting from an +auto-save file, then compare the contents of the buffer and the file. +Revert only if they differ." ;; I admit it's odd to reverse the sense of the prefix argument, but ;; there is a lot of code out there which assumes that the first @@ -2968,6 +2969,9 @@ t))))) (defun revert-buffer-internal (&optional file-name) + "Read contents of FILE-NAME into a buffer, and compare to current buffer. +Return nil if identical, and the new buffer if different." + (let* ((newbuf (get-buffer-create " *revert*")) bmin bmax) (save-excursion
--- a/src/ChangeLog Fri May 17 18:28:45 2002 +0000 +++ b/src/ChangeLog Tue May 21 10:29:15 2002 +0000 @@ -1,3 +1,7 @@ +2002-05-17 Stephen J. Turnbull <stephen@xemacs.org> + + * eldap.c (print_ldap): swap arguments of write_c_string. + 2002-05-16 Ben Wing <ben@xemacs.org> * bytecode.c (execute_rare_opcode):
--- a/src/eldap.c Fri May 17 18:28:45 2002 +0000 +++ b/src/eldap.c Tue May 21 10:29:15 2002 +0000 @@ -113,7 +113,7 @@ write_fmt_string_lisp (printcharfun, "#<ldap %S", 1, ldap->host); if (!ldap->ld) - write_c_string ("(dead) ",printcharfun); + write_c_string (printcharfun,"(dead) "); write_fmt_string (printcharfun, " 0x%lx>", (long)ldap); }