Mercurial > emacs
comparison lisp/follow.el @ 79004:d771a0b43ed5
(follow-mode): Don't run hooks twice. Use `when'.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 08 Oct 2007 16:10:56 +0000 |
parents | a4cabf2eaad3 |
children | f59eafc3c43c |
comparison
equal
deleted
inserted
replaced
79003:eb6c7dd21cc5 | 79004:d771a0b43ed5 |
---|---|
600 is called. When turned off, `follow-mode-off-hook' is called. | 600 is called. When turned off, `follow-mode-off-hook' is called. |
601 | 601 |
602 Keys specific to Follow mode: | 602 Keys specific to Follow mode: |
603 \\{follow-mode-map}" | 603 \\{follow-mode-map}" |
604 :keymap follow-mode-map | 604 :keymap follow-mode-map |
605 (if (and follow-mode follow-intercept-processes) | 605 (when (and follow-mode follow-intercept-processes) |
606 (follow-intercept-process-output)) | 606 (follow-intercept-process-output)) |
607 (cond (follow-mode ; On | 607 (cond (follow-mode ; On |
608 ;; XEmacs: If this is non-nil, the window will scroll before | 608 ;; XEmacs: If this is non-nil, the window will scroll before |
609 ;; the point will have a chance to get into the next window. | 609 ;; the point will have a chance to get into the next window. |
610 (if (boundp 'scroll-on-clipped-lines) | 610 (when (boundp 'scroll-on-clipped-lines) |
611 (setq scroll-on-clipped-lines nil)) | 611 (setq scroll-on-clipped-lines nil)) |
612 (force-mode-line-update) | 612 (force-mode-line-update) |
613 (add-hook 'post-command-hook 'follow-post-command-hook t) | 613 (add-hook 'post-command-hook 'follow-post-command-hook t)) |
614 (run-hooks 'follow-mode-hook)) | |
615 | 614 |
616 ((not follow-mode) ; Off | 615 ((not follow-mode) ; Off |
617 (force-mode-line-update) | 616 (force-mode-line-update)))) |
618 (run-hooks 'follow-mode-off-hook)))) | |
619 | 617 |
620 ;;}}} | 618 ;;}}} |
621 ;;{{{ Find file hook | 619 ;;{{{ Find file hook |
622 | 620 |
623 ;; This will start follow-mode whenever a new file is loaded, if | 621 ;; This will start follow-mode whenever a new file is loaded, if |