Mercurial > emacs
comparison lisp/autorevert.el @ 90979:988f1edc9674
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 803-805)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-227
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 09 Jul 2007 08:00:55 +0000 |
parents | 4ef881a120fe 59741e45a674 |
children | f55f9811f5d7 |
comparison
equal
deleted
inserted
replaced
90978:f866074aedc4 | 90979:988f1edc9674 |
---|---|
445 (vc-find-file-hook))))) | 445 (vc-find-file-hook))))) |
446 | 446 |
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 () |
467 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. | 468 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. |
468 | 469 |
532 ;; The end: | 533 ;; The end: |
533 (provide 'autorevert) | 534 (provide 'autorevert) |
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 |