/[emacs]/emacs/lisp/which-func.el
ViewVC logotype

Diff of /emacs/lisp/which-func.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by rms, Sun May 18 15:07:11 2003 UTC revision 1.33 by lektu, Sun May 25 02:02:45 2003 UTC
# Line 175  It creates the Imenu index for the buffe Line 175  It creates the Imenu index for the buffe
175  ;;;###autoload  ;;;###autoload
176  (defalias 'which-func-mode 'which-function-mode)  (defalias 'which-func-mode 'which-function-mode)
177    
178    (defvar which-func-update-timer nil)
179    
180  ;; This is the name people would normally expect.  ;; This is the name people would normally expect.
181  ;;;###autoload  ;;;###autoload
182  (define-minor-mode which-function-mode  (define-minor-mode which-function-mode
# Line 188  and off otherwise." Line 190  and off otherwise."
190    (if which-function-mode    (if which-function-mode
191        ;;Turn it on        ;;Turn it on
192        (progn        (progn
193          (add-hook 'post-command-idle-hook 'which-func-update)          (setq which-func-update-timer
194                  (run-with-idle-timer idle-update-delay t 'which-func-update))
195          (dolist (buf (buffer-list))          (dolist (buf (buffer-list))
196            (with-current-buffer buf            (with-current-buffer buf
197              (setq which-func-mode              (setq which-func-mode
198                    (or (eq which-func-modes t)                    (or (eq which-func-modes t)
199                        (member major-mode which-func-modes))))))                        (member major-mode which-func-modes))))))
200      ;; Turn it off      ;; Turn it off
201      (remove-hook 'post-command-idle-hook 'which-func-update)      (cancel-timer which-func-update-timer)
202        (setq which-func-update-timer nil)
203      (dolist (buf (buffer-list))      (dolist (buf (buffer-list))
204        (with-current-buffer buf (setq which-func-mode nil)))))        (with-current-buffer buf (setq which-func-mode nil)))))
205    
# Line 222  If no function name is found, return nil Line 226  If no function name is found, return nil
226          (while alist          (while alist
227            (setq elem  (car-safe alist)            (setq elem  (car-safe alist)
228                  alist (cdr-safe alist))                  alist (cdr-safe alist))
229            ;; Elements of alist are either ("name" . marker), or            ;; Elements of alist are either ("name" . marker), or
230            ;; ("submenu" ("name" . marker) ... ).            ;; ("submenu" ("name" . marker) ... ).
231            (unless (listp (cdr elem))            (unless (listp (cdr elem))
232                (setq elem (list elem)))                (setq elem (list elem)))

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26