16
|
1 ;;; viper-init.el --- some common definitions for Viper
|
|
2
|
|
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
|
|
4
|
|
5 ;; This file is part of GNU Emacs.
|
|
6
|
|
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
8 ;; it under the terms of the GNU General Public License as published by
|
|
9 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
10 ;; any later version.
|
|
11
|
|
12 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 ;; GNU General Public License for more details.
|
|
16
|
|
17 ;; You should have received a copy of the GNU General Public License
|
|
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 ;; Boston, MA 02111-1307, USA.
|
|
21
|
|
22 ;; Code
|
|
23
|
|
24 (provide 'viper-init)
|
|
25
|
|
26 ;; compiler pacifier
|
|
27 (defvar mark-even-if-inactive)
|
163
|
28 (defvar viper-version)
|
175
|
29 (defvar viper-expert-level)
|
16
|
30 ;; end pacifier
|
|
31
|
163
|
32
|
|
33 ;; Viper version
|
|
34 (defun viper-version ()
|
|
35 (interactive)
|
|
36 (message "Viper version is %s" viper-version))
|
|
37
|
16
|
38 ;; Is it XEmacs?
|
181
|
39 (defconst viper-xemacs-p (string-match "XEmacs" emacs-version))
|
16
|
40 ;; Is it Emacs?
|
181
|
41 (defconst viper-emacs-p (not viper-xemacs-p))
|
16
|
42 ;; Tell whether we are running as a window application or on a TTY
|
181
|
43 (defsubst viper-device-type ()
|
|
44 (if viper-emacs-p
|
16
|
45 window-system
|
|
46 (device-type (selected-device))))
|
|
47 ;; in XEmacs: device-type is tty on tty and stream in batch.
|
181
|
48 (defun viper-window-display-p ()
|
|
49 (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
|
16
|
50
|
181
|
51 (defcustom viper-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
|
175
|
52 "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95."
|
|
53 :type 'boolean
|
|
54 :tag "Is it Microsoft-made OS?"
|
|
55 :group 'viper)
|
181
|
56 (defcustom viper-vms-os-p (memq system-type '(vax-vms axp-vms))
|
175
|
57 "Tells if Emacs is running under VMS."
|
|
58 :type 'boolean
|
|
59 :tag "Is it VMS?"
|
|
60 :group 'viper)
|
16
|
61
|
181
|
62 (defcustom viper-force-faces nil
|
16
|
63 "If t, Viper will think that it is running on a display that supports faces.
|
175
|
64 This is provided as a temporary relief for users of graphics-capable terminals
|
|
65 that Viper doesn't know about.
|
|
66 In all likelihood, you don't need to bother with this setting."
|
|
67 :type 'boolean
|
|
68 :group 'viper)
|
16
|
69
|
181
|
70 (defun viper-has-face-support-p ()
|
|
71 (cond ((viper-window-display-p))
|
|
72 (viper-force-faces)
|
|
73 (viper-emacs-p (memq (viper-device-type) '(pc)))
|
|
74 (viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
|
16
|
75
|
|
76
|
|
77 ;;; Macros
|
|
78
|
181
|
79 (defmacro viper-deflocalvar (var default-value &optional documentation)
|
16
|
80 (` (progn
|
|
81 (defvar (, var) (, default-value)
|
|
82 (, (format "%s\n\(buffer local\)" documentation)))
|
|
83 (make-variable-buffer-local '(, var))
|
|
84 )))
|
|
85
|
181
|
86 (defmacro viper-loop (count body)
|
|
87 "(viper-loop COUNT BODY) Execute BODY COUNT times."
|
16
|
88 (list 'let (list (list 'count count))
|
|
89 (list 'while '(> count 0)
|
|
90 body
|
|
91 '(setq count (1- count))
|
|
92 )))
|
|
93
|
181
|
94 (defmacro viper-buffer-live-p (buf)
|
16
|
95 (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
|
|
96
|
|
97 ;; return buffer-specific macro definition, given a full macro definition
|
181
|
98 (defmacro viper-kbd-buf-alist (macro-elt)
|
16
|
99 (` (nth 1 (, macro-elt))))
|
|
100 ;; get a pair: (curr-buffer . macro-definition)
|
181
|
101 (defmacro viper-kbd-buf-pair (macro-elt)
|
|
102 (` (assoc (buffer-name) (viper-kbd-buf-alist (, macro-elt)))))
|
16
|
103 ;; get macro definition for current buffer
|
181
|
104 (defmacro viper-kbd-buf-definition (macro-elt)
|
|
105 (` (cdr (viper-kbd-buf-pair (, macro-elt)))))
|
16
|
106
|
|
107 ;; return mode-specific macro definitions, given a full macro definition
|
181
|
108 (defmacro viper-kbd-mode-alist (macro-elt)
|
16
|
109 (` (nth 2 (, macro-elt))))
|
|
110 ;; get a pair: (major-mode . macro-definition)
|
181
|
111 (defmacro viper-kbd-mode-pair (macro-elt)
|
|
112 (` (assoc major-mode (viper-kbd-mode-alist (, macro-elt)))))
|
16
|
113 ;; get macro definition for the current major mode
|
181
|
114 (defmacro viper-kbd-mode-definition (macro-elt)
|
|
115 (` (cdr (viper-kbd-mode-pair (, macro-elt)))))
|
16
|
116
|
|
117 ;; return global macro definition, given a full macro definition
|
181
|
118 (defmacro viper-kbd-global-pair (macro-elt)
|
16
|
119 (` (nth 3 (, macro-elt))))
|
|
120 ;; get global macro definition from an elt of macro-alist
|
181
|
121 (defmacro viper-kbd-global-definition (macro-elt)
|
|
122 (` (cdr (viper-kbd-global-pair (, macro-elt)))))
|
16
|
123
|
|
124 ;; last elt of a sequence
|
181
|
125 (defsubst viper-seq-last-elt (seq)
|
16
|
126 (elt seq (1- (length seq))))
|
|
127
|
|
128
|
181
|
129 (defvar viper-minibuffer-overlay-priority 300)
|
|
130 (defvar viper-replace-overlay-priority 400)
|
|
131 (defvar viper-search-overlay-priority 500)
|
16
|
132
|
|
133
|
|
134 ;;; Viper minor modes
|
|
135
|
|
136 ;; Mode for vital things like \e, C-z.
|
181
|
137 (viper-deflocalvar viper-vi-intercept-minor-mode nil)
|
16
|
138
|
181
|
139 (viper-deflocalvar viper-vi-basic-minor-mode nil
|
16
|
140 "Viper's minor mode for Vi bindings.")
|
|
141
|
181
|
142 (viper-deflocalvar viper-vi-local-user-minor-mode nil
|
16
|
143 "Auxiliary minor mode for user-defined local bindings in Vi state.")
|
|
144
|
181
|
145 (viper-deflocalvar viper-vi-global-user-minor-mode nil
|
16
|
146 "Auxiliary minor mode for user-defined global bindings in Vi state.")
|
|
147
|
181
|
148 (viper-deflocalvar viper-vi-state-modifier-minor-mode nil
|
16
|
149 "Minor mode used to make major-mode-specific modification to Vi state.")
|
|
150
|
181
|
151 (viper-deflocalvar viper-vi-diehard-minor-mode nil
|
16
|
152 "This minor mode is in effect when the user wants Viper to be Vi.")
|
|
153
|
181
|
154 (viper-deflocalvar viper-vi-kbd-minor-mode nil
|
16
|
155 "Minor mode for Ex command macros in Vi state.
|
|
156 The corresponding keymap stores key bindings of Vi macros defined with
|
|
157 the Ex command :map.")
|
|
158
|
|
159 ;; Mode for vital things like \e, C-z.
|
181
|
160 (viper-deflocalvar viper-insert-intercept-minor-mode nil)
|
16
|
161
|
181
|
162 (viper-deflocalvar viper-insert-basic-minor-mode nil
|
16
|
163 "Viper's minor mode for bindings in Insert mode.")
|
|
164
|
181
|
165 (viper-deflocalvar viper-insert-local-user-minor-mode nil
|
16
|
166 "Auxiliary minor mode for buffer-local user-defined bindings in Insert state.
|
|
167 This is a way to overshadow normal Insert mode bindings locally to certain
|
|
168 designated buffers.")
|
|
169
|
181
|
170 (viper-deflocalvar viper-insert-global-user-minor-mode nil
|
16
|
171 "Auxiliary minor mode for global user-defined bindings in Insert state.")
|
|
172
|
181
|
173 (viper-deflocalvar viper-insert-state-modifier-minor-mode nil
|
16
|
174 "Minor mode used to make major-mode-specific modification to Insert state.")
|
|
175
|
181
|
176 (viper-deflocalvar viper-insert-diehard-minor-mode nil
|
16
|
177 "Minor mode that simulates Vi very closely.
|
|
178 Not recommened, except for the novice user.")
|
|
179
|
181
|
180 (viper-deflocalvar viper-insert-kbd-minor-mode nil
|
16
|
181 "Minor mode for Ex command macros Insert state.
|
|
182 The corresponding keymap stores key bindings of Vi macros defined with
|
|
183 the Ex command :map!.")
|
|
184
|
181
|
185 (viper-deflocalvar viper-replace-minor-mode nil
|
16
|
186 "Minor mode in effect in replace state (cw, C, and the like commands).")
|
|
187
|
|
188 ;; Mode for vital things like \C-z and \C-x)
|
|
189 ;; This is t, by default. So, any new buffer will have C-z defined as
|
|
190 ;; switch to Vi, unless we switched states in this buffer
|
181
|
191 (viper-deflocalvar viper-emacs-intercept-minor-mode t)
|
16
|
192
|
181
|
193 (viper-deflocalvar viper-emacs-local-user-minor-mode t
|
16
|
194 "Minor mode for local user bindings effective in Emacs state.
|
|
195 Users can use it to override Emacs bindings when Viper is in its Emacs
|
|
196 state.")
|
|
197
|
181
|
198 (viper-deflocalvar viper-emacs-global-user-minor-mode t
|
16
|
199 "Minor mode for global user bindings in effect in Emacs state.
|
|
200 Users can use it to override Emacs bindings when Viper is in its Emacs
|
|
201 state.")
|
|
202
|
181
|
203 (viper-deflocalvar viper-emacs-kbd-minor-mode t
|
16
|
204 "Minor mode for Vi style macros in Emacs state.
|
|
205 The corresponding keymap stores key bindings of Vi macros defined with
|
181
|
206 `viper-record-kbd-macro' command. There is no Ex-level command to do this
|
16
|
207 interactively.")
|
|
208
|
181
|
209 (viper-deflocalvar viper-emacs-state-modifier-minor-mode t
|
16
|
210 "Minor mode used to make major-mode-specific modification to Emacs state.
|
|
211 For instance, a Vi purist may want to bind `dd' in Dired mode to a function
|
|
212 that deletes a file.")
|
|
213
|
181
|
214 (viper-deflocalvar viper-vi-minibuffer-minor-mode nil
|
16
|
215 "Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
|
|
216
|
181
|
217 (viper-deflocalvar viper-insert-minibuffer-minor-mode nil
|
16
|
218 "Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
|
|
219
|
|
220
|
|
221
|
|
222 ;; Some common error messages
|
|
223
|
181
|
224 (defconst viper-SpuriousText "Spurious text after command" "")
|
|
225 (defconst viper-BadExCommand "Not an editor command" "")
|
|
226 (defconst viper-InvalidCommandArgument "Invalid command argument" "")
|
|
227 (defconst viper-NoPrevSearch "No previous search string" "")
|
|
228 (defconst viper-EmptyRegister "`%c': Nothing in this register" "")
|
|
229 (defconst viper-InvalidRegister "`%c': Invalid register" "")
|
|
230 (defconst viper-EmptyTextmarker "`%c': Text marker doesn't point anywhere" "")
|
|
231 (defconst viper-InvalidTextmarker "`%c': Invalid text marker" "")
|
|
232 (defconst viper-InvalidViCommand "Invalid command" "")
|
|
233 (defconst viper-BadAddress "Ill-formed address" "")
|
|
234 (defconst viper-FirstAddrExceedsSecond "First address exceeds second" "")
|
|
235 (defconst viper-NoFileSpecified "No file specified" "")
|
16
|
236
|
|
237 ;; Is t until viper-mode executes for the very first time.
|
|
238 ;; Prevents recursive descend into startup messages.
|
181
|
239 (defvar viper-first-time t)
|
16
|
240
|
181
|
241 (defvar viper-expert-level (if (boundp 'viper-expert-level) viper-expert-level 0)
|
16
|
242 "User's expert level.
|
181
|
243 The minor mode viper-vi-diehard-minor-mode is in effect when
|
|
244 viper-expert-level is 1 or 2 or when viper-want-emacs-keys-in-vi is t.
|
|
245 The minor mode viper-insert-diehard-minor-mode is in effect when
|
|
246 viper-expert-level is 1 or 2 or if viper-want-emacs-keys-in-insert is t.
|
175
|
247 Use `M-x viper-set-expert-level' to change this.")
|
16
|
248
|
|
249 ;; Max expert level supported by Viper. This is NOT a user option.
|
|
250 ;; It is here to make it hard for the user from resetting it.
|
175
|
251 (defconst viper-max-expert-level 5)
|
16
|
252
|
|
253
|
|
254 ;;; ISO characters
|
|
255
|
181
|
256 (viper-deflocalvar viper-automatic-iso-accents nil "")
|
|
257 (defcustom viper-automatic-iso-accents nil
|
16
|
258 "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state.
|
|
259 For some users, this behavior may be too primitive. In this case, use
|
175
|
260 insert/emacs/vi state hooks."
|
|
261 :type 'boolean
|
|
262 :group 'viper)
|
16
|
263
|
|
264
|
|
265 ;; VI-style Undo
|
|
266
|
|
267 ;; Used to 'undo' complex commands, such as replace and insert commands.
|
181
|
268 (viper-deflocalvar viper-undo-needs-adjustment nil)
|
|
269 (put 'viper-undo-needs-adjustment 'permanent-local t)
|
16
|
270
|
|
271 ;; A mark that Viper puts on buffer-undo-list. Marks the beginning of a
|
|
272 ;; complex command that must be undone atomically. If inserted, it is
|
181
|
273 ;; erased by viper-change-state-to-vi and viper-repeat.
|
|
274 (defconst viper-buffer-undo-list-mark 'viper)
|
16
|
275
|
181
|
276 (defcustom viper-keep-point-on-undo nil
|
16
|
277 "*Non-nil means not to move point while undoing commands.
|
|
278 This style is different from Emacs and Vi. Try it to see if
|
175
|
279 it better fits your working style."
|
|
280 :type 'boolean
|
|
281 :tag "Preserve Position of Point After Undo"
|
|
282 :group 'viper)
|
16
|
283
|
|
284 ;; Replace mode and changing text
|
|
285
|
181
|
286 ;; Viper's own after/before change functions, which get viper-add-hook'ed to
|
16
|
287 ;; Emacs's
|
181
|
288 (viper-deflocalvar viper-after-change-functions nil "")
|
|
289 (viper-deflocalvar viper-before-change-functions nil "")
|
|
290 (viper-deflocalvar viper-post-command-hooks nil "")
|
|
291 (viper-deflocalvar viper-pre-command-hooks nil "")
|
16
|
292
|
|
293 ;; Can be used to pass global states around for short period of time
|
181
|
294 (viper-deflocalvar viper-intermediate-command nil "")
|
|
295
|
|
296 ;; This is used to pass the right Vi command key sequence to
|
|
297 ;; viper-set-destructive-command whenever (this-command-keys) doesn't give the
|
|
298 ;; right result. For instance, in commands like c/bla<RET>, (this-command-keys)
|
|
299 ;; will return ^M, which invoked exit-minibuffer, while we need "c/"
|
|
300 (defconst viper-this-command-keys nil)
|
16
|
301
|
|
302 ;; Indicates that the current destructive command has started in replace mode.
|
181
|
303 (viper-deflocalvar viper-began-as-replace nil "")
|
16
|
304
|
181
|
305 (defcustom viper-allow-multiline-replace-regions t
|
16
|
306 "If non-nil, Viper will allow multi-line replace regions.
|
|
307 This is an extension to standard Vi.
|
|
308 If nil, commands that attempt to replace text spanning multiple lines first
|
175
|
309 delete the text being replaced, as in standard Vi."
|
|
310 :type 'boolean
|
|
311 :group 'viper)
|
16
|
312
|
181
|
313 (defcustom viper-replace-overlay-cursor-color "Red"
|
175
|
314 "*Cursor color when Viper is in Replace state."
|
|
315 :type 'string
|
|
316 :group 'viper)
|
181
|
317 (defcustom viper-insert-state-cursor-color "Green"
|
175
|
318 "Cursor color when Viper is in insert state."
|
|
319 :type 'string
|
|
320 :group 'viper)
|
|
321
|
16
|
322 ;; place to save cursor colow when switching to insert mode
|
181
|
323 (viper-deflocalvar viper-saved-cursor-color nil "")
|
16
|
324
|
181
|
325 (viper-deflocalvar viper-replace-overlay nil "")
|
|
326 (put 'viper-replace-overlay 'permanent-local t)
|
16
|
327
|
181
|
328 (defcustom viper-replace-region-end-delimiter "$"
|
16
|
329 "A string marking the end of replacement regions.
|
181
|
330 It is used only with TTYs or if `viper-use-replace-region-delimiters'
|
175
|
331 is non-nil."
|
|
332 :type 'string
|
|
333 :group 'viper)
|
181
|
334 (defcustom viper-replace-region-start-delimiter ""
|
16
|
335 "A string marking the beginning of replacement regions.
|
181
|
336 It is used only with TTYs or if `viper-use-replace-region-delimiters'
|
175
|
337 is non-nil."
|
|
338 :type 'string
|
|
339 :group 'viper)
|
181
|
340 (defcustom viper-use-replace-region-delimiters (not (viper-has-face-support-p))
|
|
341 "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
|
|
342 `viper-replace-region-start-delimiter' to delimit replacement regions, even on
|
175
|
343 color displays. By default, the delimiters are used only on TTYs."
|
|
344 :type 'boolean
|
|
345 :group 'viper)
|
16
|
346
|
|
347 ;; XEmacs requires glyphs
|
181
|
348 (if viper-xemacs-p
|
16
|
349 (progn
|
181
|
350 (or (glyphp viper-replace-region-end-delimiter)
|
|
351 (setq viper-replace-region-end-delimiter
|
|
352 (make-glyph viper-replace-region-end-delimiter)))
|
|
353 (or (glyphp viper-replace-region-start-delimiter)
|
|
354 (setq viper-replace-region-start-delimiter
|
|
355 (make-glyph viper-replace-region-start-delimiter)))
|
16
|
356 ))
|
|
357
|
|
358
|
|
359 ;; These are local marker that must be initialized to nil and moved with
|
181
|
360 ;; `viper-move-marker-locally'
|
16
|
361 ;;
|
|
362 ;; Remember the last position inside the replace region.
|
181
|
363 (viper-deflocalvar viper-last-posn-in-replace-region nil)
|
16
|
364 ;; Remember the last position while inserting
|
181
|
365 (viper-deflocalvar viper-last-posn-while-in-insert-state nil)
|
|
366 (put 'viper-last-posn-in-replace-region 'permanent-local t)
|
|
367 (put 'viper-last-posn-while-in-insert-state 'permanent-local t)
|
16
|
368
|
181
|
369 (viper-deflocalvar viper-sitting-in-replace nil "")
|
|
370 (put 'viper-sitting-in-replace 'permanent-local t)
|
16
|
371
|
|
372 ;; Remember the number of characters that have to be deleted in replace
|
|
373 ;; mode to compensate for the inserted characters.
|
181
|
374 (viper-deflocalvar viper-replace-chars-to-delete 0 "")
|
|
375 (viper-deflocalvar viper-replace-chars-deleted 0 "")
|
16
|
376
|
|
377 ;; Insertion ring and command ring
|
181
|
378 (defcustom viper-insertion-ring-size 14
|
175
|
379 "The size of history of inserted text.
|
|
380 This is a list where Viper keeps the history of previously inserted pieces of
|
|
381 text."
|
|
382 :type 'integer
|
|
383 :group 'viper)
|
16
|
384 ;; The insertion ring.
|
181
|
385 (defvar viper-insertion-ring nil)
|
16
|
386 ;; This is temp insertion ring. Used to do rotation for display purposes.
|
181
|
387 ;; When rotation just started, it is initialized to viper-insertion-ring.
|
|
388 (defvar viper-temp-insertion-ring nil)
|
|
389 (defvar viper-last-inserted-string-from-insertion-ring "")
|
16
|
390
|
181
|
391 (defcustom viper-command-ring-size 14
|
175
|
392 "The size of history of Vi commands repeatable with dot."
|
|
393 :type 'integer
|
|
394 :group 'viper)
|
16
|
395 ;; The command ring.
|
181
|
396 (defvar viper-command-ring nil)
|
16
|
397 ;; This is temp command ring. Used to do rotation for display purposes.
|
181
|
398 ;; When rotation just started, it is initialized to viper-command-ring.
|
|
399 (defvar viper-temp-command-ring nil)
|
16
|
400
|
175
|
401 ;; Fast keyseq and ESC keyseq timeouts
|
181
|
402 (defcustom viper-fast-keyseq-timeout 200
|
175
|
403 "*Key sequence separated by no more than this many milliseconds is viewed as a Vi-style macro, if such a macro is defined.
|
|
404 Setting this too high may slow down your typing. Setting this value too low
|
|
405 will make it hard to use Vi-stile timeout macros."
|
|
406 :type 'integer
|
|
407 :group 'viper)
|
|
408
|
181
|
409 (defcustom viper-ESC-keyseq-timeout (if (viper-window-display-p)
|
|
410 0 viper-fast-keyseq-timeout)
|
175
|
411 "*Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.
|
|
412 Setting this too high may slow down switching from insert to vi state. Setting
|
|
413 this value too low will make it impossible to use function keys in insert mode
|
|
414 on a dumb terminal."
|
|
415 :type 'integer
|
|
416 :group 'viper)
|
|
417
|
16
|
418 ;; Modes and related variables
|
|
419
|
|
420 ;; Current mode. One of: `emacs-state', `vi-state', `insert-state'
|
181
|
421 (viper-deflocalvar viper-current-state 'emacs-state)
|
16
|
422
|
|
423
|
|
424 ;; Autoindent in insert
|
|
425
|
|
426 ;; Variable that keeps track of whether C-t has been pressed.
|
181
|
427 (viper-deflocalvar viper-cted nil "")
|
16
|
428
|
|
429 ;; Preserve the indent value, used by C-d in insert mode.
|
181
|
430 (viper-deflocalvar viper-current-indent 0)
|
16
|
431
|
|
432 ;; Whether to preserve the indent, used by C-d in insert mode.
|
181
|
433 (viper-deflocalvar viper-preserve-indent nil)
|
16
|
434
|
181
|
435 (viper-deflocalvar viper-auto-indent nil "")
|
|
436 (defcustom viper-auto-indent nil
|
175
|
437 "*Enable autoindent, if t.
|
|
438 This is a buffer-local variable."
|
|
439 :type 'boolean
|
|
440 :group 'viper)
|
16
|
441
|
181
|
442 (viper-deflocalvar viper-electric-mode t "")
|
|
443 (defcustom viper-electric-mode t
|
175
|
444 "*If t, electrify Viper.
|
|
445 Currently, this only electrifies auto-indentation, making it appropriate to the
|
|
446 mode of the buffer.
|
|
447 This means that auto-indentation will depart from standard Vi and will indent
|
|
448 appropriate to the mode of the buffer. This is especially useful for editing
|
|
449 programs and LaTeX documents."
|
|
450 :type 'boolean
|
|
451 :group 'viper)
|
|
452
|
181
|
453 (defcustom viper-shift-width 8
|
175
|
454 "*The shiftwidth variable."
|
|
455 :type 'integer
|
|
456 :group 'viper)
|
16
|
457
|
|
458 ;; Variables for repeating destructive commands
|
|
459
|
181
|
460 (defcustom viper-keep-point-on-repeat t
|
16
|
461 "*If t, don't move point when repeating previous command.
|
|
462 This is useful for doing repeated changes with the '.' key.
|
|
463 The user can change this to nil, if she likes when the cursor moves
|
175
|
464 to a new place after repeating previous Vi command."
|
|
465 :type 'boolean
|
|
466 :group 'viper)
|
16
|
467
|
|
468 ;; Remember insert point as a marker. This is a local marker that must be
|
181
|
469 ;; initialized to nil and moved with `viper-move-marker-locally'.
|
|
470 (viper-deflocalvar viper-insert-point nil)
|
|
471 (put 'viper-insert-point 'permanent-local t)
|
16
|
472
|
|
473 ;; This remembers the point before dabbrev-expand was called.
|
181
|
474 ;; If viper-insert-point turns out to be bigger than that, it is reset
|
|
475 ;; back to viper-pre-command-point.
|
16
|
476 ;; The reason this is needed is because dabbrev-expand (and possibly
|
|
477 ;; others) may jump to before the insertion point, delete something and
|
|
478 ;; then reinsert a bigger piece. For instance: bla^blo
|
181
|
479 ;; If dabbrev-expand is called after `blo' and ^ undicates viper-insert-point,
|
16
|
480 ;; then point jumps to the beginning of `blo'. If expansion is found, `blablo'
|
|
481 ;; is deleted, and we have |^, where | denotes point. Next, dabbrev-expand
|
|
482 ;; will insert the expansion, and we get: blablo^
|
|
483 ;; Whatever we insert next goes before the ^, i.e., before the
|
181
|
484 ;; viper-insert-point marker. So, Viper will think that nothing was
|
16
|
485 ;; inserted. Remembering the orig position of the marker circumvents the
|
|
486 ;; problem.
|
|
487 ;; We don't know of any command, except dabbrev-expand, that has the same
|
|
488 ;; problem. However, the same trick can be used if such a command is
|
|
489 ;; discovered later.
|
|
490 ;;
|
181
|
491 (viper-deflocalvar viper-pre-command-point nil)
|
|
492 (put 'viper-pre-command-point 'permanent-local t) ; this is probably an overkill
|
16
|
493
|
|
494 ;; This is used for saving inserted text.
|
181
|
495 (defvar viper-last-insertion nil)
|
16
|
496
|
|
497 ;; Remembers the last replaced region.
|
181
|
498 (defvar viper-last-replace-region "")
|
16
|
499
|
|
500 ;; Remember com point as a marker.
|
181
|
501 ;; This is a local marker. Should be moved with `viper-move-marker-locally'
|
|
502 (viper-deflocalvar viper-com-point nil)
|
16
|
503
|
|
504 ;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys)
|
|
505 ;; It is used to re-execute last destructive command.
|
|
506 ;; M-COM is a Lisp symbol representing the function to be executed.
|
|
507 ;; VAL is the prefix argument that was used with that command.
|
|
508 ;; COM is an internal descriptor, such as ?r, ?c, ?C, which contains
|
|
509 ;; additional information on how the function in M-COM is to be handled.
|
|
510 ;; REG is the register used by command
|
|
511 ;; INSERTED-TEXT is text inserted by that command (in case of o, c, C, i, r
|
|
512 ;; commands).
|
|
513 ;; COMMAND-KEYS are the keys that were typed to invoke the command.
|
181
|
514 (defvar viper-d-com nil)
|
16
|
515
|
|
516 ;; The character remembered by the Vi `r' command.
|
181
|
517 (defvar viper-d-char nil)
|
16
|
518
|
|
519 ;; Name of register to store deleted or yanked strings
|
181
|
520 (defvar viper-use-register nil)
|
16
|
521
|
|
522
|
|
523
|
|
524 ;; Variables for Moves and Searches
|
|
525
|
|
526 ;; For use by `;' command.
|
181
|
527 (defvar viper-f-char nil)
|
16
|
528
|
|
529 ;; For use by `.' command.
|
181
|
530 (defvar viper-F-char nil)
|
16
|
531
|
|
532 ;; For use by `;' command.
|
181
|
533 (defvar viper-f-forward nil)
|
16
|
534
|
|
535 ;; For use by `;' command.
|
181
|
536 (defvar viper-f-offset nil)
|
16
|
537
|
|
538 ;; Last search string
|
181
|
539 (defvar viper-s-string "")
|
16
|
540
|
181
|
541 (defcustom viper-quote-string "> "
|
175
|
542 "String inserted at the beginning of quoted region."
|
|
543 :type 'string
|
|
544 :group 'viper)
|
16
|
545
|
|
546 ;; If t, search is forward.
|
181
|
547 (defvar viper-s-forward nil)
|
16
|
548
|
181
|
549 (defcustom viper-case-fold-search nil
|
175
|
550 "*If not nil, search ignores cases."
|
|
551 :type 'boolean
|
|
552 :group 'viper)
|
16
|
553
|
181
|
554 (defcustom viper-re-search t
|
175
|
555 "*If not nil, search is regexp search, otherwise vanilla search."
|
|
556 :type 'boolean
|
|
557 :tag "Regexp Search"
|
|
558 :group 'viper)
|
16
|
559
|
181
|
560 (defcustom viper-search-scroll-threshold 2
|
16
|
561 "*If search lands within this threshnold from the window top/bottom,
|
|
562 the window will be scrolled up or down appropriately, to reveal context.
|
|
563 If you want Viper search to behave as usual in Vi, set this variable to a
|
175
|
564 negative number."
|
|
565 :type 'boolean
|
|
566 :group 'viper)
|
16
|
567
|
181
|
568 (defcustom viper-re-query-replace t
|
175
|
569 "*If t then do regexp replace, if nil then do string replace."
|
|
570 :type 'boolean
|
|
571 :tag "Regexp Query Replace"
|
|
572 :group 'viper)
|
16
|
573
|
181
|
574 (defcustom viper-re-replace t
|
175
|
575 "*If t, do regexp replace. nil means do string replace."
|
|
576 :type 'boolean
|
|
577 :tag "Regexp Replace"
|
|
578 :group 'viper)
|
16
|
579
|
181
|
580 (defcustom viper-parse-sexp-ignore-comments t
|
175
|
581 "*If t, `%' ignores the parentheses that occur inside comments."
|
|
582 :type 'boolean
|
|
583 :group 'viper)
|
155
|
584
|
181
|
585 (viper-deflocalvar viper-ex-style-motion t "")
|
|
586 (defcustom viper-ex-style-motion t
|
175
|
587 "*If t, the commands l,h do not cross lines, etc (Ex-style).
|
|
588 If nil, these commands cross line boundaries."
|
|
589 :type 'boolean
|
|
590 :group 'viper)
|
16
|
591
|
181
|
592 (viper-deflocalvar viper-ex-style-editing-in-insert t "")
|
|
593 (defcustom viper-ex-style-editing-in-insert t
|
175
|
594 "*If t, `Backspace' and `Delete' don't cross line boundaries in insert, etc.
|
|
595 Note: this doesn't preclude `Backspace' and `Delete' from deleting characters
|
|
596 by moving past the insertion point. This is a feature, not a bug."
|
|
597 :type 'boolean
|
|
598 :group 'viper)
|
16
|
599
|
181
|
600 (viper-deflocalvar viper-ESC-moves-cursor-back viper-ex-style-editing-in-insert "")
|
|
601 (defcustom viper-ESC-moves-cursor-back nil
|
175
|
602 "*If t, ESC moves cursor back when changing from insert to vi state.
|
|
603 If nil, the cursor stays where it was."
|
|
604 :type 'boolean
|
|
605 :group 'viper)
|
16
|
606
|
181
|
607 (viper-deflocalvar viper-delete-backwards-in-replace nil "")
|
|
608 (defcustom viper-delete-backwards-in-replace nil
|
175
|
609 "*If t, DEL key will delete characters while moving the cursor backwards.
|
|
610 If nil, the cursor will move backwards without deleting anything."
|
|
611 :type 'boolean
|
|
612 :group 'viper)
|
|
613
|
181
|
614 (defcustom viper-buffer-search-char nil
|
175
|
615 "*Key used for buffer-searching. Must be a character type, e.g., ?g."
|
|
616 :type '(choice (const nil) character)
|
|
617 :group 'viper)
|
16
|
618
|
181
|
619 (defcustom viper-search-wrap-around-t t
|
175
|
620 "*If t, search wraps around."
|
|
621 :type 'boolean
|
|
622 :tag "Search Wraps Around"
|
|
623 :group 'viper)
|
16
|
624
|
181
|
625 (viper-deflocalvar viper-related-files-and-buffers-ring nil "")
|
|
626 (defcustom viper-related-files-and-buffers-ring nil
|
175
|
627 "*List of file and buffer names that are considered to be related to the current buffer.
|
|
628 Related buffers can be cycled through via :R and :P commands."
|
|
629 :type 'boolean
|
|
630 :group 'viper)
|
181
|
631 (put 'viper-related-files-and-buffers-ring 'permanent-local t)
|
16
|
632
|
|
633 ;; Used to find out if we are done with searching the current buffer.
|
181
|
634 (viper-deflocalvar viper-local-search-start-marker nil)
|
16
|
635 ;; As above, but global
|
181
|
636 (defvar viper-search-start-marker (make-marker))
|
16
|
637
|
|
638 ;; the search overlay
|
181
|
639 (viper-deflocalvar viper-search-overlay nil)
|
16
|
640
|
|
641
|
181
|
642 (defvar viper-heading-start
|
16
|
643 (concat "^\\s-*(\\s-*defun\\s-\\|" ; lisp
|
|
644 "^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|" ; C/C++
|
|
645 "^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
|
|
646 "^\\\\[sb][a-z]*{.*}\\s-*$\\|" ; latex
|
|
647 "^@node\\|@table\\|^@m?enu\\|^@itemize\\|^@if\\|" ; texinfo
|
|
648 "^.+:-") ; prolog
|
|
649 "*Regexps for Headings. Used by \[\[ and \]\].")
|
|
650
|
181
|
651 (defvar viper-heading-end
|
16
|
652 (concat "^}\\|" ; C/C++
|
|
653 "^\\\\end{\\|" ; latex
|
|
654 "^@end \\|" ; texinfo
|
|
655 ")\n\n[ \t\n]*\\|" ; lisp
|
|
656 "\\.\\s-*$") ; prolog
|
|
657 "*Regexps to end Headings/Sections. Used by \[\].")
|
|
658
|
|
659
|
|
660 ;; These two vars control the interaction of jumps performed by ' and `.
|
|
661 ;; In this new version, '' doesn't erase the marks set by ``, so one can
|
|
662 ;; use both kinds of jumps interchangeably and without loosing positions
|
|
663 ;; inside the lines.
|
|
664
|
|
665 ;; Remembers position of the last jump done using ``'.
|
181
|
666 (viper-deflocalvar viper-last-jump nil)
|
16
|
667 ;; Remembers position of the last jump done using `''.
|
181
|
668 (viper-deflocalvar viper-last-jump-ignore 0)
|
16
|
669
|
|
670 ;; History variables
|
|
671
|
|
672 ;; History of search strings.
|
181
|
673 (defvar viper-search-history (list ""))
|
16
|
674 ;; History of query-replace strings used as a source.
|
181
|
675 (defvar viper-replace1-history nil)
|
16
|
676 ;; History of query-replace strings used as replacement.
|
181
|
677 (defvar viper-replace2-history nil)
|
16
|
678 ;; History of region quoting strings.
|
181
|
679 (defvar viper-quote-region-history (list viper-quote-string))
|
16
|
680 ;; History of Ex-style commands.
|
181
|
681 (defvar viper-ex-history nil)
|
16
|
682 ;; History of shell commands.
|
181
|
683 (defvar viper-shell-history nil)
|
16
|
684
|
|
685
|
|
686 ;; Last shell command. There are two of these, one for Ex (in viper-ex)
|
|
687 ;; and one for Vi.
|
|
688
|
|
689 ;; Last shell command executed with ! command.
|
181
|
690 (defvar viper-last-shell-com nil)
|
|
691
|
|
692
|
|
693 ;;; Face-saving tricks
|
|
694
|
|
695 ;;(defcustom viper-replace-overlay-pixmap "gray3"
|
|
696 ;; "Pixmap to use for search face on non-color displays."
|
|
697 ;; :type 'string
|
|
698 ;; :group 'viper)
|
|
699 ;;(defcustom viper-search-face-pixmap "gray3"
|
|
700 ;; "Pixmap to use for search face on non-color displays."
|
|
701 ;; :type 'string
|
|
702 ;; :group 'viper)
|
|
703
|
|
704 (defun viper-hide-face (face)
|
|
705 (if (and (viper-has-face-support-p) viper-emacs-p)
|
|
706 (add-to-list 'facemenu-unlisted-faces face)))
|
|
707
|
|
708
|
|
709 (defgroup viper-highlighting nil
|
|
710 "Hilighting of replace region, search pattern, minibuffer, etc."
|
|
711 :prefix "viper-"
|
|
712 :group 'viper)
|
|
713
|
|
714 ;;(defvar viper-search-face
|
|
715 ;; (if (viper-has-face-support-p)
|
|
716 ;; (progn
|
|
717 ;; (make-face 'viper-search-face)
|
|
718 ;; (or (face-differs-from-default-p 'viper-search-face)
|
|
719 ;; ;; face wasn't set in .viper or .Xdefaults
|
|
720 ;; (if (viper-can-use-colors "Black" "khaki")
|
|
721 ;; (progn
|
|
722 ;; (set-face-background 'viper-search-face "khaki")
|
|
723 ;; (set-face-foreground 'viper-search-face "Black"))
|
|
724 ;; (set-face-underline-p 'viper-search-face t)
|
|
725 ;; (viper-set-face-pixmap 'viper-search-face
|
|
726 ;; viper-search-face-pixmap)))
|
|
727 ;; 'viper-search-face))
|
|
728 ;; "*Face used to flash out the search pattern.")
|
|
729
|
|
730 (defface viper-search-face
|
|
731 '((((class color)) (:foreground "Black" :background "khaki"))
|
|
732 (t (:underline t :stipple "gray3")))
|
|
733 "*Face used to flash out the search pattern."
|
|
734 :group 'viper-highlighting)
|
|
735 ;; An internal variable. Viper takes the face from here.
|
|
736 (defvar viper-search-face 'viper-search-face)
|
|
737 (viper-hide-face 'viper-search-face)
|
|
738
|
|
739 ;;(defvar viper-replace-overlay-face
|
|
740 ;; (if (viper-has-face-support-p)
|
|
741 ;; (progn
|
|
742 ;; (make-face 'viper-replace-overlay-face)
|
|
743 ;; (or (face-differs-from-default-p 'viper-replace-overlay-face)
|
|
744 ;; (progn
|
|
745 ;; (if (viper-can-use-colors "darkseagreen2" "Black")
|
|
746 ;; (progn
|
|
747 ;; (set-face-background
|
|
748 ;; 'viper-replace-overlay-face "darkseagreen2")
|
|
749 ;; (set-face-foreground 'viper-replace-overlay-face "Black")))
|
|
750 ;; (set-face-underline-p 'viper-replace-overlay-face t)
|
|
751 ;; (viper-set-face-pixmap
|
|
752 ;; 'viper-replace-overlay-face viper-replace-overlay-pixmap)))
|
|
753 ;; 'viper-replace-overlay-face))
|
|
754 ;; "*Face for highlighting replace regions on a window display.")
|
|
755
|
|
756 (defface viper-replace-overlay-face
|
|
757 '((((class color)) (:foreground "Black" :background "darkseagreen2"))
|
|
758 (t (:underline t :stipple "gray3")))
|
|
759 "*Face for highlighting replace regions on a window display."
|
|
760 :group 'viper-highlighting)
|
|
761 ;; An internal variable. Viper takes the face from here.
|
|
762 (defvar viper-replace-overlay-face 'viper-replace-overlay-face)
|
|
763 (viper-hide-face 'viper-replace-overlay-face)
|
16
|
764
|
181
|
765 ;;(defvar viper-minibuffer-emacs-face
|
|
766 ;; (if (viper-has-face-support-p)
|
|
767 ;; (progn
|
|
768 ;; (make-face 'viper-minibuffer-emacs-face)
|
|
769 ;; (or (face-differs-from-default-p 'viper-minibuffer-emacs-face)
|
|
770 ;; ;; face wasn't set in .viper or .Xdefaults
|
|
771 ;; (if viper-vi-style-in-minibuffer
|
|
772 ;; ;; emacs state is an exception in the minibuffer
|
|
773 ;; (if (viper-can-use-colors "darkseagreen2" "Black")
|
|
774 ;; (progn
|
|
775 ;; (set-face-background
|
|
776 ;; 'viper-minibuffer-emacs-face "darkseagreen2")
|
|
777 ;; (set-face-foreground
|
|
778 ;; 'viper-minibuffer-emacs-face "Black"))
|
|
779 ;; (copy-face 'modeline 'viper-minibuffer-emacs-face))
|
|
780 ;; ;; emacs state is the main state in the minibuffer
|
|
781 ;; (if (viper-can-use-colors "Black" "pink")
|
|
782 ;; (progn
|
|
783 ;; (set-face-background 'viper-minibuffer-emacs-face "pink")
|
|
784 ;; (set-face-foreground
|
|
785 ;; 'viper-minibuffer-emacs-face "Black"))
|
|
786 ;; (copy-face 'italic 'viper-minibuffer-emacs-face))
|
|
787 ;; ))
|
|
788 ;; 'viper-minibuffer-emacs-face))
|
|
789 ;; "Face used in the Minibuffer when it is in Emacs state.")
|
|
790
|
|
791 (defface viper-minibuffer-emacs-face
|
|
792 '((((class color)) (:foreground "Black" :background "darkseagreen2"))
|
|
793 (t (:bold t)))
|
|
794 "Face used in the Minibuffer when it is in Emacs state."
|
|
795 :group 'viper-highlighting)
|
|
796 ;; An internal variable. Viper takes the face from here.
|
|
797 (defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs-face)
|
|
798 (viper-hide-face 'viper-minibuffer-emacs-face)
|
|
799
|
|
800 ;;(defvar viper-minibuffer-insert-face
|
|
801 ;; (if (viper-has-face-support-p)
|
|
802 ;; (progn
|
|
803 ;; (make-face 'viper-minibuffer-insert-face)
|
|
804 ;; (or (face-differs-from-default-p 'viper-minibuffer-insert-face)
|
|
805 ;; (if viper-vi-style-in-minibuffer
|
|
806 ;; (if (viper-can-use-colors "Black" "pink")
|
|
807 ;; (progn
|
|
808 ;; (set-face-background 'viper-minibuffer-insert-face "pink")
|
|
809 ;; (set-face-foreground
|
|
810 ;; 'viper-minibuffer-insert-face "Black"))
|
|
811 ;; (copy-face 'italic 'viper-minibuffer-insert-face))
|
|
812 ;; ;; If Insert state is an exception
|
|
813 ;; (if (viper-can-use-colors "darkseagreen2" "Black")
|
|
814 ;; (progn
|
|
815 ;; (set-face-background
|
|
816 ;; 'viper-minibuffer-insert-face "darkseagreen2")
|
|
817 ;; (set-face-foreground
|
|
818 ;; 'viper-minibuffer-insert-face "Black"))
|
|
819 ;; (copy-face 'modeline 'viper-minibuffer-insert-face))
|
|
820 ;; (viper-italicize-face 'viper-minibuffer-insert-face)))
|
|
821 ;; 'viper-minibuffer-insert-face))
|
|
822 ;; "Face used in the Minibuffer when it is in Insert state.")
|
|
823
|
|
824 (defface viper-minibuffer-insert-face
|
|
825 '((((class color)) (:foreground "Black" :background "pink"))
|
|
826 (t (:italic t)))
|
|
827 "Face used in the Minibuffer when it is in Insert state."
|
|
828 :group 'viper-highlighting)
|
|
829 ;; An internal variable. Viper takes the face from here.
|
|
830 (defvar viper-minibuffer-insert-face 'viper-minibuffer-insert-face)
|
|
831 (viper-hide-face 'viper-minibuffer-insert-face)
|
|
832
|
|
833 ;;(defvar viper-minibuffer-vi-face
|
|
834 ;; (if (viper-has-face-support-p)
|
|
835 ;; (progn
|
|
836 ;; (make-face 'viper-minibuffer-vi-face)
|
|
837 ;; (or (face-differs-from-default-p 'viper-minibuffer-vi-face)
|
|
838 ;; (if viper-vi-style-in-minibuffer
|
|
839 ;; (if (viper-can-use-colors "Black" "grey")
|
|
840 ;; (progn
|
|
841 ;; (set-face-background 'viper-minibuffer-vi-face "grey")
|
|
842 ;; (set-face-foreground 'viper-minibuffer-vi-face "Black"))
|
|
843 ;; (copy-face 'bold 'viper-minibuffer-vi-face))
|
|
844 ;; (copy-face 'bold 'viper-minibuffer-vi-face)
|
|
845 ;; (invert-face 'viper-minibuffer-vi-face)))
|
|
846 ;; 'viper-minibuffer-vi-face))
|
|
847 ;; "Face used in the Minibuffer when it is in Vi state.")
|
|
848
|
|
849 (defface viper-minibuffer-vi-face
|
|
850 '((((class color)) (:foreground "DarkGreen" :background "grey"))
|
|
851 (t (:inverse-video t)))
|
|
852 "Face used in the Minibuffer when it is in Vi state."
|
|
853 :group 'viper-highlighting)
|
|
854 ;; An internal variable. Viper takes the face from here.
|
|
855 (defvar viper-minibuffer-vi-face 'viper-minibuffer-vi-face)
|
|
856 (viper-hide-face 'viper-minibuffer-vi-face)
|
|
857
|
|
858 ;; the current face to be used in the minibuffer
|
|
859 (viper-deflocalvar viper-minibuffer-current-face viper-minibuffer-emacs-face "")
|
16
|
860
|
|
861
|
|
862 ;;; Miscellaneous
|
|
863
|
181
|
864 (defvar viper-inhibit-startup-message nil
|
16
|
865 "Whether Viper startup message should be inhibited.")
|
|
866
|
181
|
867 (defcustom viper-spell-function 'ispell-region
|
175
|
868 "Spell function used by #s<move> command to spell."
|
|
869 :type 'function
|
|
870 :group 'viper)
|
16
|
871
|
181
|
872 (defcustom viper-tags-file-name "TAGS"
|
175
|
873 "The tags file used by Viper."
|
|
874 :type 'string
|
|
875 :group 'viper)
|
16
|
876
|
|
877 ;; Minibuffer
|
|
878
|
181
|
879 (defcustom viper-vi-style-in-minibuffer t
|
16
|
880 "If t, use vi-style editing in minibuffer.
|
181
|
881 Should be set in `~/.viper' file."
|
175
|
882 :type 'boolean
|
|
883 :group 'viper)
|
16
|
884
|
|
885 ;; overlay used in the minibuffer to indicate which state it is in
|
181
|
886 (viper-deflocalvar viper-minibuffer-overlay nil)
|
16
|
887
|
|
888 ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
|
|
889 ;; Beginning with Emacs 19.26, the standard `minibuffer-exit-hook' is run
|
|
890 ;; *after* exiting the minibuffer
|
181
|
891 (defvar viper-minibuffer-exit-hook nil)
|
16
|
892
|
|
893
|
|
894 ;; Mode line
|
181
|
895 (defconst viper-vi-state-id "<V> "
|
16
|
896 "Mode line tag identifying the Vi mode of Viper.")
|
181
|
897 (defconst viper-emacs-state-id "<E> "
|
16
|
898 "Mode line tag identifying the Emacs mode of Viper.")
|
181
|
899 (defconst viper-insert-state-id "<I> "
|
16
|
900 "Mode line tag identifying the Insert mode of Viper.")
|
181
|
901 (defconst viper-replace-state-id "<R> "
|
16
|
902 "Mode line tag identifying the Replace mode of Viper.")
|
|
903
|
|
904
|
181
|
905 (defcustom viper-vi-state-hook nil
|
175
|
906 "*Hooks run just before the switch to Vi mode is completed."
|
|
907 :type 'hook
|
|
908 :group 'viper)
|
181
|
909 (defcustom viper-insert-state-hook nil
|
175
|
910 "*Hooks run just before the switch to Insert mode is completed."
|
|
911 :type 'hook
|
|
912 :group 'viper)
|
181
|
913 (defcustom viper-replace-state-hook nil
|
175
|
914 "*Hooks run just before the switch to Replace mode is completed."
|
|
915 :type 'hook
|
|
916 :group 'viper)
|
181
|
917 (defcustom viper-emacs-state-hook nil
|
175
|
918 "*Hooks run just before the switch to Emacs mode is completed."
|
|
919 :type 'hook
|
|
920 :group 'viper)
|
16
|
921
|
181
|
922 (defcustom viper-load-hook nil
|
175
|
923 "Hooks run just after loading Viper."
|
|
924 :type 'hook
|
|
925 :group 'viper)
|
16
|
926
|
175
|
927
|
|
928 ;;; Local Variables:
|
181
|
929 ;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
|
175
|
930 ;;; End:
|
|
931
|
16
|
932 ;;; viper-ex.el ends here
|