diff options
| author | Juanma Barranquero | 2007-10-19 10:54:36 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-10-19 10:54:36 +0000 |
| commit | fc7793831bdef46fef2cb400f2839fd846987110 (patch) | |
| tree | 8d594e40ec7dae6a847da7b232d5a7f015c31eb9 | |
| parent | 7b82c3b635c43691f6fb42ca6955c308b81ddafb (diff) | |
| download | emacs-fc7793831bdef46fef2cb400f2839fd846987110.tar.gz emacs-fc7793831bdef46fef2cb400f2839fd846987110.zip | |
(follow-unload-function): New function.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/follow.el | 39 |
2 files changed, 37 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d24869a65eb..9c399eb6de2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2007-10-19 Juanma Barranquero <lekktu@gmail.com> | 1 | 2007-10-19 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 2 | ||
| 3 | * follow.el (follow-unload-function): New function. | ||
| 4 | |||
| 3 | * loadhist.el (unload-function-features-list): | 5 | * loadhist.el (unload-function-features-list): |
| 4 | Rename from `unload-hook-features-list'. | 6 | Rename from `unload-hook-features-list'. |
| 5 | (unload-hook-features-list): Add as obsolete alias. | 7 | (unload-hook-features-list): Add as obsolete alias. |
diff --git a/lisp/follow.el b/lisp/follow.el index 55a331a22d3..50760cd9909 100644 --- a/lisp/follow.el +++ b/lisp/follow.el | |||
| @@ -712,7 +712,7 @@ in your `~/.emacs' file: | |||
| 712 | ;;}}} | 712 | ;;}}} |
| 713 | ;;{{{ Movement | 713 | ;;{{{ Movement |
| 714 | 714 | ||
| 715 | ;; Note, these functions are not very useful, atleast not unless you | 715 | ;; Note, these functions are not very useful, at least not unless you |
| 716 | ;; rebind the rather cumbersome key sequence `C-c . p'. | 716 | ;; rebind the rather cumbersome key sequence `C-c . p'. |
| 717 | 717 | ||
| 718 | (defun follow-next-window () | 718 | (defun follow-next-window () |
| @@ -1267,7 +1267,7 @@ position of the first window. Otherwise it is a good guess." | |||
| 1267 | (let ((done nil) | 1267 | (let ((done nil) |
| 1268 | win-start | 1268 | win-start |
| 1269 | res) | 1269 | res) |
| 1270 | ;; Always calculate what happend when no line is displayed in the first | 1270 | ;; Always calculate what happens when no line is displayed in the first |
| 1271 | ;; window. (The `previous' res is needed below!) | 1271 | ;; window. (The `previous' res is needed below!) |
| 1272 | (goto-char guess) | 1272 | (goto-char guess) |
| 1273 | (vertical-motion 0 (car windows)) | 1273 | (vertical-motion 0 (car windows)) |
| @@ -1508,9 +1508,9 @@ non-first windows in Follow mode." | |||
| 1508 | (setq win-start-end (follow-windows-start-end windows)) | 1508 | (setq win-start-end (follow-windows-start-end windows)) |
| 1509 | (follow-invalidate-cache) | 1509 | (follow-invalidate-cache) |
| 1510 | ;; When the point ends up in another window. This | 1510 | ;; When the point ends up in another window. This |
| 1511 | ;; happends when dest is in the beginning of the | 1511 | ;; happens when dest is in the beginning of the |
| 1512 | ;; file and the selected window is not the first. | 1512 | ;; file and the selected window is not the first. |
| 1513 | ;; It can also, in rare situations happend when | 1513 | ;; It can also, in rare situations happen when |
| 1514 | ;; long lines are used and there is a big | 1514 | ;; long lines are used and there is a big |
| 1515 | ;; difference between the width of the windows. | 1515 | ;; difference between the width of the windows. |
| 1516 | ;; (When scrolling one line in a wide window which | 1516 | ;; (When scrolling one line in a wide window which |
| @@ -2162,6 +2162,37 @@ This prevents `mouse-drag-region' from messing things up." | |||
| 2162 | 2162 | ||
| 2163 | ;;{{{ The end | 2163 | ;;{{{ The end |
| 2164 | 2164 | ||
| 2165 | (defun follow-unload-function () | ||
| 2166 | (easy-menu-remove-item nil '("Tools") "Follow") | ||
| 2167 | (follow-stop-intercept-process-output) | ||
| 2168 | (dolist (group '((before | ||
| 2169 | ;; XEmacs | ||
| 2170 | isearch-done | ||
| 2171 | ;; both | ||
| 2172 | set-process-filter sit-for move-overlay) | ||
| 2173 | (after | ||
| 2174 | ;; Emacs | ||
| 2175 | scroll-bar-drag scroll-bar-drag-1 scroll-bar-scroll-down | ||
| 2176 | scroll-bar-scroll-up scroll-bar-set-window-start | ||
| 2177 | ;; XEmacs | ||
| 2178 | scrollbar-line-down scrollbar-line-up scrollbar-page-down | ||
| 2179 | scrollbar-page-up scrollbar-to-bottom scrollbar-to-top | ||
| 2180 | scrollbar-vertical-drag | ||
| 2181 | ;; both | ||
| 2182 | process-filter))) | ||
| 2183 | (let ((class (car group))) | ||
| 2184 | (dolist (fun (cdr group)) | ||
| 2185 | (when (functionp fun) | ||
| 2186 | (condition-case nil | ||
| 2187 | (progn | ||
| 2188 | (ad-remove-advice fun class | ||
| 2189 | (intern (concat "follow-" (symbol-name fun)))) | ||
| 2190 | (ad-update fun)) | ||
| 2191 | (error nil)))))) | ||
| 2192 | nil) | ||
| 2193 | |||
| 2194 | (defvar follow-unload-function 'follow-unload-function) | ||
| 2195 | |||
| 2165 | ;; | 2196 | ;; |
| 2166 | ;; We're done! | 2197 | ;; We're done! |
| 2167 | ;; | 2198 | ;; |