diff options
| author | Juanma Barranquero | 2011-04-06 21:38:46 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2011-04-06 21:38:46 +0200 |
| commit | 3e214b503eaf5c8a02b7153e5ddaf40a2d6efb13 (patch) | |
| tree | 5e88ed8e5431fe3e56e85be4cb76b99bd8b1e0f4 | |
| parent | 67a22325cedc1fa04026e34e2ca8aff78942f541 (diff) | |
| download | emacs-3e214b503eaf5c8a02b7153e5ddaf40a2d6efb13.tar.gz emacs-3e214b503eaf5c8a02b7153e5ddaf40a2d6efb13.zip | |
New variable `revert-buffer-in-progress-p'.
* lisp/files.el (after-find-file-from-revert-buffer): Remove variable.
(after-find-file): Dont' bind it.
(revert-buffer-in-progress-p): New variable.
(revert-buffer): Bind it.
Pass nil for `after-find-file-from-revert-buffer'.
* lisp/saveplace.el (save-place-find-file-hook): Use new variable
`rever-buffer-in-progress-p', not `after-find-file-from-revert-buffer'.
* etc/NEWS: New variable `revert-buffer-in-progress-p'.
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/files.el | 20 | ||||
| -rw-r--r-- | lisp/saveplace.el | 2 |
5 files changed, 31 insertions, 9 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index 50d0acf3931..b9e409e8783 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-04-06 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * NEWS: New variable `revert-buffer-in-progress-p'. | ||
| 4 | |||
| 1 | 2011-03-22 Sebastian Hermida <sebas00@gmail.com> | 5 | 2011-03-22 Sebastian Hermida <sebas00@gmail.com> |
| 2 | 6 | ||
| 3 | * themes/misterioso-theme.el: New file. | 7 | * themes/misterioso-theme.el: New file. |
| @@ -886,6 +886,9 @@ time you call `progress-reporter-update' on that progress reporter, | |||
| 886 | with a nil or omitted VALUE argument, the reporter message is | 886 | with a nil or omitted VALUE argument, the reporter message is |
| 887 | displayed with a "spinning bar". | 887 | displayed with a "spinning bar". |
| 888 | 888 | ||
| 889 | ** New variable `revert-buffer-in-progress-p' is true while a buffer is | ||
| 890 | being reverted, even if the buffer has a local `revert-buffer-function'. | ||
| 891 | |||
| 889 | 892 | ||
| 890 | * Changes in Emacs 24.1 on non-free operating systems | 893 | * Changes in Emacs 24.1 on non-free operating systems |
| 891 | 894 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ca163104e0a..5bd55902b40 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-04-06 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * files.el (after-find-file-from-revert-buffer): Remove variable. | ||
| 4 | (after-find-file): Dont' bind it. | ||
| 5 | (revert-buffer-in-progress-p): New variable. | ||
| 6 | (revert-buffer): Bind it. | ||
| 7 | Pass nil for `after-find-file-from-revert-buffer'. | ||
| 8 | |||
| 9 | * saveplace.el (save-place-find-file-hook): Use new variable | ||
| 10 | `rever-buffer-in-progress-p', not `after-find-file-from-revert-buffer'. | ||
| 11 | |||
| 1 | 2011-04-06 Glenn Morris <rgm@gnu.org> | 12 | 2011-04-06 Glenn Morris <rgm@gnu.org> |
| 2 | 13 | ||
| 3 | * Makefile.in (AUTOGEN_VCS): New variable. | 14 | * Makefile.in (AUTOGEN_VCS): New variable. |
diff --git a/lisp/files.el b/lisp/files.el index e87c25f3575..6bfb4f00d32 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2100,10 +2100,8 @@ the file contents into it using `insert-file-contents-literally'." | |||
| 2100 | (confirm-nonexistent-file-or-buffer)))) | 2100 | (confirm-nonexistent-file-or-buffer)))) |
| 2101 | (switch-to-buffer (find-file-noselect filename nil t))) | 2101 | (switch-to-buffer (find-file-noselect filename nil t))) |
| 2102 | 2102 | ||
| 2103 | (defvar after-find-file-from-revert-buffer nil) | ||
| 2104 | |||
| 2105 | (defun after-find-file (&optional error warn noauto | 2103 | (defun after-find-file (&optional error warn noauto |
| 2106 | after-find-file-from-revert-buffer | 2104 | _after-find-file-from-revert-buffer |
| 2107 | nomodes) | 2105 | nomodes) |
| 2108 | "Called after finding a file and by the default revert function. | 2106 | "Called after finding a file and by the default revert function. |
| 2109 | Sets buffer mode, parses local variables. | 2107 | Sets buffer mode, parses local variables. |
| @@ -2111,8 +2109,8 @@ Optional args ERROR, WARN, and NOAUTO: ERROR non-nil means there was an | |||
| 2111 | error in reading the file. WARN non-nil means warn if there | 2109 | error in reading the file. WARN non-nil means warn if there |
| 2112 | exists an auto-save file more recent than the visited file. | 2110 | exists an auto-save file more recent than the visited file. |
| 2113 | NOAUTO means don't mess with auto-save mode. | 2111 | NOAUTO means don't mess with auto-save mode. |
| 2114 | Fourth arg AFTER-FIND-FILE-FROM-REVERT-BUFFER non-nil | 2112 | Fourth arg AFTER-FIND-FILE-FROM-REVERT-BUFFER is ignored |
| 2115 | means this call was from `revert-buffer'. | 2113 | \(see `revert-buffer-in-progress-p' for similar functionality). |
| 2116 | Fifth arg NOMODES non-nil means don't alter the file's modes. | 2114 | Fifth arg NOMODES non-nil means don't alter the file's modes. |
| 2117 | Finishes by calling the functions in `find-file-hook' | 2115 | Finishes by calling the functions in `find-file-hook' |
| 2118 | unless NOMODES is non-nil." | 2116 | unless NOMODES is non-nil." |
| @@ -5004,6 +5002,10 @@ hook functions. | |||
| 5004 | If `revert-buffer-function' is used to override the normal revert | 5002 | If `revert-buffer-function' is used to override the normal revert |
| 5005 | mechanism, this hook is not used.") | 5003 | mechanism, this hook is not used.") |
| 5006 | 5004 | ||
| 5005 | (defvar revert-buffer-in-progress-p nil | ||
| 5006 | "Non-nil if a `revert-buffer' operation is in progress, nil otherwise. | ||
| 5007 | This is true even if a `revert-buffer-function' is being used.") | ||
| 5008 | |||
| 5007 | (defvar revert-buffer-internal-hook) | 5009 | (defvar revert-buffer-internal-hook) |
| 5008 | 5010 | ||
| 5009 | (defun revert-buffer (&optional ignore-auto noconfirm preserve-modes) | 5011 | (defun revert-buffer (&optional ignore-auto noconfirm preserve-modes) |
| @@ -5046,10 +5048,12 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 5046 | ;; interface, but leaving the programmatic interface the same. | 5048 | ;; interface, but leaving the programmatic interface the same. |
| 5047 | (interactive (list (not current-prefix-arg))) | 5049 | (interactive (list (not current-prefix-arg))) |
| 5048 | (if revert-buffer-function | 5050 | (if revert-buffer-function |
| 5049 | (funcall revert-buffer-function ignore-auto noconfirm) | 5051 | (let ((revert-buffer-in-progress-p t)) |
| 5052 | (funcall revert-buffer-function ignore-auto noconfirm)) | ||
| 5050 | (with-current-buffer (or (buffer-base-buffer (current-buffer)) | 5053 | (with-current-buffer (or (buffer-base-buffer (current-buffer)) |
| 5051 | (current-buffer)) | 5054 | (current-buffer)) |
| 5052 | (let* ((auto-save-p (and (not ignore-auto) | 5055 | (let* ((revert-buffer-in-progress-p t) |
| 5056 | (auto-save-p (and (not ignore-auto) | ||
| 5053 | (recent-auto-save-p) | 5057 | (recent-auto-save-p) |
| 5054 | buffer-auto-save-file-name | 5058 | buffer-auto-save-file-name |
| 5055 | (file-readable-p buffer-auto-save-file-name) | 5059 | (file-readable-p buffer-auto-save-file-name) |
| @@ -5140,7 +5144,7 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 5140 | ;; have changed the truename. | 5144 | ;; have changed the truename. |
| 5141 | (setq buffer-file-truename | 5145 | (setq buffer-file-truename |
| 5142 | (abbreviate-file-name (file-truename buffer-file-name))) | 5146 | (abbreviate-file-name (file-truename buffer-file-name))) |
| 5143 | (after-find-file nil nil t t preserve-modes) | 5147 | (after-find-file nil nil t nil preserve-modes) |
| 5144 | ;; Run after-revert-hook as it was before we reverted. | 5148 | ;; Run after-revert-hook as it was before we reverted. |
| 5145 | (setq-default revert-buffer-internal-hook global-hook) | 5149 | (setq-default revert-buffer-internal-hook global-hook) |
| 5146 | (if local-hook | 5150 | (if local-hook |
diff --git a/lisp/saveplace.el b/lisp/saveplace.el index c10b5cbb7ec..2d1586d895a 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el | |||
| @@ -285,7 +285,7 @@ may have changed\) back to `save-place-alist'." | |||
| 285 | (let ((cell (assoc buffer-file-name save-place-alist))) | 285 | (let ((cell (assoc buffer-file-name save-place-alist))) |
| 286 | (if cell | 286 | (if cell |
| 287 | (progn | 287 | (progn |
| 288 | (or after-find-file-from-revert-buffer | 288 | (or revert-buffer-in-progress-p |
| 289 | (goto-char (cdr cell))) | 289 | (goto-char (cdr cell))) |
| 290 | ;; and make sure it will be saved again for later | 290 | ;; and make sure it will be saved again for later |
| 291 | (setq save-place t))))) | 291 | (setq save-place t))))) |