diff options
| author | Richard M. Stallman | 1996-11-09 09:04:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-11-09 09:04:52 +0000 |
| commit | 7e7c9c4eedf0bfc8cfec3d31a6056e2041e945b1 (patch) | |
| tree | 85e6462e1098369c72151ee37a68b069a2068f77 | |
| parent | 55b4b20a0ccee22ddecbf830559179ebe222e434 (diff) | |
| download | emacs-7e7c9c4eedf0bfc8cfec3d31a6056e2041e945b1.tar.gz emacs-7e7c9c4eedf0bfc8cfec3d31a6056e2041e945b1.zip | |
(revert-buffer): Doc fix.
(wildcard-to-regexp): Don't treat [] as special.
| -rw-r--r-- | lisp/files.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/files.el b/lisp/files.el index 8828e281e6a..21063197298 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2197,11 +2197,16 @@ If `revert-buffer-function' is used to override the normal revert | |||
| 2197 | mechanism, this hook is not used.") | 2197 | mechanism, this hook is not used.") |
| 2198 | 2198 | ||
| 2199 | (defun revert-buffer (&optional ignore-auto noconfirm preserve-modes) | 2199 | (defun revert-buffer (&optional ignore-auto noconfirm preserve-modes) |
| 2200 | "Replace the buffer text with the text of the visited file on disk. | 2200 | "Replace current buffer text with the text of the visited file on disk. |
| 2201 | This undoes all changes since the file was visited or saved. | 2201 | This undoes all changes since the file was visited or saved. |
| 2202 | With a prefix argument, offer to revert from latest auto-save file, if | 2202 | With a prefix argument, offer to revert from latest auto-save file, if |
| 2203 | that is more recent than the visited file. | 2203 | that is more recent than the visited file. |
| 2204 | 2204 | ||
| 2205 | This command also works for special buffers that contain text which | ||
| 2206 | doesn't come from a file, but reflects some other data base instead: | ||
| 2207 | for example, Dired buffers and buffer-list buffers. In these cases, | ||
| 2208 | it reconstructs the buffer contents from the appropriate data base. | ||
| 2209 | |||
| 2205 | When called from Lisp, the first argument is IGNORE-AUTO; only offer | 2210 | When called from Lisp, the first argument is IGNORE-AUTO; only offer |
| 2206 | to revert from the auto-save file when this is nil. Note that the | 2211 | to revert from the auto-save file when this is nil. Note that the |
| 2207 | sense of this argument is the reverse of the prefix argument, for the | 2212 | sense of this argument is the reverse of the prefix argument, for the |
| @@ -2215,10 +2220,11 @@ Optional third argument PRESERVE-MODES non-nil means don't alter | |||
| 2215 | the files modes. Normally we reinitialize them using `normal-mode'. | 2220 | the files modes. Normally we reinitialize them using `normal-mode'. |
| 2216 | 2221 | ||
| 2217 | If the value of `revert-buffer-function' is non-nil, it is called to | 2222 | If the value of `revert-buffer-function' is non-nil, it is called to |
| 2218 | do the work. | 2223 | do all the work for this command. Otherwise, the hooks |
| 2224 | `before-revert-hook' and `after-revert-hook' are run at the beginning | ||
| 2225 | and the end, and if `revert-buffer-insert-file-contents-function' is | ||
| 2226 | non-nil, it is called instead of rereading visited file contents." | ||
| 2219 | 2227 | ||
| 2220 | The default revert function runs the hook `before-revert-hook' at the | ||
| 2221 | beginning and `after-revert-hook' at the end." | ||
| 2222 | ;; I admit it's odd to reverse the sense of the prefix argument, but | 2228 | ;; I admit it's odd to reverse the sense of the prefix argument, but |
| 2223 | ;; there is a lot of code out there which assumes that the first | 2229 | ;; there is a lot of code out there which assumes that the first |
| 2224 | ;; argument should be t to avoid consulting the auto-save file, and | 2230 | ;; argument should be t to avoid consulting the auto-save file, and |
| @@ -2536,6 +2542,10 @@ by `sh' are supported." | |||
| 2536 | result | 2542 | result |
| 2537 | (concat result | 2543 | (concat result |
| 2538 | (cond | 2544 | (cond |
| 2545 | ((and (eq ch ?\[) | ||
| 2546 | (< (1+ i) len) | ||
| 2547 | (eq (aref wildcard (1+ i)) ?\])) | ||
| 2548 | "\\[") | ||
| 2539 | ((eq ch ?\[) ; [...] maps to regexp char class | 2549 | ((eq ch ?\[) ; [...] maps to regexp char class |
| 2540 | (progn | 2550 | (progn |
| 2541 | (setq i (1+ i)) | 2551 | (setq i (1+ i)) |