summaryrefslogtreecommitdiff
path: root/lisp/imenu.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-02-02 09:55:40 +0100
committerStefan Kangas <stefan@marxist.se>2021-02-02 09:57:07 +0100
commite0fc879c0c2185bb5858dc64eabf19ee267beac3 (patch)
tree1a6303a48b6679d5cfbb69eb7bc08513d501adc6 /lisp/imenu.el
parentcfe8d9e0f74a1256cb75bd467b866f03ac513634 (diff)
downloademacs-e0fc879c0c2185bb5858dc64eabf19ee267beac3.tar.gz
Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list) (align-mode-exclude-rules-list): * lisp/bookmark.el (bookmark-current-bookmark) (bookmark-annotation-name) (bookmark--annotation-from-bookmark-list): * lisp/calc/calc-embed.el (calc-embedded-all-active) (calc-embedded-some-active): * lisp/comint.el (comint-password-function): * lisp/completion.el (completion-syntax-table): * lisp/dframe.el (dframe-track-mouse-function) (dframe-help-echo-function, dframe-mouse-click-function) (dframe-mouse-position-function, dframe-timer) (dframe-attached-frame, dframe-controlled): * lisp/ehelp.el (electric-help-orig-major-mode): * lisp/eshell/esh-util.el (eshell-path-env): * lisp/expand.el (expand-pos, expand-index, expand-point): * lisp/face-remap.el (text-scale-mode-remapping) (text-scale-mode-lighter, text-scale-mode-amount) (text-scale-remap-header-line, buffer-face-mode-remapping): * lisp/ffap.el (ffap-menu-alist): * lisp/files-x.el (connection-local-variables-alist): * lisp/foldout.el (foldout-fold-list, foldout-mode-line-string): * lisp/follow.el (follow-start-end-invalid): * lisp/forms.el (forms--mode-setup): * lisp/gnus/message.el (message-cross-post-old-target) (message-options): * lisp/help-mode.el (help-xref-stack, help-xref-forward-stack) (help-xref-stack-item, help-xref-stack-forward-item): * lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay): * lisp/hilit-chg.el (hilit-chg-string): * lisp/ido.el (ido-eoinput): * lisp/imenu.el (imenu-generic-expression) (imenu-create-index-function, imenu-default-goto-function) (imenu-prev-index-position-function) (imenu-extract-index-name-function, imenu-name-lookup-function) (imenu-syntax-alist, imenu-case-fold-search): * lisp/jka-compr.el (jka-compr-really-do-compress): * lisp/language/ethio-util.el (ethio-prefer-ascii-space): * lisp/leim/quail/hangul.el (hangul-input-method-help-text): * lisp/leim/quail/japanese.el (quail-japanese-package-saved): * lisp/linum.el (linum-overlays, linum-available): * lisp/man.el (Man-original-frame, Man-arguments, Man--sections) (Man--refpages, Man-page-list, Man-current-page) (Man-page-mode-string): * lisp/pcomplete.el (pcomplete-current-completions) (pcomplete-last-completion-length) (pcomplete-last-completion-stub, pcomplete-last-completion-raw) (pcomplete-last-window-config, pcomplete-window-restore-timer): * lisp/reveal.el (reveal-open-spots, reveal-last-tick): * lisp/ruler-mode.el (ruler-mode): * lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save): * lisp/server.el (server-buffer-clients, server-existing-buffer): * lisp/tab-line.el (tab-line-exclude): * lisp/tar-mode.el (tar-data-buffer, tar-data-swapped): * lisp/thumbs.el (thumbs-current-tmp-filename) (thumbs-current-image-filename, thumbs-extra-images) (thumbs-image-num, thumbs-buffer, thumbs-marked-list): * lisp/tutorial.el (tutorial--point-before-chkeys) (tutorial--point-after-chkeys, tutorial--lang): * lisp/url/url-vars.el (url-current-object) (url-current-mime-headers, url-current-lastloc): * lisp/view.el (view-mode, view-old-buffer-read-only) (view-old-Helper-return-blurb, view-page-size) (view-half-page-size, view-last-regexp, view-return-to-alist) (view-exit-action, view-overlay): * lisp/wid-edit.el (widget-global-map, widget-field-new) (widget-field-list, widget-field-last, widget-field-was): * lisp/woman.el (woman-imenu-done): Prefer defvar-local.
Diffstat (limited to 'lisp/imenu.el')
-rw-r--r--lisp/imenu.el35
1 files changed, 10 insertions, 25 deletions
diff --git a/lisp/imenu.el b/lisp/imenu.el
index b5cd18a689d..2a557e04536 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -187,7 +187,7 @@ uses `imenu--generic-function')."
:version "24.4")
;;;###autoload
-(defvar imenu-generic-expression nil
+(defvar-local imenu-generic-expression nil
"List of definition matchers for creating an Imenu index.
Each element of this list should have the form
@@ -223,13 +223,10 @@ characters which normally have \"symbol\" syntax are considered to have
\"word\" syntax during matching.")
;;;###autoload(put 'imenu-generic-expression 'risky-local-variable t)
-;;;###autoload
-(make-variable-buffer-local 'imenu-generic-expression)
-
;;;; Hooks
;;;###autoload
-(defvar imenu-create-index-function 'imenu-default-create-index-function
+(defvar-local imenu-create-index-function 'imenu-default-create-index-function
"The function to use for creating an index alist of the current buffer.
It should be a function that takes no arguments and returns
@@ -237,11 +234,9 @@ an index alist of the current buffer. The function is
called within a `save-excursion'.
See `imenu--index-alist' for the format of the buffer index alist.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-create-index-function)
;;;###autoload
-(defvar imenu-prev-index-position-function 'beginning-of-defun
+(defvar-local imenu-prev-index-position-function 'beginning-of-defun
"Function for finding the next index position.
If `imenu-create-index-function' is set to
@@ -251,21 +246,17 @@ file.
The function should leave point at the place to be connected to the
index and it should return nil when it doesn't find another index.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-prev-index-position-function)
;;;###autoload
-(defvar imenu-extract-index-name-function nil
+(defvar-local imenu-extract-index-name-function nil
"Function for extracting the index item name, given a position.
This function is called after `imenu-prev-index-position-function'
finds a position for an index item, with point at that position.
It should return the name for that index item.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-extract-index-name-function)
;;;###autoload
-(defvar imenu-name-lookup-function nil
+(defvar-local imenu-name-lookup-function nil
"Function to compare string with index item.
This function will be called with two strings, and should return
@@ -275,15 +266,11 @@ If nil, comparison is done with `string='.
Set this to some other function for more advanced comparisons,
such as \"begins with\" or \"name matches and number of
arguments match\".")
-;;;###autoload
-(make-variable-buffer-local 'imenu-name-lookup-function)
;;;###autoload
-(defvar imenu-default-goto-function 'imenu-default-goto-function
+(defvar-local imenu-default-goto-function 'imenu-default-goto-function
"The default function called when selecting an Imenu item.
The function in this variable is called when selecting a normal index-item.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-default-goto-function)
(defun imenu--subalist-p (item)
@@ -554,7 +541,8 @@ Non-nil arguments are in recursive calls."
(setq alist nil res elt))))
res))
-(defvar imenu-syntax-alist nil
+;;;###autoload
+(defvar-local imenu-syntax-alist nil
"Alist of syntax table modifiers to use while in `imenu--generic-function'.
The car of the assocs may be either a character or a string and the
@@ -564,8 +552,6 @@ a string, all the characters in the string get the specified syntax.
This is typically used to give word syntax to characters which
normally have symbol syntax to simplify `imenu-expression'
and speed-up matching.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-syntax-alist)
(defun imenu-default-create-index-function ()
"Default function to create an index alist of the current buffer.
@@ -607,14 +593,13 @@ The alternate method, which is the one most often used, is to call
;;; Generic index gathering function.
;;;
-(defvar imenu-case-fold-search t
+;;;###autoload
+(defvar-local imenu-case-fold-search t
"Defines whether `imenu--generic-function' should fold case when matching.
This variable should be set (only) by initialization code
for modes which use `imenu--generic-function'. If it is not set, but
`font-lock-defaults' is set, then font-lock's setting is used.")
-;;;###autoload
-(make-variable-buffer-local 'imenu-case-fold-search)
;; This function can be called with quitting disabled,
;; so it needs to be careful never to loop!