1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000 |
- (defvar mark-even-if-inactive)
- (defvar quail-mode)
- (defvar iso-accents-mode)
- (defvar viper-current-state)
- (defvar viper-version)
- (defvar viper-expert-level)
- (defvar current-input-method)
- (defvar default-input-method)
- (defvar describe-current-input-method-function)
- (defvar bar-cursor)
- (defvar cursor-type)
- (defun viper-version ()
- (interactive)
- (message "Viper version is %s" viper-version))
- (defsubst viper-device-type ()
- (if (featurep 'xemacs)
- (device-type (selected-device))
- window-system))
- (defun viper-color-display-p ()
- (condition-case nil
- (if (featurep 'xemacs)
- (eq (device-class (selected-device)) 'color)
- (display-color-p))
- (error nil)))
- (defun viper-window-display-p ()
- (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
- (defcustom viper-ms-style-os-p
- (memq system-type (if (featurep 'emacs) '(ms-dos windows-nt)
- '(ms-dos windows-nt windows-95)))
- "Non-nil if Emacs is running under an MS-style OS: MS-DOS, or MS-Windows."
- :type 'boolean
- :tag "Is it Microsoft-made OS?"
- :group 'viper-misc)
- (defcustom viper-suppress-input-method-change-message nil
- "If t, the message notifying about changes in the input method is not displayed.
- Normally, a message is displayed each time on enters the vi, insert or replace
- state."
- :type 'boolean
- :group 'viper-misc)
- (defcustom viper-force-faces nil
- "If t, Viper will think that it is running on a display that supports faces.
- This is provided as a temporary relief for users of graphics-capable terminals
- that Viper doesn't know about.
- In all likelihood, you don't need to bother with this setting."
- :type 'boolean
- :group 'viper-highlighting)
- (defun viper-has-face-support-p ()
- (cond ((viper-window-display-p))
- (viper-force-faces)
- ((viper-color-display-p))
- ((featurep 'emacs) (memq (viper-device-type) '(pc)))
- ((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
- (defmacro viper-deflocalvar (var default-value &optional documentation)
- `(progn
- (defvar ,var ,default-value
- ,(format "%s\n\(buffer local\)" documentation))
- (make-variable-buffer-local ',var)))
- (defmacro viper-loop (count &rest body)
- `(let ((count ,count))
- (while (> count 0)
- ,@body
- (setq count (1- count)))))
- (defmacro viper-buffer-live-p (buf)
- `(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
- (defmacro viper-kbd-buf-alist (macro-elt)
- `(nth 1 ,macro-elt))
- (defmacro viper-kbd-buf-pair (macro-elt)
- `(assoc (buffer-name) (viper-kbd-buf-alist ,macro-elt)))
- (defmacro viper-kbd-buf-definition (macro-elt)
- `(cdr (viper-kbd-buf-pair ,macro-elt)))
- (defmacro viper-kbd-mode-alist (macro-elt)
- `(nth 2 ,macro-elt))
- (defmacro viper-kbd-mode-pair (macro-elt)
- `(assoc major-mode (viper-kbd-mode-alist ,macro-elt)))
- (defmacro viper-kbd-mode-definition (macro-elt)
- `(cdr (viper-kbd-mode-pair ,macro-elt)))
- (defmacro viper-kbd-global-pair (macro-elt)
- `(nth 3 ,macro-elt))
- (defmacro viper-kbd-global-definition (macro-elt)
- `(cdr (viper-kbd-global-pair ,macro-elt)))
- (defsubst viper-seq-last-elt (seq)
- (elt seq (1- (length seq))))
- (defsubst viper-string-to-list (string)
- (append (vconcat string) nil))
- (defsubst viper-charlist-to-string (list)
- (mapconcat 'char-to-string list ""))
- (defun viper-char-at-pos (direction &optional offset)
- (or (integerp offset) (setq offset 0))
- (if (eq direction 'forward)
- (char-after (+ (point) offset))
- (char-before (- (point) offset))))
- (defvar viper-minibuffer-overlay-priority 300)
- (defvar viper-replace-overlay-priority 400)
- (defvar viper-search-overlay-priority 500)
- (viper-deflocalvar viper-vi-intercept-minor-mode nil)
- (viper-deflocalvar viper-vi-basic-minor-mode nil
- "Viper's minor mode for Vi bindings.")
- (viper-deflocalvar viper-vi-local-user-minor-mode nil
- "Auxiliary minor mode for user-defined local bindings in Vi state.")
- (viper-deflocalvar viper-vi-global-user-minor-mode nil
- "Auxiliary minor mode for user-defined global bindings in Vi state.")
- (viper-deflocalvar viper-vi-state-modifier-minor-mode nil
- "Minor mode used to make major-mode-specific modification to Vi state.")
- (viper-deflocalvar viper-vi-diehard-minor-mode nil
- "This minor mode is in effect when the user wants Viper to be Vi.")
- (viper-deflocalvar viper-vi-kbd-minor-mode nil
- "Minor mode for Ex command macros in Vi state.
- The corresponding keymap stores key bindings of Vi macros defined with
- the Ex command :map.")
- (viper-deflocalvar viper-insert-intercept-minor-mode nil)
- (viper-deflocalvar viper-insert-basic-minor-mode nil
- "Viper's minor mode for bindings in Insert mode.")
- (viper-deflocalvar viper-insert-local-user-minor-mode nil
- "Auxiliary minor mode for buffer-local user-defined bindings in Insert state.
- This is a way to overshadow normal Insert mode bindings locally to certain
- designated buffers.")
- (viper-deflocalvar viper-insert-global-user-minor-mode nil
- "Auxiliary minor mode for global user-defined bindings in Insert state.")
- (viper-deflocalvar viper-insert-state-modifier-minor-mode nil
- "Minor mode used to make major-mode-specific modification to Insert state.")
- (viper-deflocalvar viper-insert-diehard-minor-mode nil
- "Minor mode that simulates Vi very closely.
- Not recommended, except for the novice user.")
- (viper-deflocalvar viper-insert-kbd-minor-mode nil
- "Minor mode for Ex command macros Insert state.
- The corresponding keymap stores key bindings of Vi macros defined with
- the Ex command :map!.")
- (viper-deflocalvar viper-replace-minor-mode nil
- "Minor mode in effect in replace state (cw, C, and the like commands).")
- (viper-deflocalvar viper-emacs-intercept-minor-mode nil)
- (viper-deflocalvar viper-emacs-local-user-minor-mode nil
- "Minor mode for local user bindings effective in Emacs state.
- Users can use it to override Emacs bindings when Viper is in its Emacs
- state.")
- (viper-deflocalvar viper-emacs-global-user-minor-mode nil
- "Minor mode for global user bindings in effect in Emacs state.
- Users can use it to override Emacs bindings when Viper is in its Emacs
- state.")
- (viper-deflocalvar viper-emacs-kbd-minor-mode nil
- "Minor mode for Vi style macros in Emacs state.
- The corresponding keymap stores key bindings of Vi macros defined with
- `viper-record-kbd-macro' command. There is no Ex-level command to do this
- interactively.")
- (viper-deflocalvar viper-emacs-state-modifier-minor-mode nil
- "Minor mode used to make major-mode-specific modification to Emacs state.
- For instance, a Vi purist may want to bind `dd' in Dired mode to a function
- that deletes a file.")
- (viper-deflocalvar viper-vi-minibuffer-minor-mode nil
- "Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
- (viper-deflocalvar viper-insert-minibuffer-minor-mode nil
- "Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
- (defconst viper-SpuriousText "Spurious text after command" "")
- (defconst viper-BadExCommand "Not an editor command" "")
- (defconst viper-InvalidCommandArgument "Invalid command argument" "")
- (defconst viper-NoPrevSearch "No previous search string" "")
- (defconst viper-EmptyRegister "`%c': Nothing in this register" "")
- (defconst viper-InvalidRegister "`%c': Invalid register" "")
- (defconst viper-EmptyTextmarker "`%c': Text marker doesn't point anywhere" "")
- (defconst viper-InvalidTextmarker "`%c': Invalid text marker" "")
- (defconst viper-InvalidViCommand "Invalid command" "")
- (defconst viper-BadAddress "Ill-formed address" "")
- (defconst viper-FirstAddrExceedsSecond "First address exceeds second" "")
- (defconst viper-NoFileSpecified "No file specified" "")
- (defvar viper-first-time t)
- (defvar viper-expert-level (if (boundp 'viper-expert-level) viper-expert-level 0)
- "User's expert level.
- The minor mode viper-vi-diehard-minor-mode is in effect when
- viper-expert-level is 1 or 2 or when viper-want-emacs-keys-in-vi is t.
- The minor mode viper-insert-diehard-minor-mode is in effect when
- viper-expert-level is 1 or 2 or if viper-want-emacs-keys-in-insert is t.
- Use `M-x viper-set-expert-level' to change this.")
- (defconst viper-max-expert-level 5)
- (viper-deflocalvar viper-automatic-iso-accents nil "")
- (defsubst viper-set-iso-accents-mode (arg)
- (if (boundp 'iso-accents-mode)
- (setq iso-accents-mode arg)))
- (defvar viper-mule-hook-flag t)
- (viper-deflocalvar viper-special-input-method nil "")
- (defun viper-activate-input-method-action ()
- (if (null viper-mule-hook-flag)
- ()
- (setq viper-special-input-method t)
-
- (if (eq viper-current-state 'vi-state)
- (viper-set-input-method nil))
- (if (and (memq viper-current-state '(vi-state insert-state replace-state))
- (not viper-suppress-input-method-change-message))
- (message "Viper special input method%s: on"
- (if (or current-input-method default-input-method)
- (format " %S"
- (or current-input-method default-input-method))
- "")))
- ))
- (defun viper-inactivate-input-method-action ()
- (if (null viper-mule-hook-flag)
- ()
- (setq viper-special-input-method nil)
- (if (and (memq viper-current-state '(vi-state insert-state replace-state))
- (not viper-suppress-input-method-change-message))
- (message "Viper special input method%s: off"
- (if (or current-input-method default-input-method)
- (format " %S"
- (or current-input-method default-input-method))
- "")))))
- (defun viper-inactivate-input-method ()
- (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method))
- (inactivate-input-method))
- ((and (featurep 'xemacs) (boundp 'current-input-method))
-
-
- (setq quail-mode nil)
- (if (featurep 'quail)
- (quail-delete-overlays))
- (setq describe-current-input-method-function nil)
- (setq current-input-method nil)
- (run-hooks 'input-method-inactivate-hook)
- (force-mode-line-update))
- ))
- (defun viper-activate-input-method ()
- (cond ((and (featurep 'emacs) (fboundp 'activate-input-method))
- (activate-input-method default-input-method))
- ((featurep 'xemacs)
- (if (fboundp 'quail-mode) (quail-mode 1)))))
- (defun viper-set-input-method (arg)
- (setq viper-mule-hook-flag t)
- (let (viper-mule-hook-flag)
- (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
-
- (viper-activate-input-method))
- (t
- (viper-inactivate-input-method)))
- ))
- (viper-deflocalvar viper-undo-needs-adjustment nil)
- (put 'viper-undo-needs-adjustment 'permanent-local t)
- (defconst viper-buffer-undo-list-mark 'viper)
- (defcustom viper-keep-point-on-undo nil
- "*Non-nil means not to move point while undoing commands.
- This style is different from Emacs and Vi. Try it to see if
- it better fits your working style."
- :type 'boolean
- :tag "Preserve Position of Point After Undo"
- :group 'viper)
- (viper-deflocalvar viper-intermediate-command nil "")
- (defconst viper-this-command-keys nil)
- (viper-deflocalvar viper-began-as-replace nil "")
- (defcustom viper-allow-multiline-replace-regions t
- "If non-nil, Viper will allow multi-line replace regions.
- This is an extension to standard Vi.
- If nil, commands that attempt to replace text spanning multiple lines first
- delete the text being replaced, as in standard Vi."
- :type 'boolean
- :group 'viper)
- (defcustom viper-replace-overlay-cursor-color "Red"
- "*Cursor color when Viper is in Replace state."
- :type 'string
- :group 'viper)
- (defcustom viper-insert-state-cursor-color "Green"
- "Cursor color when Viper is in insert state."
- :type 'string
- :group 'viper)
- (defcustom viper-emacs-state-cursor-color nil
- "Cursor color when Viper is in Emacs state."
- :type 'string
- :group 'viper)
- (defvar viper-vi-state-cursor-color nil)
- (when (and (featurep 'xemacs)
- (fboundp 'make-variable-frame-local))
- (make-variable-frame-local 'viper-replace-overlay-cursor-color)
- (make-variable-frame-local 'viper-insert-state-cursor-color)
- (make-variable-frame-local 'viper-emacs-state-cursor-color)
- (make-variable-frame-local 'viper-vi-state-cursor-color))
- (viper-deflocalvar viper-replace-overlay nil "")
- (put 'viper-replace-overlay 'permanent-local t)
- (defcustom viper-replace-region-end-delimiter "$"
- "A string marking the end of replacement regions.
- It is used only with TTYs or if `viper-use-replace-region-delimiters'
- is non-nil."
- :type 'string
- :group 'viper)
- (defcustom viper-replace-region-start-delimiter ""
- "A string marking the beginning of replacement regions.
- It is used only with TTYs or if `viper-use-replace-region-delimiters'
- is non-nil."
- :type 'string
- :group 'viper)
- (defcustom viper-use-replace-region-delimiters
- (or (not (viper-has-face-support-p))
- (and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
- "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
- `viper-replace-region-start-delimiter' to delimit replacement regions, even on
- color displays. By default, the delimiters are used only on TTYs."
- :type 'boolean
- :group 'viper)
- (defcustom viper-read-buffer-function 'read-buffer
- "Function to use for prompting the user for a buffer name."
- :type 'symbol
- :group 'viper)
- (when (featurep 'xemacs)
- (or (glyphp viper-replace-region-end-delimiter)
- (setq viper-replace-region-end-delimiter
- (make-glyph viper-replace-region-end-delimiter)))
- (or (glyphp viper-replace-region-start-delimiter)
- (setq viper-replace-region-start-delimiter
- (make-glyph viper-replace-region-start-delimiter))))
- (viper-deflocalvar viper-last-posn-in-replace-region nil)
- (viper-deflocalvar viper-last-posn-while-in-insert-state nil)
- (put 'viper-last-posn-in-replace-region 'permanent-local t)
- (put 'viper-last-posn-while-in-insert-state 'permanent-local t)
- (viper-deflocalvar viper-sitting-in-replace nil "")
- (put 'viper-sitting-in-replace 'permanent-local t)
- (viper-deflocalvar viper-replace-chars-to-delete 0 "")
- (viper-deflocalvar viper-replace-region-chars-deleted 0 "")
- (defcustom viper-insertion-ring-size 14
- "The size of history of inserted text.
- This is a list where Viper keeps the history of previously inserted pieces of
- text."
- :type 'integer
- :group 'viper-misc)
- (defvar viper-insertion-ring nil)
- (defvar viper-temp-insertion-ring nil)
- (defvar viper-last-inserted-string-from-insertion-ring "")
- (defcustom viper-command-ring-size 14
- "The size of history of Vi commands repeatable with dot."
- :type 'integer
- :group 'viper-misc)
- (defvar viper-command-ring nil)
- (defvar viper-temp-command-ring nil)
- (defcustom viper-fast-keyseq-timeout 200
- "*Key sequence separated by no more than this many milliseconds is viewed as a Vi-style macro, if such a macro is defined.
- Setting this too high may slow down your typing. Setting this value too low
- will make it hard to use Vi-style timeout macros."
- :type 'integer
- :group 'viper-misc)
- (defun viper-translate-all-ESC-keysequences ()
- (not (viper-window-display-p)))
- (viper-deflocalvar viper-current-state 'emacs-state)
- (viper-deflocalvar viper-cted nil "")
- (viper-deflocalvar viper-current-indent 0)
- (viper-deflocalvar viper-preserve-indent nil)
- (viper-deflocalvar viper-auto-indent nil "")
- (defcustom viper-auto-indent nil
- "*Enable autoindent, if t.
- This is a buffer-local variable."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-electric-mode t "")
- (defcustom viper-electric-mode t
- "*If t, electrify Viper.
- Currently, this only electrifies auto-indentation, making it appropriate to the
- mode of the buffer.
- This means that auto-indentation will depart from standard Vi and will indent
- appropriate to the mode of the buffer. This is especially useful for editing
- programs and LaTeX documents."
- :type 'boolean
- :group 'viper)
- (defcustom viper-shift-width 8
- "*The value of the shiftwidth.
- This determines the number of columns by which the Ctl-t moves the cursor in
- the Insert state."
- :type 'integer
- :group 'viper)
- (defcustom viper-keep-point-on-repeat t
- "*If t, don't move point when repeating previous command.
- This is useful for doing repeated changes with the '.' key.
- The user can change this to nil, if she likes when the cursor moves
- to a new place after repeating previous Vi command."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-insert-point nil)
- (put 'viper-insert-point 'permanent-local t)
- (viper-deflocalvar viper-pre-command-point nil)
- (put 'viper-pre-command-point 'permanent-local t)
- (defvar viper-last-insertion nil)
- (defvar viper-last-replace-region "")
- (viper-deflocalvar viper-com-point nil)
- (defvar viper-d-com nil)
- (defvar viper-d-char nil)
- (defvar viper-use-register nil)
- (defgroup viper-search nil
- "Variables that define the search and query-replace behavior of Viper."
- :prefix "viper-"
- :group 'viper)
- (defvar viper-f-char nil)
- (defvar viper-F-char nil)
- (defvar viper-f-forward nil)
- (defvar viper-f-offset nil)
- (defvar viper-s-string "")
- (defcustom viper-quote-string "> "
- "String inserted at the beginning of quoted region."
- :type 'string
- :group 'viper)
- (defvar viper-s-forward nil)
- (defcustom viper-case-fold-search nil
- "*If not nil, search ignores cases."
- :type 'boolean
- :group 'viper-search)
- (defcustom viper-re-search t
- "*If not nil, search is regexp search, otherwise vanilla search."
- :type 'boolean
- :tag "Regexp Search"
- :group 'viper-search)
- (defcustom viper-search-scroll-threshold 2
- "*If search lands within this threshold from the window top/bottom,
- the window will be scrolled up or down appropriately, to reveal context.
- If you want Viper search to behave as usual in Vi, set this variable to a
- negative number."
- :type 'boolean
- :group 'viper-search)
- (defcustom viper-re-query-replace t
- "*If t then do regexp replace, if nil then do string replace."
- :type 'boolean
- :tag "Regexp Query Replace"
- :group 'viper-search)
- (defcustom viper-re-replace t
- "*If t, do regexp replace. nil means do string replace."
- :type 'boolean
- :tag "Regexp Replace"
- :group 'viper-search)
- (defcustom viper-parse-sexp-ignore-comments t
- "*If t, `%' ignores the parentheses that occur inside comments."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-ex-style-motion t "")
- (defcustom viper-ex-style-motion t
- "*If t, the commands l,h do not cross lines, etc (Ex-style).
- If nil, these commands cross line boundaries."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-ex-style-editing t "")
- (defcustom viper-ex-style-editing t
- "*If t, Ex-style behavior while editing in Vi command and insert states.
- `Backspace' and `Delete' don't cross line boundaries in insert.
- `X' and `x' can't delete characters across line boundary in Vi, etc.
- Note: this doesn't preclude `Backspace' and `Delete' from deleting characters
- by moving past the insertion point. This is a feature, not a bug.
- If nil, the above commands can work across lines."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-ESC-moves-cursor-back viper-ex-style-editing "")
- (defcustom viper-ESC-moves-cursor-back nil
- "*If t, ESC moves cursor back when changing from insert to vi state.
- If nil, the cursor stays where it was when ESC was hit."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-delete-backwards-in-replace nil "")
- (defcustom viper-delete-backwards-in-replace nil
- "*If t, DEL key will delete characters while moving the cursor backwards.
- If nil, the cursor will move backwards without deleting anything."
- :type 'boolean
- :group 'viper)
- (defcustom viper-buffer-search-char nil
- "*Key used for buffer-searching. Must be a character type, e.g., ?g."
- :type '(choice (const nil) character)
- :group 'viper-search)
- (defcustom viper-search-wrap-around t
- "*If t, search wraps around."
- :type 'boolean
- :tag "Search Wraps Around"
- :group 'viper-search)
- (viper-deflocalvar viper-related-files-and-buffers-ring nil "")
- (defcustom viper-related-files-and-buffers-ring nil
- "*List of file and buffer names that are considered to be related to the current buffer.
- Related buffers can be cycled through via :R and :P commands."
- :type 'boolean
- :group 'viper-misc)
- (put 'viper-related-files-and-buffers-ring 'permanent-local t)
- (viper-deflocalvar viper-local-search-start-marker nil)
- (defvar viper-search-start-marker (make-marker))
- (viper-deflocalvar viper-search-overlay nil)
- (defvar viper-heading-start
- (concat "^\\s-*(\\s-*defun\\s-\\|"
- "^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|"
- "^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
- "^\\\\[sb][a-z]*{.*}\\s-*$\\|"
- "^@node\\|@table\\|^@m?enu\\|^@itemize\\|^@if\\|"
- "^.+:-")
- "*Regexps for Headings. Used by \[\[ and \]\].")
- (defvar viper-heading-end
- (concat "^}\\|"
- "^\\\\end{\\|"
- "^@end \\|"
- ")\n\n[ \t\n]*\\|"
- "\\.\\s-*$")
- "*Regexps to end Headings/Sections. Used by \[\].")
- (viper-deflocalvar viper-last-jump nil)
- (viper-deflocalvar viper-last-jump-ignore 0)
- (defvar viper-search-history (list ""))
- (defvar viper-replace1-history nil)
- (defvar viper-replace2-history nil)
- (defvar viper-quote-region-history (list viper-quote-string))
- (defvar viper-ex-history nil)
- (defvar viper-shell-history nil)
- (defvar viper-last-shell-com nil)
- (defgroup viper-highlighting nil
- "Highlighting of replace region, search pattern, minibuffer, etc."
- :prefix "viper-"
- :group 'viper)
- (defface viper-search
- '((((class color)) (:foreground "Black" :background "khaki"))
- (t (:underline t :stipple "gray3")))
- "*Face used to flash out the search pattern."
- :group 'viper-highlighting)
- (defvar viper-search-face 'viper-search
- "Face used to flash out the search pattern.
- DO NOT CHANGE this variable. Instead, use the customization widget
- to customize the actual face object `viper-search'
- this variable represents.")
- (defface viper-replace-overlay
- '((((class color)) (:foreground "Black" :background "darkseagreen2"))
- (t (:underline t :stipple "gray3")))
- "*Face for highlighting replace regions on a window display."
- :group 'viper-highlighting)
- (defvar viper-replace-overlay-face 'viper-replace-overlay
- "Face for highlighting replace regions on a window display.
- DO NOT CHANGE this variable. Instead, use the customization widget
- to customize the actual face object `viper-replace-overlay'
- this variable represents.")
- (defface viper-minibuffer-emacs
- '((((class color)) (:foreground "Black" :background "darkseagreen2"))
- (t (:weight bold)))
- "Face used in the Minibuffer when it is in Emacs state."
- :group 'viper-highlighting)
- (defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs
- "Face used in the Minibuffer when it is in Emacs state.
- DO NOT CHANGE this variable. Instead, use the customization widget
- to customize the actual face object `viper-minibuffer-emacs'
- this variable represents.")
- (defface viper-minibuffer-insert
- '((((class color)) (:foreground "Black" :background "pink"))
- (t (:slant italic)))
- "Face used in the Minibuffer when it is in Insert state."
- :group 'viper-highlighting)
- (defvar viper-minibuffer-insert-face 'viper-minibuffer-insert
- "Face used in the Minibuffer when it is in Insert state.
- DO NOT CHANGE this variable. Instead, use the customization widget
- to customize the actual face object `viper-minibuffer-insert'
- this variable represents.")
- (defface viper-minibuffer-vi
- '((((class color)) (:foreground "DarkGreen" :background "grey"))
- (t (:inverse-video t)))
- "Face used in the Minibuffer when it is in Vi state."
- :group 'viper-highlighting)
- (defvar viper-minibuffer-vi-face 'viper-minibuffer-vi
- "Face used in the Minibuffer when it is in Vi state.
- DO NOT CHANGE this variable. Instead, use the customization widget
- to customize the actual face object `viper-minibuffer-vi'
- this variable represents.")
- (viper-deflocalvar
- viper-minibuffer-current-face viper-minibuffer-emacs-face "")
- (defvar viper-inhibit-startup-message nil
- "Whether Viper startup message should be inhibited.")
- (defcustom viper-spell-function 'ispell-region
- "Spell function used by #s<move> command to spell."
- :type 'function
- :group 'viper-misc)
- (defcustom viper-tags-file-name "TAGS"
- "The tags file used by Viper."
- :type 'string
- :group 'viper-misc)
- (defcustom viper-change-notification-threshold 1
- "Notify the user when this many lines or characters have been deleted/yanked.
- For line-deleting/yanking commands (like `dd', `yy'), the value denotes the
- number of lines. For character-based commands (such as `x', `dw', etc.), the
- value refers to the number of characters affected."
- :type 'integer
- :group 'viper-misc)
- (defcustom viper-vi-style-in-minibuffer t
- "If t, use vi-style editing in minibuffer.
- Should be set in `~/.viper' file."
- :type 'boolean
- :group 'viper)
- (viper-deflocalvar viper-minibuffer-overlay nil)
- (put 'viper-minibuffer-overlay 'permanent-local t)
- (defvar viper-minibuffer-exit-hook nil)
- (defconst viper-vi-state-id "<V> "
- "Mode line tag identifying the Vi mode of Viper.")
- (defconst viper-emacs-state-id "<E> "
- "Mode line tag identifying the Emacs mode of Viper.")
- (defconst viper-insert-state-id "<I> "
- "Mode line tag identifying the Insert mode of Viper.")
- (defconst viper-replace-state-id "<R> "
- "Mode line tag identifying the Replace mode of Viper.")
- (defgroup viper-hooks nil
- "Viper hooks."
- :prefix "viper-"
- :group 'viper)
- (defcustom viper-vi-state-hook 'viper-restore-cursor-type
- "*Hooks run just before the switch to Vi mode is completed."
- :type 'hook
- :group 'viper-hooks)
- (defcustom viper-insert-state-hook 'viper-set-insert-cursor-type
- "*Hooks run just before the switch to Insert mode is completed."
- :type 'hook
- :group 'viper-hooks)
- (defcustom viper-replace-state-hook 'viper-restore-cursor-type
- "*Hooks run just before the switch to Replace mode is completed."
- :type 'hook
- :group 'viper-hooks)
- (defcustom viper-emacs-state-hook 'viper-restore-cursor-type
- "*Hooks run just before the switch to Emacs mode is completed."
- :type 'hook
- :group 'viper-hooks)
- (defcustom viper-load-hook nil
- "Hooks run just after loading Viper."
- :type 'hook
- :group 'viper-hooks)
- (defun viper-restore-cursor-type ()
- (condition-case nil
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) nil)
- (setq cursor-type (default-value 'cursor-type)))
- (error nil)))
- (defun viper-set-insert-cursor-type ()
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) 2)
- (setq cursor-type '(bar . 2))))
- (defun viper-ESC-keyseq-timeout ()
- "*Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.
- Setting this too high may slow down switching from insert to vi state. Setting
- this value too low will make it impossible to use function keys in insert mode
- on a dumb terminal."
- (if (viper-window-display-p)
- 0 viper-fast-keyseq-timeout))
- (provide 'viper-init)
|