From 087674e88d0a35a88dc5ed9201a224fc61b9dc88 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 19 Oct 2007 10:37:01 +0000 Subject: [PATCH] (follow-unload-function): New function. --- lisp/ChangeLog | 2 ++ lisp/follow.el | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64de79e54ac..e0c32d7385c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2007-10-19 Juanma Barranquero + * follow.el (follow-unload-function): New function. + * loadhist.el (unload-function-features-list): Rename from `unload-hook-features-list'. (unload-hook-features-list): Add as obsolete alias. diff --git a/lisp/follow.el b/lisp/follow.el index 6400c799794..2ea4466ea05 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -404,8 +404,8 @@ After that, changing the prefix key requires manipulating keymaps." (funcall (symbol-function 'define-key-after) tools-map [follow] (cons "Follow" menumap) 'separator-follow)) - ;; Didn't find the last item, Adding to the top of - ;; tools. (This will probably never happend...) + ;; Didn't find the last item, adding to the top of + ;; tools. (This will probably never happen...) (define-key (current-global-map) [menu-bar tools follow] (cons "Follow" menumap)))) ;; No tools menu, add "Follow" to the menubar. @@ -790,7 +790,7 @@ in your `~/.emacs' file: ;;}}} ;;{{{ Movement -;; Note, these functions are not very useful, atleast not unless you +;; Note, these functions are not very useful, at least not unless you ;; rebind the rather cumbersome key sequence `C-c . p'. (defun follow-next-window () @@ -2243,6 +2243,36 @@ This prevents `mouse-drag-region' from messing things up." ;;{{{ The end +(defun follow-unload-function () + (follow-stop-intercept-process-output) + (dolist (group '((before + ;; XEmacs + isearch-done + ;; both + set-process-filter sit-for move-overlay) + (after + ;; Emacs + scroll-bar-drag scroll-bar-drag-1 scroll-bar-scroll-down + scroll-bar-scroll-up scroll-bar-set-window-start + ;; XEmacs + scrollbar-line-down scrollbar-line-up scrollbar-page-down + scrollbar-page-up scrollbar-to-bottom scrollbar-to-top + scrollbar-vertical-drag + ;; both + process-filter))) + (let ((class (car group))) + (dolist (fun (cdr group)) + (when (functionp fun) + (condition-case nil + (progn + (ad-remove-advice fun class + (intern (concat "follow-" (symbol-name fun)))) + (ad-update fun)) + (error nil)))))) + nil) + +(defvar follow-unload-function 'follow-unload-function) + ;; ;; We're done! ;; -- 2.39.2