Mercurial > emacs
comparison lisp/follow.el @ 79149:6ddbf3d3f1a7
(follow-unload-function): New function.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 19 Oct 2007 10:33:32 +0000 |
parents | e68bb9eaf3a5 |
children | 3e37b479924d |
comparison
equal
deleted
inserted
replaced
79148:361a21ac1081 | 79149:6ddbf3d3f1a7 |
---|---|
402 (funcall (symbol-function 'define-key-after) | 402 (funcall (symbol-function 'define-key-after) |
403 tools-map [separator-follow] '("--") last) | 403 tools-map [separator-follow] '("--") last) |
404 (funcall (symbol-function 'define-key-after) | 404 (funcall (symbol-function 'define-key-after) |
405 tools-map [follow] (cons "Follow" menumap) | 405 tools-map [follow] (cons "Follow" menumap) |
406 'separator-follow)) | 406 'separator-follow)) |
407 ;; Didn't find the last item, Adding to the top of | 407 ;; Didn't find the last item, adding to the top of |
408 ;; tools. (This will probably never happend...) | 408 ;; tools. (This will probably never happen...) |
409 (define-key (current-global-map) [menu-bar tools follow] | 409 (define-key (current-global-map) [menu-bar tools follow] |
410 (cons "Follow" menumap)))) | 410 (cons "Follow" menumap)))) |
411 ;; No tools menu, add "Follow" to the menubar. | 411 ;; No tools menu, add "Follow" to the menubar. |
412 (define-key mainmap [menu-bar follow] | 412 (define-key mainmap [menu-bar follow] |
413 (cons "Follow" menumap))))) | 413 (cons "Follow" menumap))))) |
788 (follow-switch-to-buffer-all)) | 788 (follow-switch-to-buffer-all)) |
789 | 789 |
790 ;;}}} | 790 ;;}}} |
791 ;;{{{ Movement | 791 ;;{{{ Movement |
792 | 792 |
793 ;; Note, these functions are not very useful, atleast not unless you | 793 ;; Note, these functions are not very useful, at least not unless you |
794 ;; rebind the rather cumbersome key sequence `C-c . p'. | 794 ;; rebind the rather cumbersome key sequence `C-c . p'. |
795 | 795 |
796 (defun follow-next-window () | 796 (defun follow-next-window () |
797 "Select the next window showing the same buffer." | 797 "Select the next window showing the same buffer." |
798 (interactive) | 798 (interactive) |
2241 | 2241 |
2242 ;;}}} | 2242 ;;}}} |
2243 | 2243 |
2244 ;;{{{ The end | 2244 ;;{{{ The end |
2245 | 2245 |
2246 (defun follow-unload-function () | |
2247 (follow-stop-intercept-process-output) | |
2248 (dolist (group '((before | |
2249 ;; XEmacs | |
2250 isearch-done | |
2251 ;; both | |
2252 set-process-filter sit-for move-overlay) | |
2253 (after | |
2254 ;; Emacs | |
2255 scroll-bar-drag scroll-bar-drag-1 scroll-bar-scroll-down | |
2256 scroll-bar-scroll-up scroll-bar-set-window-start | |
2257 ;; XEmacs | |
2258 scrollbar-line-down scrollbar-line-up scrollbar-page-down | |
2259 scrollbar-page-up scrollbar-to-bottom scrollbar-to-top | |
2260 scrollbar-vertical-drag | |
2261 ;; both | |
2262 process-filter))) | |
2263 (let ((class (car group))) | |
2264 (dolist (fun (cdr group)) | |
2265 (when (functionp fun) | |
2266 (condition-case nil | |
2267 (progn | |
2268 (ad-remove-advice fun class | |
2269 (intern (concat "follow-" (symbol-name fun)))) | |
2270 (ad-update fun)) | |
2271 (error nil)))))) | |
2272 nil) | |
2273 | |
2274 (defvar follow-unload-function 'follow-unload-function) | |
2275 | |
2246 ;; | 2276 ;; |
2247 ;; We're done! | 2277 ;; We're done! |
2248 ;; | 2278 ;; |
2249 | 2279 |
2250 (provide 'follow) | 2280 (provide 'follow) |