changeset 35990:7ded5b71182f

(which-func-mode): Invert which-func-mode-global. Fix from Juanma Barranquero <lektu@uol.com.br>.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 08 Feb 2001 22:14:31 +0000
parents 72da309edab7
children 0f2992f8e370
files lisp/which-func.el
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/which-func.el	Thu Feb 08 20:00:27 2001 +0000
+++ b/lisp/which-func.el	Thu Feb 08 22:14:31 2001 +0000
@@ -188,21 +188,21 @@
 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.