]> git.eshelyaron.com Git - emacs.git/commitdiff
(which-func-mode): Invert which-func-mode-global.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 8 Feb 2001 22:14:49 +0000 (22:14 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 8 Feb 2001 22:14:49 +0000 (22:14 +0000)
Fix from Juanma Barranquero <lektu@uol.com.br>.

lisp/ChangeLog
lisp/which-func.el

index 888b39645fddc0d920d09136af4a417eb1022d76..80f5c801f7b111b92cf6860c39fb616b02208e61 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-08  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * which-func.el (which-func-mode): Invert which-func-mode-global.
+       Fix from Juanma Barranquero <lektu@uol.com.br>.
+
 2001-02-08  Dave Love  <fx@gnu.org>
 
        * textmodes/paragraphs.el (sentence-end): Doc fix.
        * eshell/em-rebind.el (eshell-cannot-leave-input-list): Remove
        `backward-line'.
 
-       * play/pong.el (pong-blank-color, pong-bat-color) 
-       (pong-ball-color, pong-border-color, pong-left-key) 
-       (pong-right-key, pong-up-key, pong-down-key, pong-quit-key) 
-       (pong-pause-key, pong-resume-key, pong-timer-delay): 
-       * mail/mh-comp.el (mh-compose-letter-function): 
-       * eshell/esh-mode.el (eshell-skip-prompt-function): 
-       * emulation/viper-ex.el (ex-unix-type-shell-options): 
-       * recentf.el (recentf-menu-filter): 
-       * ps-print.el (ps-print-region-function): 
-       * lpr.el (print-region-function): 
-       * forms.el (forms-mode-hooks): 
-       * dirtrack.el (dirtrack-directory-change-hook): 
-       * cus-start.el (temp-buffer-show-function, display-buffer-function): 
-       * textmodes/spell.el (spell-filter): 
-       * textmodes/fill.el (adaptive-fill-function): 
-       * textmodes/bibtex.el (bibtex-autokey-before-presentation-function): 
-       * progmodes/etags.el (find-tag-default-function): 
-       * progmodes/dcl-mode.el (dcl-calc-command-indent-function): 
+       * play/pong.el (pong-blank-color, pong-bat-color)
+       (pong-ball-color, pong-border-color, pong-left-key)
+       (pong-right-key, pong-up-key, pong-down-key, pong-quit-key)
+       (pong-pause-key, pong-resume-key, pong-timer-delay):
+       * mail/mh-comp.el (mh-compose-letter-function):
+       * eshell/esh-mode.el (eshell-skip-prompt-function):
+       * emulation/viper-ex.el (ex-unix-type-shell-options):
+       * recentf.el (recentf-menu-filter):
+       * ps-print.el (ps-print-region-function):
+       * lpr.el (print-region-function):
+       * forms.el (forms-mode-hooks):
+       * dirtrack.el (dirtrack-directory-change-hook):
+       * cus-start.el (temp-buffer-show-function, display-buffer-function):
+       * textmodes/spell.el (spell-filter):
+       * textmodes/fill.el (adaptive-fill-function):
+       * textmodes/bibtex.el (bibtex-autokey-before-presentation-function):
+       * progmodes/etags.el (find-tag-default-function):
+       * progmodes/dcl-mode.el (dcl-calc-command-indent-function):
        * progmodes/ada-mode.el (ada-popup-key): Fix :type.
 
 2001-02-07  Eli Zaretskii  <eliz@is.elta.co.il>
index b043753e68821a37dacfac2af203f7d7e7602f62..5a70d5478c7ed85f0271b369b94a54c09a0f55c1 100644 (file)
@@ -188,21 +188,21 @@ With prefix ARG, turn Which Function mode on iff arg is positive,
 and off otherwise."
   (interactive "P")
   (setq which-func-mode-global
-       (or (and (null arg) which-func-mode-global)
-           (<= (prefix-numeric-value arg) 0)))
+        (and (or arg (not which-func-mode-global))
+             (> (prefix-numeric-value arg) 0)))
   (if which-func-mode-global
-      ;; Turn it off
+      ;;Turn it on
       (progn
-       (remove-hook 'post-command-idle-hook 'which-func-update)
-       (dolist (buf (buffer-list))
-         (with-current-buffer buf (setq which-func-mode nil))))
-    ;;Turn it on
-    (add-hook 'post-command-idle-hook 'which-func-update)
+        (add-hook 'post-command-idle-hook 'which-func-update)
+        (dolist (buf (buffer-list))
+          (with-current-buffer buf
+            (setq which-func-mode
+                  (or (eq which-func-modes t)
+                      (member major-mode which-func-modes))))))
+    ;; Turn it off
+    (remove-hook 'post-command-idle-hook 'which-func-update)
     (dolist (buf (buffer-list))
-      (with-current-buffer buf
-       (setq which-func-mode
-             (or (eq which-func-modes t)
-                 (member major-mode which-func-modes)))))))
+      (with-current-buffer buf (setq which-func-mode nil)))))
 
 (defun which-function ()
   "Return current function name based on point.