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