diff options
| author | Stefan Monnier | 2007-07-06 12:58:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-07-06 12:58:16 +0000 |
| commit | ddd7c238540f6e8365d45408f8560d32db1e4510 (patch) | |
| tree | 7df372c4ab3e798ec1fd9c52535189709412da4c | |
| parent | 9ae06d96f6c1a35ef6c663165b226af7ea6ecfc4 (diff) | |
| download | emacs-ddd7c238540f6e8365d45408f8560d32db1e4510.tar.gz emacs-ddd7c238540f6e8365d45408f8560d32db1e4510.zip | |
(auto-revert-tail-handler): Use inhibit-read-only.
Run before-revert-hook. Suggested by Denis Bueno <denbuen@sandia.gov>.
Use run-hooks rather than run-mode-hooks.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/autorevert.el | 11 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 047be6d9e9e..ca15f733c37 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-07-06 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * autorevert.el (auto-revert-tail-handler): Use inhibit-read-only. | ||
| 4 | Run before-revert-hook. Suggested by Denis Bueno <denbuen@sandia.gov>. | ||
| 5 | Use run-hooks rather than run-mode-hooks. | ||
| 6 | |||
| 1 | 2007-07-05 Jay Belanger <jay.p.belanger@gmail.com> | 7 | 2007-07-05 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 8 | ||
| 3 | * calc/calc-comb.el (math-random-digit): Rename to | 9 | * calc/calc-comb.el (math-random-digit): Rename to |
| @@ -16,8 +22,8 @@ | |||
| 16 | 22 | ||
| 17 | 2007-07-05 Chong Yidong <cyd@stupidchicken.com> | 23 | 2007-07-05 Chong Yidong <cyd@stupidchicken.com> |
| 18 | 24 | ||
| 19 | * wid-edit.el (widget-documentation-string-value-create): Insert | 25 | * wid-edit.el (widget-documentation-string-value-create): |
| 20 | indentation spaces. | 26 | Insert indentation spaces. |
| 21 | 27 | ||
| 22 | 2007-07-05 Thien-Thi Nguyen <ttn@gnuvola.org> | 28 | 2007-07-05 Thien-Thi Nguyen <ttn@gnuvola.org> |
| 23 | 29 | ||
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 170ca4b88c2..3831d7c1c05 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -447,20 +447,21 @@ This is an internal function used by Auto-Revert Mode." | |||
| 447 | (defun auto-revert-tail-handler () | 447 | (defun auto-revert-tail-handler () |
| 448 | (let ((size (nth 7 (file-attributes buffer-file-name))) | 448 | (let ((size (nth 7 (file-attributes buffer-file-name))) |
| 449 | (modified (buffer-modified-p)) | 449 | (modified (buffer-modified-p)) |
| 450 | buffer-read-only ; ignore | 450 | (inhibit-read-only t) ; Ignore. |
| 451 | (file buffer-file-name) | 451 | (file buffer-file-name) |
| 452 | buffer-file-name) ; ignore that file has changed | 452 | (buffer-file-name nil)) ; Ignore that file has changed. |
| 453 | (when (> size auto-revert-tail-pos) | 453 | (when (> size auto-revert-tail-pos) |
| 454 | (run-hooks 'before-revert-hook) | ||
| 454 | (undo-boundary) | 455 | (undo-boundary) |
| 455 | (save-restriction | 456 | (save-restriction |
| 456 | (widen) | 457 | (widen) |
| 457 | (save-excursion | 458 | (save-excursion |
| 458 | (goto-char (point-max)) | 459 | (goto-char (point-max)) |
| 459 | (insert-file-contents file nil auto-revert-tail-pos size))) | 460 | (insert-file-contents file nil auto-revert-tail-pos size))) |
| 460 | (run-mode-hooks 'after-revert-hook) | 461 | (run-hooks 'after-revert-hook) |
| 461 | (undo-boundary) | 462 | (undo-boundary) |
| 462 | (setq auto-revert-tail-pos size) | 463 | (setq auto-revert-tail-pos size) |
| 463 | (set-buffer-modified-p modified))) | 464 | (restore-buffer-modified-p modified))) |
| 464 | (set-visited-file-modtime)) | 465 | (set-visited-file-modtime)) |
| 465 | 466 | ||
| 466 | (defun auto-revert-buffers () | 467 | (defun auto-revert-buffers () |
| @@ -534,5 +535,5 @@ the timer when no buffers need to be checked." | |||
| 534 | 535 | ||
| 535 | (run-hooks 'auto-revert-load-hook) | 536 | (run-hooks 'auto-revert-load-hook) |
| 536 | 537 | ||
| 537 | ;;; arch-tag: f6bcb07b-4841-477e-9e44-b18678e58876 | 538 | ;; arch-tag: f6bcb07b-4841-477e-9e44-b18678e58876 |
| 538 | ;;; autorevert.el ends here | 539 | ;;; autorevert.el ends here |