# HG changeset patch # User Stefan Monnier # Date 981670471 0 # Node ID 7ded5b71182f050e74c7a9c10dc23b3d9c155379 # Parent 72da309edab7c8b44460686b2e3750686d45bc08 (which-func-mode): Invert which-func-mode-global. Fix from Juanma Barranquero . diff -r 72da309edab7 -r 7ded5b71182f lisp/which-func.el --- 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.