aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/files.el20
-rw-r--r--lisp/saveplace.el2
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 @@
12011-04-06 Juanma Barranquero <lekktu@gmail.com>
2
3 * NEWS: New variable `revert-buffer-in-progress-p'.
4
12011-03-22 Sebastian Hermida <sebas00@gmail.com> 52011-03-22 Sebastian Hermida <sebas00@gmail.com>
2 6
3 * themes/misterioso-theme.el: New file. 7 * themes/misterioso-theme.el: New file.
diff --git a/etc/NEWS b/etc/NEWS
index 6b7fd303dde..b416e98de0c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -886,6 +886,9 @@ time you call `progress-reporter-update' on that progress reporter,
886with a nil or omitted VALUE argument, the reporter message is 886with a nil or omitted VALUE argument, the reporter message is
887displayed with a "spinning bar". 887displayed with a "spinning bar".
888 888
889** New variable `revert-buffer-in-progress-p' is true while a buffer is
890being 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 @@
12011-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
12011-04-06 Glenn Morris <rgm@gnu.org> 122011-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.
2109Sets buffer mode, parses local variables. 2107Sets buffer mode, parses local variables.
@@ -2111,8 +2109,8 @@ Optional args ERROR, WARN, and NOAUTO: ERROR non-nil means there was an
2111error in reading the file. WARN non-nil means warn if there 2109error in reading the file. WARN non-nil means warn if there
2112exists an auto-save file more recent than the visited file. 2110exists an auto-save file more recent than the visited file.
2113NOAUTO means don't mess with auto-save mode. 2111NOAUTO means don't mess with auto-save mode.
2114Fourth arg AFTER-FIND-FILE-FROM-REVERT-BUFFER non-nil 2112Fourth 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).
2116Fifth arg NOMODES non-nil means don't alter the file's modes. 2114Fifth arg NOMODES non-nil means don't alter the file's modes.
2117Finishes by calling the functions in `find-file-hook' 2115Finishes by calling the functions in `find-file-hook'
2118unless NOMODES is non-nil." 2116unless NOMODES is non-nil."
@@ -5004,6 +5002,10 @@ hook functions.
5004If `revert-buffer-function' is used to override the normal revert 5002If `revert-buffer-function' is used to override the normal revert
5005mechanism, this hook is not used.") 5003mechanism, 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.
5007This 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)))))