diff options
| author | Stefan Kangas | 2021-01-31 14:10:10 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-01-31 14:11:11 +0100 |
| commit | d7405e474b43ba5c4238cc27f2aaa61341b828b4 (patch) | |
| tree | 3c67d93020fd6a2ed0b64460e48893738a173e43 | |
| parent | 686caed4af6e92ae908f482151fa3da87aeab8ec (diff) | |
| download | emacs-d7405e474b43ba5c4238cc27f2aaa61341b828b4.tar.gz emacs-d7405e474b43ba5c4238cc27f2aaa61341b828b4.zip | |
Obsolete viper-deflocalvar for defvar-local
* lisp/emulation/viper-init.el (viper-deflocalvar): Make obsolete.
Use defvar-local.
* lisp/emulation/viper-cmd.el (viper--undo-change-group-handle):
* lisp/emulation/viper-init.el (viper-vi-intercept-minor-mode)
(viper-vi-basic-minor-mode, viper-vi-local-user-minor-mode)
(viper-vi-global-user-minor-mode)
(viper-vi-state-modifier-minor-mode)
(viper-vi-diehard-minor-mode, viper-vi-kbd-minor-mode)
(viper-insert-intercept-minor-mode)
(viper-insert-basic-minor-mode)
(viper-insert-local-user-minor-mode)
(viper-insert-global-user-minor-mode)
(viper-insert-state-modifier-minor-mode)
(viper-insert-diehard-minor-mode, viper-insert-kbd-minor-mode)
(viper-replace-minor-mode, viper-emacs-intercept-minor-mode)
(viper-emacs-local-user-minor-mode)
(viper-emacs-global-user-minor-mode, viper-emacs-kbd-minor-mode)
(viper-emacs-state-modifier-minor-mode)
(viper-vi-minibuffer-minor-mode)
(viper-insert-minibuffer-minor-mode)
(viper-automatic-iso-accents, viper-special-input-method)
(viper-intermediate-command, viper-began-as-replace)
(viper-replace-overlay, viper-last-posn-in-replace-region)
(viper-last-posn-while-in-insert-state)
(viper-sitting-in-replace, viper-replace-chars-to-delete)
(viper-replace-region-chars-deleted, viper-current-state)
(viper-cted, viper-current-indent, viper-preserve-indent)
(viper-auto-indent, viper-electric-mode, viper-insert-point)
(viper-pre-command-point, viper-com-point)
(viper-ex-style-motion, viper-ex-style-editing)
(viper-ESC-moves-cursor-back, viper-delete-backwards-in-replace)
(viper-related-files-and-buffers-ring)
(viper-local-search-start-marker, viper-search-overlay)
(viper-last-jump, viper-last-jump-ignore)
(viper-minibuffer-current-face, viper-minibuffer-overlay):
* lisp/emulation/viper-keym.el (viper-vi-local-user-map)
(viper-insert-local-user-map, viper-emacs-local-user-map)
(viper--key-maps, viper-need-new-vi-local-map)
(viper-need-new-insert-local-map)
(viper-need-new-emacs-local-map):
* lisp/emulation/viper-mous.el (viper-mouse-click-search-noerror)
(viper-mouse-click-search-limit):
* lisp/emulation/viper-util.el (viper-non-word-characters)
(viper-ALPHA-char-class):
* lisp/emulation/viper.el: Use defvar-local instead of now obsolete
macro viper-deflocalvar.
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 2 | ||||
| -rw-r--r-- | lisp/emulation/viper-init.el | 117 | ||||
| -rw-r--r-- | lisp/emulation/viper-keym.el | 22 | ||||
| -rw-r--r-- | lisp/emulation/viper-mous.el | 11 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 10 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 5 |
6 files changed, 68 insertions, 99 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 1e235831d6f..f38be908897 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -1624,7 +1624,7 @@ invokes the command before that, etc." | |||
| 1624 | ;; The following two functions are used to set up undo properly. | 1624 | ;; The following two functions are used to set up undo properly. |
| 1625 | ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines, | 1625 | ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines, |
| 1626 | ;; they are undone all at once. | 1626 | ;; they are undone all at once. |
| 1627 | (viper-deflocalvar viper--undo-change-group-handle nil) | 1627 | (defvar-local viper--undo-change-group-handle nil) |
| 1628 | (put 'viper--undo-change-group-handle 'permanent-local t) | 1628 | (put 'viper--undo-change-group-handle 'permanent-local t) |
| 1629 | 1629 | ||
| 1630 | (defun viper-adjust-undo () | 1630 | (defun viper-adjust-undo () |
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index cede99bff73..c05cf6a48b4 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -91,11 +91,9 @@ In all likelihood, you don't need to bother with this setting." | |||
| 91 | "Define VAR as a buffer-local variable. | 91 | "Define VAR as a buffer-local variable. |
| 92 | DEFAULT-VALUE is the default value, and DOCUMENTATION is the | 92 | DEFAULT-VALUE is the default value, and DOCUMENTATION is the |
| 93 | docstring. The variable becomes buffer-local whenever set." | 93 | docstring. The variable becomes buffer-local whenever set." |
| 94 | (declare (indent defun)) | 94 | (declare (indent defun) |
| 95 | `(progn | 95 | (obsolete defvar-local "28.1")) |
| 96 | (defvar ,var ,default-value | 96 | `(defvar-local ,var ,default-value ,documentation)) |
| 97 | ,(format "%s\n(buffer local)" documentation)) | ||
| 98 | (make-variable-buffer-local ',var))) | ||
| 99 | 97 | ||
| 100 | ;; (viper-loop COUNT BODY) Execute BODY COUNT times. | 98 | ;; (viper-loop COUNT BODY) Execute BODY COUNT times. |
| 101 | (defmacro viper-loop (count &rest body) | 99 | (defmacro viper-loop (count &rest body) |
| @@ -161,87 +159,87 @@ docstring. The variable becomes buffer-local whenever set." | |||
| 161 | ;;; Viper minor modes | 159 | ;;; Viper minor modes |
| 162 | 160 | ||
| 163 | ;; Mode for vital things like \e, C-z. | 161 | ;; Mode for vital things like \e, C-z. |
| 164 | (viper-deflocalvar viper-vi-intercept-minor-mode nil) | 162 | (defvar-local viper-vi-intercept-minor-mode nil) |
| 165 | 163 | ||
| 166 | (viper-deflocalvar viper-vi-basic-minor-mode nil | 164 | (defvar-local viper-vi-basic-minor-mode nil |
| 167 | "Viper's minor mode for Vi bindings.") | 165 | "Viper's minor mode for Vi bindings.") |
| 168 | 166 | ||
| 169 | (viper-deflocalvar viper-vi-local-user-minor-mode nil | 167 | (defvar-local viper-vi-local-user-minor-mode nil |
| 170 | "Auxiliary minor mode for user-defined local bindings in Vi state.") | 168 | "Auxiliary minor mode for user-defined local bindings in Vi state.") |
| 171 | 169 | ||
| 172 | (viper-deflocalvar viper-vi-global-user-minor-mode nil | 170 | (defvar-local viper-vi-global-user-minor-mode nil |
| 173 | "Auxiliary minor mode for user-defined global bindings in Vi state.") | 171 | "Auxiliary minor mode for user-defined global bindings in Vi state.") |
| 174 | 172 | ||
| 175 | (viper-deflocalvar viper-vi-state-modifier-minor-mode nil | 173 | (defvar-local viper-vi-state-modifier-minor-mode nil |
| 176 | "Minor mode used to make major-mode-specific modification to Vi state.") | 174 | "Minor mode used to make major-mode-specific modification to Vi state.") |
| 177 | 175 | ||
| 178 | (viper-deflocalvar viper-vi-diehard-minor-mode nil | 176 | (defvar-local viper-vi-diehard-minor-mode nil |
| 179 | "This minor mode is in effect when the user wants Viper to be Vi.") | 177 | "This minor mode is in effect when the user wants Viper to be Vi.") |
| 180 | 178 | ||
| 181 | (viper-deflocalvar viper-vi-kbd-minor-mode nil | 179 | (defvar-local viper-vi-kbd-minor-mode nil |
| 182 | "Minor mode for Ex command macros in Vi state. | 180 | "Minor mode for Ex command macros in Vi state. |
| 183 | The corresponding keymap stores key bindings of Vi macros defined with | 181 | The corresponding keymap stores key bindings of Vi macros defined with |
| 184 | the Ex command :map.") | 182 | the Ex command :map.") |
| 185 | 183 | ||
| 186 | ;; Mode for vital things like \e, C-z. | 184 | ;; Mode for vital things like \e, C-z. |
| 187 | (viper-deflocalvar viper-insert-intercept-minor-mode nil) | 185 | (defvar-local viper-insert-intercept-minor-mode nil) |
| 188 | 186 | ||
| 189 | (viper-deflocalvar viper-insert-basic-minor-mode nil | 187 | (defvar-local viper-insert-basic-minor-mode nil |
| 190 | "Viper's minor mode for bindings in Insert mode.") | 188 | "Viper's minor mode for bindings in Insert mode.") |
| 191 | 189 | ||
| 192 | (viper-deflocalvar viper-insert-local-user-minor-mode nil | 190 | (defvar-local viper-insert-local-user-minor-mode nil |
| 193 | "Auxiliary minor mode for buffer-local user-defined bindings in Insert state. | 191 | "Auxiliary minor mode for buffer-local user-defined bindings in Insert state. |
| 194 | This is a way to overshadow normal Insert mode bindings locally to certain | 192 | This is a way to overshadow normal Insert mode bindings locally to certain |
| 195 | designated buffers.") | 193 | designated buffers.") |
| 196 | 194 | ||
| 197 | (viper-deflocalvar viper-insert-global-user-minor-mode nil | 195 | (defvar-local viper-insert-global-user-minor-mode nil |
| 198 | "Auxiliary minor mode for global user-defined bindings in Insert state.") | 196 | "Auxiliary minor mode for global user-defined bindings in Insert state.") |
| 199 | 197 | ||
| 200 | (viper-deflocalvar viper-insert-state-modifier-minor-mode nil | 198 | (defvar-local viper-insert-state-modifier-minor-mode nil |
| 201 | "Minor mode used to make major-mode-specific modification to Insert state.") | 199 | "Minor mode used to make major-mode-specific modification to Insert state.") |
| 202 | 200 | ||
| 203 | (viper-deflocalvar viper-insert-diehard-minor-mode nil | 201 | (defvar-local viper-insert-diehard-minor-mode nil |
| 204 | "Minor mode that simulates Vi very closely. | 202 | "Minor mode that simulates Vi very closely. |
| 205 | Not recommended, except for the novice user.") | 203 | Not recommended, except for the novice user.") |
| 206 | 204 | ||
| 207 | (viper-deflocalvar viper-insert-kbd-minor-mode nil | 205 | (defvar-local viper-insert-kbd-minor-mode nil |
| 208 | "Minor mode for Ex command macros Insert state. | 206 | "Minor mode for Ex command macros Insert state. |
| 209 | The corresponding keymap stores key bindings of Vi macros defined with | 207 | The corresponding keymap stores key bindings of Vi macros defined with |
| 210 | the Ex command :map!.") | 208 | the Ex command :map!.") |
| 211 | 209 | ||
| 212 | (viper-deflocalvar viper-replace-minor-mode nil | 210 | (defvar-local viper-replace-minor-mode nil |
| 213 | "Minor mode in effect in replace state (cw, C, and the like commands).") | 211 | "Minor mode in effect in replace state (cw, C, and the like commands).") |
| 214 | 212 | ||
| 215 | ;; Mode for vital things like \C-z and \C-x) This is set to t, when viper-mode | 213 | ;; Mode for vital things like \C-z and \C-x) This is set to t, when viper-mode |
| 216 | ;; is invoked. So, any new buffer will have C-z defined as switch to Vi, | 214 | ;; is invoked. So, any new buffer will have C-z defined as switch to Vi, |
| 217 | ;; unless we switched states in this buffer | 215 | ;; unless we switched states in this buffer |
| 218 | (viper-deflocalvar viper-emacs-intercept-minor-mode nil) | 216 | (defvar-local viper-emacs-intercept-minor-mode nil) |
| 219 | 217 | ||
| 220 | (viper-deflocalvar viper-emacs-local-user-minor-mode nil | 218 | (defvar-local viper-emacs-local-user-minor-mode nil |
| 221 | "Minor mode for local user bindings effective in Emacs state. | 219 | "Minor mode for local user bindings effective in Emacs state. |
| 222 | Users can use it to override Emacs bindings when Viper is in its Emacs | 220 | Users can use it to override Emacs bindings when Viper is in its Emacs |
| 223 | state.") | 221 | state.") |
| 224 | 222 | ||
| 225 | (viper-deflocalvar viper-emacs-global-user-minor-mode nil | 223 | (defvar-local viper-emacs-global-user-minor-mode nil |
| 226 | "Minor mode for global user bindings in effect in Emacs state. | 224 | "Minor mode for global user bindings in effect in Emacs state. |
| 227 | Users can use it to override Emacs bindings when Viper is in its Emacs | 225 | Users can use it to override Emacs bindings when Viper is in its Emacs |
| 228 | state.") | 226 | state.") |
| 229 | 227 | ||
| 230 | (viper-deflocalvar viper-emacs-kbd-minor-mode nil | 228 | (defvar-local viper-emacs-kbd-minor-mode nil |
| 231 | "Minor mode for Vi style macros in Emacs state. | 229 | "Minor mode for Vi style macros in Emacs state. |
| 232 | The corresponding keymap stores key bindings of Vi macros defined with | 230 | The corresponding keymap stores key bindings of Vi macros defined with |
| 233 | `viper-record-kbd-macro' command. There is no Ex-level command to do this | 231 | `viper-record-kbd-macro' command. There is no Ex-level command to do this |
| 234 | interactively.") | 232 | interactively.") |
| 235 | 233 | ||
| 236 | (viper-deflocalvar viper-emacs-state-modifier-minor-mode nil | 234 | (defvar-local viper-emacs-state-modifier-minor-mode nil |
| 237 | "Minor mode used to make major-mode-specific modification to Emacs state. | 235 | "Minor mode used to make major-mode-specific modification to Emacs state. |
| 238 | For instance, a Vi purist may want to bind `dd' in Dired mode to a function | 236 | For instance, a Vi purist may want to bind `dd' in Dired mode to a function |
| 239 | that deletes a file.") | 237 | that deletes a file.") |
| 240 | 238 | ||
| 241 | (viper-deflocalvar viper-vi-minibuffer-minor-mode nil | 239 | (defvar-local viper-vi-minibuffer-minor-mode nil |
| 242 | "Minor mode that forces Vi-style when the Minibuffer is in Vi state.") | 240 | "Minor mode that forces Vi-style when the Minibuffer is in Vi state.") |
| 243 | 241 | ||
| 244 | (viper-deflocalvar viper-insert-minibuffer-minor-mode nil | 242 | (defvar-local viper-insert-minibuffer-minor-mode nil |
| 245 | "Minor mode that forces Vi-style when the Minibuffer is in Insert state.") | 243 | "Minor mode that forces Vi-style when the Minibuffer is in Insert state.") |
| 246 | 244 | ||
| 247 | 245 | ||
| @@ -284,7 +282,7 @@ Use `\\[viper-set-expert-level]' to change this.") | |||
| 284 | ;; If non-nil, ISO accents will be turned on in insert/replace emacs states and | 282 | ;; If non-nil, ISO accents will be turned on in insert/replace emacs states and |
| 285 | ;; turned off in vi-state. For some users, this behavior may be too | 283 | ;; turned off in vi-state. For some users, this behavior may be too |
| 286 | ;; primitive. In this case, use insert/emacs/vi state hooks. | 284 | ;; primitive. In this case, use insert/emacs/vi state hooks. |
| 287 | (viper-deflocalvar viper-automatic-iso-accents nil "") | 285 | (defvar-local viper-automatic-iso-accents nil "") |
| 288 | ;; Set iso-accents-mode to ARG. Check if it is bound first | 286 | ;; Set iso-accents-mode to ARG. Check if it is bound first |
| 289 | (defsubst viper-set-iso-accents-mode (arg) | 287 | (defsubst viper-set-iso-accents-mode (arg) |
| 290 | (if (boundp 'iso-accents-mode) | 288 | (if (boundp 'iso-accents-mode) |
| @@ -294,7 +292,7 @@ Use `\\[viper-set-expert-level]' to change this.") | |||
| 294 | ;; Don't change this! | 292 | ;; Don't change this! |
| 295 | (defvar viper-mule-hook-flag t) | 293 | (defvar viper-mule-hook-flag t) |
| 296 | ;; If non-nil, the default intl. input method is turned on. | 294 | ;; If non-nil, the default intl. input method is turned on. |
| 297 | (viper-deflocalvar viper-special-input-method nil "") | 295 | (defvar-local viper-special-input-method nil "") |
| 298 | 296 | ||
| 299 | ;; viper hook to run on input-method activation | 297 | ;; viper hook to run on input-method activation |
| 300 | (defun viper-activate-input-method-action () | 298 | (defun viper-activate-input-method-action () |
| @@ -357,7 +355,7 @@ it better fits your working style." | |||
| 357 | ;; Replace mode and changing text | 355 | ;; Replace mode and changing text |
| 358 | 356 | ||
| 359 | ;; Hack used to pass global states around for short period of time | 357 | ;; Hack used to pass global states around for short period of time |
| 360 | (viper-deflocalvar viper-intermediate-command nil "") | 358 | (defvar-local viper-intermediate-command nil "") |
| 361 | 359 | ||
| 362 | ;; This is used to pass the right Vi command key sequence to | 360 | ;; This is used to pass the right Vi command key sequence to |
| 363 | ;; viper-set-destructive-command whenever (this-command-keys) doesn't give the | 361 | ;; viper-set-destructive-command whenever (this-command-keys) doesn't give the |
| @@ -367,7 +365,7 @@ it better fits your working style." | |||
| 367 | (defconst viper-this-command-keys nil) | 365 | (defconst viper-this-command-keys nil) |
| 368 | 366 | ||
| 369 | ;; Indicates that the current destructive command has started in replace mode. | 367 | ;; Indicates that the current destructive command has started in replace mode. |
| 370 | (viper-deflocalvar viper-began-as-replace nil "") | 368 | (defvar-local viper-began-as-replace nil "") |
| 371 | 369 | ||
| 372 | (defcustom viper-allow-multiline-replace-regions t | 370 | (defcustom viper-allow-multiline-replace-regions t |
| 373 | "If non-nil, Viper will allow multi-line replace regions. | 371 | "If non-nil, Viper will allow multi-line replace regions. |
| @@ -398,7 +396,7 @@ delete the text being replaced, as in standard Vi." | |||
| 398 | ;; internal var, used to remember the default cursor color of emacs frames | 396 | ;; internal var, used to remember the default cursor color of emacs frames |
| 399 | (defvar viper-vi-state-cursor-color nil) | 397 | (defvar viper-vi-state-cursor-color nil) |
| 400 | 398 | ||
| 401 | (viper-deflocalvar viper-replace-overlay nil "") | 399 | (defvar-local viper-replace-overlay nil "") |
| 402 | (put 'viper-replace-overlay 'permanent-local t) | 400 | (put 'viper-replace-overlay 'permanent-local t) |
| 403 | 401 | ||
| 404 | (defcustom viper-replace-region-end-delimiter "$" | 402 | (defcustom viper-replace-region-end-delimiter "$" |
| @@ -430,24 +428,24 @@ color displays. By default, the delimiters are used only on TTYs." | |||
| 430 | ;; `viper-move-marker-locally' | 428 | ;; `viper-move-marker-locally' |
| 431 | ;; | 429 | ;; |
| 432 | ;; Remember the last position inside the replace region. | 430 | ;; Remember the last position inside the replace region. |
| 433 | (viper-deflocalvar viper-last-posn-in-replace-region nil) | 431 | (defvar-local viper-last-posn-in-replace-region nil) |
| 434 | ;; Remember the last position while inserting | 432 | ;; Remember the last position while inserting |
| 435 | (viper-deflocalvar viper-last-posn-while-in-insert-state nil) | 433 | (defvar-local viper-last-posn-while-in-insert-state nil) |
| 436 | (put 'viper-last-posn-in-replace-region 'permanent-local t) | 434 | (put 'viper-last-posn-in-replace-region 'permanent-local t) |
| 437 | (put 'viper-last-posn-while-in-insert-state 'permanent-local t) | 435 | (put 'viper-last-posn-while-in-insert-state 'permanent-local t) |
| 438 | 436 | ||
| 439 | (viper-deflocalvar viper-sitting-in-replace nil "") | 437 | (defvar-local viper-sitting-in-replace nil "") |
| 440 | (put 'viper-sitting-in-replace 'permanent-local t) | 438 | (put 'viper-sitting-in-replace 'permanent-local t) |
| 441 | 439 | ||
| 442 | ;; Remember the number of characters that have to be deleted in replace | 440 | ;; Remember the number of characters that have to be deleted in replace |
| 443 | ;; mode to compensate for the inserted characters. | 441 | ;; mode to compensate for the inserted characters. |
| 444 | (viper-deflocalvar viper-replace-chars-to-delete 0 "") | 442 | (defvar-local viper-replace-chars-to-delete 0 "") |
| 445 | ;; This variable is used internally by the before/after changed functions to | 443 | ;; This variable is used internally by the before/after changed functions to |
| 446 | ;; determine how many chars were deleted by the change. This can't be | 444 | ;; determine how many chars were deleted by the change. This can't be |
| 447 | ;; determined inside after-change-functions because those get the length of the | 445 | ;; determined inside after-change-functions because those get the length of the |
| 448 | ;; deleted region, not the number of chars deleted (which are two different | 446 | ;; deleted region, not the number of chars deleted (which are two different |
| 449 | ;; things under MULE). | 447 | ;; things under MULE). |
| 450 | (viper-deflocalvar viper-replace-region-chars-deleted 0 "") | 448 | (defvar-local viper-replace-region-chars-deleted 0 "") |
| 451 | 449 | ||
| 452 | ;; Insertion ring and command ring | 450 | ;; Insertion ring and command ring |
| 453 | (defcustom viper-insertion-ring-size 14 | 451 | (defcustom viper-insertion-ring-size 14 |
| @@ -490,28 +488,28 @@ will make it hard to use Vi-style timeout macros." | |||
| 490 | ;; Modes and related variables | 488 | ;; Modes and related variables |
| 491 | 489 | ||
| 492 | ;; Current mode. One of: `emacs-state', `vi-state', `insert-state' | 490 | ;; Current mode. One of: `emacs-state', `vi-state', `insert-state' |
| 493 | (viper-deflocalvar viper-current-state 'emacs-state) | 491 | (defvar-local viper-current-state 'emacs-state) |
| 494 | 492 | ||
| 495 | 493 | ||
| 496 | ;; Autoindent in insert | 494 | ;; Autoindent in insert |
| 497 | 495 | ||
| 498 | ;; Variable that keeps track of whether C-t has been pressed. | 496 | ;; Variable that keeps track of whether C-t has been pressed. |
| 499 | (viper-deflocalvar viper-cted nil "") | 497 | (defvar-local viper-cted nil "") |
| 500 | 498 | ||
| 501 | ;; Preserve the indent value, used by C-d in insert mode. | 499 | ;; Preserve the indent value, used by C-d in insert mode. |
| 502 | (viper-deflocalvar viper-current-indent 0) | 500 | (defvar-local viper-current-indent 0) |
| 503 | 501 | ||
| 504 | ;; Whether to preserve the indent, used by C-d in insert mode. | 502 | ;; Whether to preserve the indent, used by C-d in insert mode. |
| 505 | (viper-deflocalvar viper-preserve-indent nil) | 503 | (defvar-local viper-preserve-indent nil) |
| 506 | 504 | ||
| 507 | (viper-deflocalvar viper-auto-indent nil "") | 505 | (defvar-local viper-auto-indent nil "") |
| 508 | (defcustom viper-auto-indent nil | 506 | (defcustom viper-auto-indent nil |
| 509 | "Enable autoindent, if t. | 507 | "Enable autoindent, if t. |
| 510 | This is a buffer-local variable." | 508 | This is a buffer-local variable." |
| 511 | :type 'boolean | 509 | :type 'boolean |
| 512 | :group 'viper) | 510 | :group 'viper) |
| 513 | 511 | ||
| 514 | (viper-deflocalvar viper-electric-mode t "") | 512 | (defvar-local viper-electric-mode t "") |
| 515 | (defcustom viper-electric-mode t | 513 | (defcustom viper-electric-mode t |
| 516 | "If t, electrify Viper. | 514 | "If t, electrify Viper. |
| 517 | Currently, this only electrifies auto-indentation, making it appropriate to the | 515 | Currently, this only electrifies auto-indentation, making it appropriate to the |
| @@ -541,7 +539,7 @@ to a new place after repeating previous Vi command." | |||
| 541 | 539 | ||
| 542 | ;; Remember insert point as a marker. This is a local marker that must be | 540 | ;; Remember insert point as a marker. This is a local marker that must be |
| 543 | ;; initialized to nil and moved with `viper-move-marker-locally'. | 541 | ;; initialized to nil and moved with `viper-move-marker-locally'. |
| 544 | (viper-deflocalvar viper-insert-point nil) | 542 | (defvar-local viper-insert-point nil) |
| 545 | (put 'viper-insert-point 'permanent-local t) | 543 | (put 'viper-insert-point 'permanent-local t) |
| 546 | 544 | ||
| 547 | ;; This remembers the point before dabbrev-expand was called. | 545 | ;; This remembers the point before dabbrev-expand was called. |
| @@ -562,7 +560,7 @@ to a new place after repeating previous Vi command." | |||
| 562 | ;; problem. However, the same trick can be used if such a command is | 560 | ;; problem. However, the same trick can be used if such a command is |
| 563 | ;; discovered later. | 561 | ;; discovered later. |
| 564 | ;; | 562 | ;; |
| 565 | (viper-deflocalvar viper-pre-command-point nil) | 563 | (defvar-local viper-pre-command-point nil) |
| 566 | (put 'viper-pre-command-point 'permanent-local t) ; this is probably an overkill | 564 | (put 'viper-pre-command-point 'permanent-local t) ; this is probably an overkill |
| 567 | 565 | ||
| 568 | ;; This is used for saving inserted text. | 566 | ;; This is used for saving inserted text. |
| @@ -573,7 +571,7 @@ to a new place after repeating previous Vi command." | |||
| 573 | 571 | ||
| 574 | ;; Remember com point as a marker. | 572 | ;; Remember com point as a marker. |
| 575 | ;; This is a local marker. Should be moved with `viper-move-marker-locally' | 573 | ;; This is a local marker. Should be moved with `viper-move-marker-locally' |
| 576 | (viper-deflocalvar viper-com-point nil) | 574 | (defvar-local viper-com-point nil) |
| 577 | 575 | ||
| 578 | ;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys) | 576 | ;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys) |
| 579 | ;; It is used to re-execute last destructive command. | 577 | ;; It is used to re-execute last destructive command. |
| @@ -660,14 +658,14 @@ negative number." | |||
| 660 | :type 'boolean | 658 | :type 'boolean |
| 661 | :group 'viper) | 659 | :group 'viper) |
| 662 | 660 | ||
| 663 | (viper-deflocalvar viper-ex-style-motion t "") | 661 | (defvar-local viper-ex-style-motion t "") |
| 664 | (defcustom viper-ex-style-motion t | 662 | (defcustom viper-ex-style-motion t |
| 665 | "If t, the commands l,h do not cross lines, etc (Ex-style). | 663 | "If t, the commands l,h do not cross lines, etc (Ex-style). |
| 666 | If nil, these commands cross line boundaries." | 664 | If nil, these commands cross line boundaries." |
| 667 | :type 'boolean | 665 | :type 'boolean |
| 668 | :group 'viper) | 666 | :group 'viper) |
| 669 | 667 | ||
| 670 | (viper-deflocalvar viper-ex-style-editing t "") | 668 | (defvar-local viper-ex-style-editing t "") |
| 671 | (defcustom viper-ex-style-editing t | 669 | (defcustom viper-ex-style-editing t |
| 672 | "If t, Ex-style behavior while editing in Vi command and insert states. | 670 | "If t, Ex-style behavior while editing in Vi command and insert states. |
| 673 | `Backspace' and `Delete' don't cross line boundaries in insert. | 671 | `Backspace' and `Delete' don't cross line boundaries in insert. |
| @@ -679,14 +677,14 @@ If nil, the above commands can work across lines." | |||
| 679 | :type 'boolean | 677 | :type 'boolean |
| 680 | :group 'viper) | 678 | :group 'viper) |
| 681 | 679 | ||
| 682 | (viper-deflocalvar viper-ESC-moves-cursor-back viper-ex-style-editing "") | 680 | (defvar-local viper-ESC-moves-cursor-back viper-ex-style-editing "") |
| 683 | (defcustom viper-ESC-moves-cursor-back nil | 681 | (defcustom viper-ESC-moves-cursor-back nil |
| 684 | "If t, ESC moves cursor back when changing from insert to vi state. | 682 | "If t, ESC moves cursor back when changing from insert to vi state. |
| 685 | If nil, the cursor stays where it was when ESC was hit." | 683 | If nil, the cursor stays where it was when ESC was hit." |
| 686 | :type 'boolean | 684 | :type 'boolean |
| 687 | :group 'viper) | 685 | :group 'viper) |
| 688 | 686 | ||
| 689 | (viper-deflocalvar viper-delete-backwards-in-replace nil "") | 687 | (defvar-local viper-delete-backwards-in-replace nil "") |
| 690 | (defcustom viper-delete-backwards-in-replace nil | 688 | (defcustom viper-delete-backwards-in-replace nil |
| 691 | "If t, DEL key will delete characters while moving the cursor backwards. | 689 | "If t, DEL key will delete characters while moving the cursor backwards. |
| 692 | If nil, the cursor will move backwards without deleting anything." | 690 | If nil, the cursor will move backwards without deleting anything." |
| @@ -704,7 +702,7 @@ If nil, the cursor will move backwards without deleting anything." | |||
| 704 | :tag "Search Wraps Around" | 702 | :tag "Search Wraps Around" |
| 705 | :group 'viper-search) | 703 | :group 'viper-search) |
| 706 | 704 | ||
| 707 | (viper-deflocalvar viper-related-files-and-buffers-ring nil "") | 705 | (defvar-local viper-related-files-and-buffers-ring nil "") |
| 708 | (defcustom viper-related-files-and-buffers-ring nil | 706 | (defcustom viper-related-files-and-buffers-ring nil |
| 709 | "List of file and buffer names to consider related to the current buffer. | 707 | "List of file and buffer names to consider related to the current buffer. |
| 710 | Related buffers can be cycled through via :R and :P commands." | 708 | Related buffers can be cycled through via :R and :P commands." |
| @@ -713,12 +711,12 @@ Related buffers can be cycled through via :R and :P commands." | |||
| 713 | (put 'viper-related-files-and-buffers-ring 'permanent-local t) | 711 | (put 'viper-related-files-and-buffers-ring 'permanent-local t) |
| 714 | 712 | ||
| 715 | ;; Used to find out if we are done with searching the current buffer. | 713 | ;; Used to find out if we are done with searching the current buffer. |
| 716 | (viper-deflocalvar viper-local-search-start-marker nil) | 714 | (defvar-local viper-local-search-start-marker nil) |
| 717 | ;; As above, but global | 715 | ;; As above, but global |
| 718 | (defvar viper-search-start-marker (make-marker)) | 716 | (defvar viper-search-start-marker (make-marker)) |
| 719 | 717 | ||
| 720 | ;; the search overlay | 718 | ;; the search overlay |
| 721 | (viper-deflocalvar viper-search-overlay nil) | 719 | (defvar-local viper-search-overlay nil) |
| 722 | 720 | ||
| 723 | 721 | ||
| 724 | (defvar viper-heading-start | 722 | (defvar viper-heading-start |
| @@ -745,9 +743,9 @@ Related buffers can be cycled through via :R and :P commands." | |||
| 745 | ;; inside the lines. | 743 | ;; inside the lines. |
| 746 | 744 | ||
| 747 | ;; Remembers position of the last jump done using ``'. | 745 | ;; Remembers position of the last jump done using ``'. |
| 748 | (viper-deflocalvar viper-last-jump nil) | 746 | (defvar-local viper-last-jump nil) |
| 749 | ;; Remembers position of the last jump done using `''. | 747 | ;; Remembers position of the last jump done using `''. |
| 750 | (viper-deflocalvar viper-last-jump-ignore 0) | 748 | (defvar-local viper-last-jump-ignore 0) |
| 751 | 749 | ||
| 752 | ;; History variables | 750 | ;; History variables |
| 753 | 751 | ||
| @@ -841,7 +839,7 @@ to customize the actual face object `viper-minibuffer-vi' | |||
| 841 | this variable represents.") | 839 | this variable represents.") |
| 842 | 840 | ||
| 843 | ;; the current face to be used in the minibuffer | 841 | ;; the current face to be used in the minibuffer |
| 844 | (viper-deflocalvar | 842 | (defvar-local |
| 845 | viper-minibuffer-current-face viper-minibuffer-emacs-face "") | 843 | viper-minibuffer-current-face viper-minibuffer-emacs-face "") |
| 846 | 844 | ||
| 847 | 845 | ||
| @@ -877,7 +875,7 @@ Should be set in `viper-custom-file-name'." | |||
| 877 | :group 'viper) | 875 | :group 'viper) |
| 878 | 876 | ||
| 879 | ;; overlay used in the minibuffer to indicate which state it is in | 877 | ;; overlay used in the minibuffer to indicate which state it is in |
| 880 | (viper-deflocalvar viper-minibuffer-overlay nil) | 878 | (defvar-local viper-minibuffer-overlay nil) |
| 881 | (put 'viper-minibuffer-overlay 'permanent-local t) | 879 | (put 'viper-minibuffer-overlay 'permanent-local t) |
| 882 | 880 | ||
| 883 | ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer. | 881 | ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer. |
| @@ -946,9 +944,4 @@ on a dumb terminal." | |||
| 946 | 944 | ||
| 947 | (provide 'viper-init) | 945 | (provide 'viper-init) |
| 948 | 946 | ||
| 949 | |||
| 950 | ;; Local Variables: | ||
| 951 | ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | ||
| 952 | ;; End: | ||
| 953 | |||
| 954 | ;;; viper-init.el ends here | 947 | ;;; viper-init.el ends here |
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 7209dc664b5..1d80c9cd026 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el | |||
| @@ -82,7 +82,7 @@ major mode in effect." | |||
| 82 | (defvar viper-insert-intercept-map (make-sparse-keymap)) | 82 | (defvar viper-insert-intercept-map (make-sparse-keymap)) |
| 83 | (defvar viper-emacs-intercept-map (make-sparse-keymap)) | 83 | (defvar viper-emacs-intercept-map (make-sparse-keymap)) |
| 84 | 84 | ||
| 85 | (viper-deflocalvar viper-vi-local-user-map (make-sparse-keymap) | 85 | (defvar-local viper-vi-local-user-map (make-sparse-keymap) |
| 86 | "Keymap for user-defined local bindings. | 86 | "Keymap for user-defined local bindings. |
| 87 | Useful for changing bindings such as ZZ in certain major modes. | 87 | Useful for changing bindings such as ZZ in certain major modes. |
| 88 | For instance, in letter-mode, one may want to bind ZZ to | 88 | For instance, in letter-mode, one may want to bind ZZ to |
| @@ -106,7 +106,7 @@ This map is global, shared by all buffers.") | |||
| 106 | This happens when viper-expert-level is 1 or 2. See viper-set-expert-level.") | 106 | This happens when viper-expert-level is 1 or 2. See viper-set-expert-level.") |
| 107 | 107 | ||
| 108 | 108 | ||
| 109 | (viper-deflocalvar viper-insert-local-user-map (make-sparse-keymap) | 109 | (defvar-local viper-insert-local-user-map (make-sparse-keymap) |
| 110 | "Auxiliary map for per-buffer user-defined keybindings in Insert state.") | 110 | "Auxiliary map for per-buffer user-defined keybindings in Insert state.") |
| 111 | (put 'viper-insert-local-user-map 'permanent-local t) | 111 | (put 'viper-insert-local-user-map 'permanent-local t) |
| 112 | 112 | ||
| @@ -133,7 +133,7 @@ viper-insert-basic-map. Not recommended, except for novice users.") | |||
| 133 | (defvar viper-emacs-kbd-map (make-sparse-keymap) | 133 | (defvar viper-emacs-kbd-map (make-sparse-keymap) |
| 134 | "This keymap keeps Vi-style kbd macros for Emacs mode.") | 134 | "This keymap keeps Vi-style kbd macros for Emacs mode.") |
| 135 | 135 | ||
| 136 | (viper-deflocalvar viper-emacs-local-user-map (make-sparse-keymap) | 136 | (defvar-local viper-emacs-local-user-map (make-sparse-keymap) |
| 137 | "Auxiliary map for local user-defined bindings in Emacs state.") | 137 | "Auxiliary map for local user-defined bindings in Emacs state.") |
| 138 | (put 'viper-emacs-local-user-map 'permanent-local t) | 138 | (put 'viper-emacs-local-user-map 'permanent-local t) |
| 139 | 139 | ||
| @@ -209,22 +209,22 @@ In insert mode, this key also functions as Meta." | |||
| 209 | (defvar viper-emacs-state-modifier-alist nil) | 209 | (defvar viper-emacs-state-modifier-alist nil) |
| 210 | 210 | ||
| 211 | ;; The list of viper keymaps. Set by viper-normalize-minor-mode-map-alist | 211 | ;; The list of viper keymaps. Set by viper-normalize-minor-mode-map-alist |
| 212 | (viper-deflocalvar viper--key-maps nil) | 212 | (defvar-local viper--key-maps nil) |
| 213 | (viper-deflocalvar viper--intercept-key-maps nil) | 213 | (defvar-local viper--intercept-key-maps nil) |
| 214 | 214 | ||
| 215 | ;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new | 215 | ;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new |
| 216 | ;; buffers. Not a user option. | 216 | ;; buffers. Not a user option. |
| 217 | (viper-deflocalvar viper-need-new-vi-local-map t "") | 217 | (defvar-local viper-need-new-vi-local-map t "") |
| 218 | (put 'viper-need-new-vi-local-map 'permanent-local t) | 218 | (put 'viper-need-new-vi-local-map 'permanent-local t) |
| 219 | 219 | ||
| 220 | ;; Tells viper-add-local-keys to create a new viper-insert-local-user-map for | 220 | ;; Tells viper-add-local-keys to create a new viper-insert-local-user-map for |
| 221 | ;; new buffers. Not a user option. | 221 | ;; new buffers. Not a user option. |
| 222 | (viper-deflocalvar viper-need-new-insert-local-map t "") | 222 | (defvar-local viper-need-new-insert-local-map t "") |
| 223 | (put 'viper-need-new-insert-local-map 'permanent-local t) | 223 | (put 'viper-need-new-insert-local-map 'permanent-local t) |
| 224 | 224 | ||
| 225 | ;; Tells viper-add-local-keys to create a new viper-emacs-local-user-map for | 225 | ;; Tells viper-add-local-keys to create a new viper-emacs-local-user-map for |
| 226 | ;; new buffers. Not a user option. | 226 | ;; new buffers. Not a user option. |
| 227 | (viper-deflocalvar viper-need-new-emacs-local-map t "") | 227 | (defvar-local viper-need-new-emacs-local-map t "") |
| 228 | (put 'viper-need-new-emacs-local-map 'permanent-local t) | 228 | (put 'viper-need-new-emacs-local-map 'permanent-local t) |
| 229 | 229 | ||
| 230 | 230 | ||
| @@ -654,10 +654,4 @@ form ((key . function) (key . function) ... )." | |||
| 654 | 654 | ||
| 655 | (provide 'viper-keym) | 655 | (provide 'viper-keym) |
| 656 | 656 | ||
| 657 | |||
| 658 | ;; Local Variables: | ||
| 659 | ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | ||
| 660 | ;; End: | ||
| 661 | |||
| 662 | |||
| 663 | ;;; viper-keym.el ends here | 657 | ;;; viper-keym.el ends here |
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index eec83dd05b5..71e40ee023e 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el | |||
| @@ -74,10 +74,10 @@ considered related." | |||
| 74 | :group 'viper-mouse) | 74 | :group 'viper-mouse) |
| 75 | 75 | ||
| 76 | ;; Local variable used to toggle wraparound search on click. | 76 | ;; Local variable used to toggle wraparound search on click. |
| 77 | (viper-deflocalvar viper-mouse-click-search-noerror t) | 77 | (defvar-local viper-mouse-click-search-noerror t) |
| 78 | 78 | ||
| 79 | ;; Local variable used to delimit search after wraparound. | 79 | ;; Local variable used to delimit search after wraparound. |
| 80 | (viper-deflocalvar viper-mouse-click-search-limit nil) | 80 | (defvar-local viper-mouse-click-search-limit nil) |
| 81 | 81 | ||
| 82 | ;; remembers prefix argument to pass along to commands invoked by second | 82 | ;; remembers prefix argument to pass along to commands invoked by second |
| 83 | ;; click. | 83 | ;; click. |
| @@ -592,11 +592,4 @@ This buffer may be different from the one where the click occurred." | |||
| 592 | :set 'viper-reset-mouse-insert-key | 592 | :set 'viper-reset-mouse-insert-key |
| 593 | :group 'viper-mouse) | 593 | :group 'viper-mouse) |
| 594 | 594 | ||
| 595 | |||
| 596 | |||
| 597 | ;; Local Variables: | ||
| 598 | ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | ||
| 599 | ;; End: | ||
| 600 | |||
| 601 | |||
| 602 | ;;; viper-mous.el ends here | 595 | ;;; viper-mous.el ends here |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 07a234bab9b..1bdb155538a 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -1085,10 +1085,10 @@ the `Local variables' section of a file." | |||
| 1085 | ;; These are characters that are not to be considered as parts of a word in | 1085 | ;; These are characters that are not to be considered as parts of a word in |
| 1086 | ;; Viper. | 1086 | ;; Viper. |
| 1087 | ;; Set each time state changes and at loading time | 1087 | ;; Set each time state changes and at loading time |
| 1088 | (viper-deflocalvar viper-non-word-characters nil) | 1088 | (defvar-local viper-non-word-characters nil) |
| 1089 | 1089 | ||
| 1090 | ;; must be buffer-local | 1090 | ;; must be buffer-local |
| 1091 | (viper-deflocalvar viper-ALPHA-char-class "w" | 1091 | (defvar-local viper-ALPHA-char-class "w" |
| 1092 | "String of syntax classes characterizing Viper's alphanumeric symbols. | 1092 | "String of syntax classes characterizing Viper's alphanumeric symbols. |
| 1093 | In addition, the symbol `_' may be considered alphanumeric if | 1093 | In addition, the symbol `_' may be considered alphanumeric if |
| 1094 | `viper-syntax-preference' is `strict-vi' or `reformed-vi'.") | 1094 | `viper-syntax-preference' is `strict-vi' or `reformed-vi'.") |
| @@ -1375,10 +1375,4 @@ This option is appropriate if you like Emacs-style words." | |||
| 1375 | (setq i (1+ i) start (1+ start))) | 1375 | (setq i (1+ i) start (1+ start))) |
| 1376 | res)))))) | 1376 | res)))))) |
| 1377 | 1377 | ||
| 1378 | |||
| 1379 | |||
| 1380 | ;; Local Variables: | ||
| 1381 | ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | ||
| 1382 | ;; End: | ||
| 1383 | |||
| 1384 | ;;; viper-util.el ends here | 1378 | ;;; viper-util.el ends here |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 6c9428060fc..df5a083a08a 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -1256,9 +1256,4 @@ These two lines must come in the order given.")) | |||
| 1256 | 1256 | ||
| 1257 | (provide 'viper) | 1257 | (provide 'viper) |
| 1258 | 1258 | ||
| 1259 | |||
| 1260 | ;; Local Variables: | ||
| 1261 | ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | ||
| 1262 | ;; End: | ||
| 1263 | |||
| 1264 | ;;; viper.el ends here | 1259 | ;;; viper.el ends here |