comparison lisp/which-func.el @ 38405:d215f2e13397

(which-func-mode, which-func-ff-hook) (which-function-mode): Remove references to which-func-mode-global.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 13 Jul 2001 14:37:07 +0000
parents a23820c19d03
children 153f1b1f2efd
comparison
equal deleted inserted replaced
38404:f4969ed98b9c 38405:d215f2e13397
1 ;;; which-func.el --- Print current function in mode line 1 ;;; which-func.el --- Print current function in mode line
2 2
3 ;; Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc. 3 ;; Copyright (C) 1994, 1997, 1998, 2001 Free Software Foundation, Inc.
4 4
5 ;; Author: Alex Rezinsky <alexr@msil.sps.mot.com> 5 ;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
6 ;; (doesn't seem to be responsive any more) 6 ;; (doesn't seem to be responsive any more)
7 ;; Keywords: mode-line, imenu, tools 7 ;; Keywords: mode-line, imenu, tools
8 8
125 (make-variable-buffer-local 'which-func-current) 125 (make-variable-buffer-local 'which-func-current)
126 (make-variable-buffer-local 'which-func-previous) 126 (make-variable-buffer-local 'which-func-previous)
127 127
128 (defvar which-func-mode nil 128 (defvar which-func-mode nil
129 "Non-nil means display current function name in mode line. 129 "Non-nil means display current function name in mode line.
130 This makes a difference only if `which-func-mode-global' is non-nil") 130 This makes a difference only if `which-function-mode' is non-nil")
131 (make-variable-buffer-local 'which-func-mode) 131 (make-variable-buffer-local 'which-func-mode)
132 ;;(put 'which-func-mode 'permanent-local t) 132 ;;(put 'which-func-mode 'permanent-local t)
133 133
134 (add-hook 'find-file-hooks 'which-func-ff-hook t) 134 (add-hook 'find-file-hooks 'which-func-ff-hook t)
135 135
136 (defun which-func-ff-hook () 136 (defun which-func-ff-hook ()
137 "File find hook for Which Function mode. 137 "File find hook for Which Function mode.
138 It creates the Imenu index for the buffer, if necessary." 138 It creates the Imenu index for the buffer, if necessary."
139 (setq which-func-mode 139 (setq which-func-mode
140 (and which-func-mode-global 140 (and which-function-mode
141 (or (eq which-func-modes t) (member major-mode which-func-modes)))) 141 (or (eq which-func-modes t)
142 (member major-mode which-func-modes))))
142 143
143 (condition-case nil 144 (condition-case nil
144 (if (and which-func-mode 145 (if (and which-func-mode
145 (not (member major-mode which-func-non-auto-modes)) 146 (not (member major-mode which-func-non-auto-modes))
146 (or (null which-func-maxout) 147 (or (null which-func-maxout)
175 continuously displayed in the mode line, in certain major modes. 176 continuously displayed in the mode line, in certain major modes.
176 177
177 With prefix ARG, turn Which Function mode on iff arg is positive, 178 With prefix ARG, turn Which Function mode on iff arg is positive,
178 and off otherwise." 179 and off otherwise."
179 :global t :group 'which-func 180 :global t :group 'which-func
180 (if which-func-mode-global 181 (if which-function-mode
181 ;;Turn it on 182 ;;Turn it on
182 (progn 183 (progn
183 (add-hook 'post-command-idle-hook 'which-func-update) 184 (add-hook 'post-command-idle-hook 'which-func-update)
184 (dolist (buf (buffer-list)) 185 (dolist (buf (buffer-list))
185 (with-current-buffer buf 186 (with-current-buffer buf