1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00
emacs/lisp/emulation/viper-init.el

1000 lines
36 KiB
EmacsLisp
Raw Normal View History

1997-05-31 00:02:53 +00:00
;;; viper-init.el --- some common definitions for Viper
2005-08-01 15:47:19 +00:00
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2009-01-05 03:18:22 +00:00
;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1997-05-31 00:02:53 +00:00
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): new macro that replaces viper-emacs-p and viper-xemacs-p in many cases. Used to reduce the number of warnings. * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-standard-value): moved here from viper.el. (viper-set-unread-command-events): moved to viper-util.el (viper-check-minibuffer-overlay): make sure viper-minibuffer-overlay is moved to cover the entire input field. * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-read-key-sequence, viper-set-unread-command-events, viper-char-symbol-sequence-p, viper-char-array-p): moved here. * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, viper-event-vector-p): moved to viper-util.el * viper.el (viper-standard-value): moved to viper-cmd.el. Use viper-cond-compile-for-xemacs-or-emacs. * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new macro designed to be used in many places where ediff-emacs-p or ediff-xemacs-p was previously used. Reduces the number of warnings. Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue of ediff-xemacs-p. (ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer, ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents): moved to ediff-util.el. (ediff-event-key): moved here. * ediff-merge.el: got rid of unreferenced variables. * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. (ediff-cleanup-mess): improved the way windows are set up after quitting ediff. (ediff-janitor): use ediff-dispose-of-variant-according-to-user. (ediff-dispose-of-variant-according-to-user): new function designed to be smarter and also understands indirect buffers. (ediff-highlight-diff-in-one-buffer, ediff-unhighlight-diff-in-one-buffer, ediff-unhighlight-diffs-totally-in-one-buffer, ediff-highlight-diff, ediff-highlight-diff, ediff-unhighlight-diff, ediff-unhighlight-diffs-totally, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents, ediff-make-current-diff-overlay): moved here. (ediff-format-bindings-of): new function by Hannu Koivisto <azure@iki.fi>. (ediff-setup): make sure the merge buffer is always widened and modifiable. (ediff-write-merge-buffer-and-maybe-kill): refuse to write the result of a merge into a file visited by another buffer. (ediff-arrange-autosave-in-merge-jobs): check if the merge file is visited by another buffer and ask to save/delete that buffer. (ediff-verify-file-merge-buffer): new function to do the above. * ediff-vers.el: load ediff-init.el at compile time. * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff.el (ediff-windows, ediff-regions-wordwise, ediff-regions-linewise): use indirect buffers to improve robustness and make it possible to compare regions of the same buffer (even overlapping regions). (ediff-clone-buffer-for-region-comparison, ediff-clone-buffer-for-window-comparison): new functions. (ediff-files-internal): refuse to compare identical files. (ediff-regions-internal): get rid of the warning about comparing regions of the same buffer. * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. Plus the following fixes courtesy of Dave Love: Doc fixes. (ediff-word-1): Use word class and move - to the front per regexp documentation. (ediff-wordify): Bind forward-word-function outside loop. (ediff-copy-to-buffer): Use insert-buffer-substring rather than consing buffer contents. (ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
1997-05-31 00:02:53 +00:00
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
1997-05-31 00:02:53 +00:00
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
1997-05-31 00:02:53 +00:00
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
1997-05-31 00:02:53 +00:00
;;; Commentary:
;;; Code:
1997-05-31 00:02:53 +00:00
;; compiler pacifier
(defvar mark-even-if-inactive)
1997-08-22 03:15:57 +00:00
(defvar quail-mode)
(defvar iso-accents-mode)
(defvar viper-current-state)
1997-06-09 04:00:50 +00:00
(defvar viper-version)
1997-07-17 19:37:07 +00:00
(defvar viper-expert-level)
1998-05-04 22:42:59 +00:00
(defvar current-input-method)
(defvar default-input-method)
(defvar describe-current-input-method-function)
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): new macro that replaces viper-emacs-p and viper-xemacs-p in many cases. Used to reduce the number of warnings. * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-standard-value): moved here from viper.el. (viper-set-unread-command-events): moved to viper-util.el (viper-check-minibuffer-overlay): make sure viper-minibuffer-overlay is moved to cover the entire input field. * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-read-key-sequence, viper-set-unread-command-events, viper-char-symbol-sequence-p, viper-char-array-p): moved here. * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, viper-event-vector-p): moved to viper-util.el * viper.el (viper-standard-value): moved to viper-cmd.el. Use viper-cond-compile-for-xemacs-or-emacs. * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new macro designed to be used in many places where ediff-emacs-p or ediff-xemacs-p was previously used. Reduces the number of warnings. Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue of ediff-xemacs-p. (ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer, ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents): moved to ediff-util.el. (ediff-event-key): moved here. * ediff-merge.el: got rid of unreferenced variables. * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. (ediff-cleanup-mess): improved the way windows are set up after quitting ediff. (ediff-janitor): use ediff-dispose-of-variant-according-to-user. (ediff-dispose-of-variant-according-to-user): new function designed to be smarter and also understands indirect buffers. (ediff-highlight-diff-in-one-buffer, ediff-unhighlight-diff-in-one-buffer, ediff-unhighlight-diffs-totally-in-one-buffer, ediff-highlight-diff, ediff-highlight-diff, ediff-unhighlight-diff, ediff-unhighlight-diffs-totally, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents, ediff-make-current-diff-overlay): moved here. (ediff-format-bindings-of): new function by Hannu Koivisto <azure@iki.fi>. (ediff-setup): make sure the merge buffer is always widened and modifiable. (ediff-write-merge-buffer-and-maybe-kill): refuse to write the result of a merge into a file visited by another buffer. (ediff-arrange-autosave-in-merge-jobs): check if the merge file is visited by another buffer and ask to save/delete that buffer. (ediff-verify-file-merge-buffer): new function to do the above. * ediff-vers.el: load ediff-init.el at compile time. * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff.el (ediff-windows, ediff-regions-wordwise, ediff-regions-linewise): use indirect buffers to improve robustness and make it possible to compare regions of the same buffer (even overlapping regions). (ediff-clone-buffer-for-region-comparison, ediff-clone-buffer-for-window-comparison): new functions. (ediff-files-internal): refuse to compare identical files. (ediff-regions-internal): get rid of the warning about comparing regions of the same buffer. * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. Plus the following fixes courtesy of Dave Love: Doc fixes. (ediff-word-1): Use word class and move - to the front per regexp documentation. (ediff-wordify): Bind forward-word-function outside loop. (ediff-copy-to-buffer): Use insert-buffer-substring rather than consing buffer contents. (ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
(defvar bar-cursor)
(defvar cursor-type)
1997-05-31 00:02:53 +00:00
;; end pacifier
1997-06-09 04:00:50 +00:00
;; Viper version
(defun viper-version ()
(interactive)
(message "Viper version is %s" viper-version))
1997-06-09 04:00:50 +00:00
1997-05-31 00:02:53 +00:00
;; Tell whether we are running as a window application or on a TTY
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): new macro that replaces viper-emacs-p and viper-xemacs-p in many cases. Used to reduce the number of warnings. * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-standard-value): moved here from viper.el. (viper-set-unread-command-events): moved to viper-util.el (viper-check-minibuffer-overlay): make sure viper-minibuffer-overlay is moved to cover the entire input field. * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-read-key-sequence, viper-set-unread-command-events, viper-char-symbol-sequence-p, viper-char-array-p): moved here. * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, viper-event-vector-p): moved to viper-util.el * viper.el (viper-standard-value): moved to viper-cmd.el. Use viper-cond-compile-for-xemacs-or-emacs. * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new macro designed to be used in many places where ediff-emacs-p or ediff-xemacs-p was previously used. Reduces the number of warnings. Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue of ediff-xemacs-p. (ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer, ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents): moved to ediff-util.el. (ediff-event-key): moved here. * ediff-merge.el: got rid of unreferenced variables. * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. (ediff-cleanup-mess): improved the way windows are set up after quitting ediff. (ediff-janitor): use ediff-dispose-of-variant-according-to-user. (ediff-dispose-of-variant-according-to-user): new function designed to be smarter and also understands indirect buffers. (ediff-highlight-diff-in-one-buffer, ediff-unhighlight-diff-in-one-buffer, ediff-unhighlight-diffs-totally-in-one-buffer, ediff-highlight-diff, ediff-highlight-diff, ediff-unhighlight-diff, ediff-unhighlight-diffs-totally, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents, ediff-make-current-diff-overlay): moved here. (ediff-format-bindings-of): new function by Hannu Koivisto <azure@iki.fi>. (ediff-setup): make sure the merge buffer is always widened and modifiable. (ediff-write-merge-buffer-and-maybe-kill): refuse to write the result of a merge into a file visited by another buffer. (ediff-arrange-autosave-in-merge-jobs): check if the merge file is visited by another buffer and ask to save/delete that buffer. (ediff-verify-file-merge-buffer): new function to do the above. * ediff-vers.el: load ediff-init.el at compile time. * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff.el (ediff-windows, ediff-regions-wordwise, ediff-regions-linewise): use indirect buffers to improve robustness and make it possible to compare regions of the same buffer (even overlapping regions). (ediff-clone-buffer-for-region-comparison, ediff-clone-buffer-for-window-comparison): new functions. (ediff-files-internal): refuse to compare identical files. (ediff-regions-internal): get rid of the warning about comparing regions of the same buffer. * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. Plus the following fixes courtesy of Dave Love: Doc fixes. (ediff-word-1): Use word class and move - to the front per regexp documentation. (ediff-wordify): Bind forward-word-function outside loop. (ediff-copy-to-buffer): Use insert-buffer-substring rather than consing buffer contents. (ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
1997-08-02 07:40:22 +00:00
(defsubst viper-device-type ()
(if (featurep 'xemacs)
(device-type (selected-device))
window-system))
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): new macro that replaces viper-emacs-p and viper-xemacs-p in many cases. Used to reduce the number of warnings. * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-standard-value): moved here from viper.el. (viper-set-unread-command-events): moved to viper-util.el (viper-check-minibuffer-overlay): make sure viper-minibuffer-overlay is moved to cover the entire input field. * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-read-key-sequence, viper-set-unread-command-events, viper-char-symbol-sequence-p, viper-char-array-p): moved here. * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, viper-event-vector-p): moved to viper-util.el * viper.el (viper-standard-value): moved to viper-cmd.el. Use viper-cond-compile-for-xemacs-or-emacs. * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new macro designed to be used in many places where ediff-emacs-p or ediff-xemacs-p was previously used. Reduces the number of warnings. Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue of ediff-xemacs-p. (ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer, ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents): moved to ediff-util.el. (ediff-event-key): moved here. * ediff-merge.el: got rid of unreferenced variables. * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. (ediff-cleanup-mess): improved the way windows are set up after quitting ediff. (ediff-janitor): use ediff-dispose-of-variant-according-to-user. (ediff-dispose-of-variant-according-to-user): new function designed to be smarter and also understands indirect buffers. (ediff-highlight-diff-in-one-buffer, ediff-unhighlight-diff-in-one-buffer, ediff-unhighlight-diffs-totally-in-one-buffer, ediff-highlight-diff, ediff-highlight-diff, ediff-unhighlight-diff, ediff-unhighlight-diffs-totally, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents, ediff-make-current-diff-overlay): moved here. (ediff-format-bindings-of): new function by Hannu Koivisto <azure@iki.fi>. (ediff-setup): make sure the merge buffer is always widened and modifiable. (ediff-write-merge-buffer-and-maybe-kill): refuse to write the result of a merge into a file visited by another buffer. (ediff-arrange-autosave-in-merge-jobs): check if the merge file is visited by another buffer and ask to save/delete that buffer. (ediff-verify-file-merge-buffer): new function to do the above. * ediff-vers.el: load ediff-init.el at compile time. * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff.el (ediff-windows, ediff-regions-wordwise, ediff-regions-linewise): use indirect buffers to improve robustness and make it possible to compare regions of the same buffer (even overlapping regions). (ediff-clone-buffer-for-region-comparison, ediff-clone-buffer-for-window-comparison): new functions. (ediff-files-internal): refuse to compare identical files. (ediff-regions-internal): get rid of the warning about comparing regions of the same buffer. * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. Plus the following fixes courtesy of Dave Love: Doc fixes. (ediff-word-1): Use word class and move - to the front per regexp documentation. (ediff-wordify): Bind forward-word-function outside loop. (ediff-copy-to-buffer): Use insert-buffer-substring rather than consing buffer contents. (ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
(defun viper-color-display-p ()
(condition-case nil
(if (featurep 'xemacs)
(eq (device-class (selected-device)) 'color)
(display-color-p))
(error nil)))
1997-05-31 00:02:53 +00:00
;; in XEmacs: device-type is tty on tty and stream in batch.
1997-08-02 07:40:22 +00:00
(defun viper-window-display-p ()
(and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
1997-05-31 00:02:53 +00:00
1997-09-30 01:13:53 +00:00
(defcustom viper-ms-style-os-p (memq system-type
'(ms-dos windows-nt windows-95))
1997-07-17 19:37:07 +00:00
"Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95."
:type 'boolean
:tag "Is it Microsoft-made OS?"
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-07-17 19:37:07 +00:00
(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)
1997-08-02 07:40:22 +00:00
(defcustom viper-force-faces nil
1997-05-31 00:02:53 +00:00
"If t, Viper will think that it is running on a display that supports faces.
1997-07-17 19:37:07 +00:00
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
1997-09-30 01:13:53 +00:00
:group 'viper-highlighting)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defun viper-has-face-support-p ()
(cond ((viper-window-display-p))
(viper-force-faces)
((viper-color-display-p))
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
((featurep 'emacs) (memq (viper-device-type) '(pc)))
((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
1997-05-31 00:02:53 +00:00
;;; Macros
1997-08-02 07:40:22 +00:00
(defmacro viper-deflocalvar (var default-value &optional documentation)
`(progn
(defvar ,var ,default-value
,(format "%s\n\(buffer local\)" documentation))
(make-variable-buffer-local ',var)))
1997-05-31 00:02:53 +00:00
1997-08-22 03:15:57 +00:00
;; (viper-loop COUNT BODY) Execute BODY COUNT times.
(defmacro viper-loop (count &rest body)
`(let ((count ,count))
(while (> count 0)
,@body
(setq count (1- count)))))
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defmacro viper-buffer-live-p (buf)
`(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
1997-05-31 00:02:53 +00:00
;; return buffer-specific macro definition, given a full macro definition
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-buf-alist (macro-elt)
`(nth 1 ,macro-elt))
1997-05-31 00:02:53 +00:00
;; get a pair: (curr-buffer . macro-definition)
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-buf-pair (macro-elt)
`(assoc (buffer-name) (viper-kbd-buf-alist ,macro-elt)))
1997-05-31 00:02:53 +00:00
;; get macro definition for current buffer
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-buf-definition (macro-elt)
`(cdr (viper-kbd-buf-pair ,macro-elt)))
1997-05-31 00:02:53 +00:00
;; return mode-specific macro definitions, given a full macro definition
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-mode-alist (macro-elt)
`(nth 2 ,macro-elt))
1997-05-31 00:02:53 +00:00
;; get a pair: (major-mode . macro-definition)
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-mode-pair (macro-elt)
`(assoc major-mode (viper-kbd-mode-alist ,macro-elt)))
1997-05-31 00:02:53 +00:00
;; get macro definition for the current major mode
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-mode-definition (macro-elt)
`(cdr (viper-kbd-mode-pair ,macro-elt)))
1997-05-31 00:02:53 +00:00
;; return global macro definition, given a full macro definition
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-global-pair (macro-elt)
`(nth 3 ,macro-elt))
1997-05-31 00:02:53 +00:00
;; get global macro definition from an elt of macro-alist
1997-08-02 07:40:22 +00:00
(defmacro viper-kbd-global-definition (macro-elt)
`(cdr (viper-kbd-global-pair ,macro-elt)))
1997-05-31 00:02:53 +00:00
;; last elt of a sequence
1997-08-02 07:40:22 +00:00
(defsubst viper-seq-last-elt (seq)
1997-05-31 00:02:53 +00:00
(elt seq (1- (length seq))))
1997-08-22 03:15:57 +00:00
(defsubst viper-string-to-list (string)
(append (vconcat string) nil))
(defsubst viper-charlist-to-string (list)
(mapconcat 'char-to-string list ""))
;; like char-after/before, but saves typing
(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))))
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defvar viper-minibuffer-overlay-priority 300)
(defvar viper-replace-overlay-priority 400)
(defvar viper-search-overlay-priority 500)
1997-05-31 00:02:53 +00:00
;;; Viper minor modes
;; Mode for vital things like \e, C-z.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-intercept-minor-mode nil)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-basic-minor-mode nil
1997-05-31 00:02:53 +00:00
"Viper's minor mode for Vi bindings.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-local-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"Auxiliary minor mode for user-defined local bindings in Vi state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-global-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"Auxiliary minor mode for user-defined global bindings in Vi state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-state-modifier-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode used to make major-mode-specific modification to Vi state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-diehard-minor-mode nil
1997-05-31 00:02:53 +00:00
"This minor mode is in effect when the user wants Viper to be Vi.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-kbd-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode for Ex command macros in Vi state.
The corresponding keymap stores key bindings of Vi macros defined with
the Ex command :map.")
;; Mode for vital things like \e, C-z.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-intercept-minor-mode nil)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-basic-minor-mode nil
1997-05-31 00:02:53 +00:00
"Viper's minor mode for bindings in Insert mode.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-local-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"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.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-global-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"Auxiliary minor mode for global user-defined bindings in Insert state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-state-modifier-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode used to make major-mode-specific modification to Insert state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-diehard-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode that simulates Vi very closely.
Not recommened, except for the novice user.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-kbd-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode for Ex command macros Insert state.
The corresponding keymap stores key bindings of Vi macros defined with
the Ex command :map!.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-replace-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode in effect in replace state (cw, C, and the like commands).")
1997-11-01 01:46:51 +00:00
;; Mode for vital things like \C-z and \C-x) This is set to t, when viper-mode
1999-11-01 07:16:15 +00:00
;; is invoked. So, any new buffer will have C-z defined as switch to Vi,
;; unless we switched states in this buffer
1997-11-01 01:46:51 +00:00
(viper-deflocalvar viper-emacs-intercept-minor-mode nil)
1997-11-01 01:46:51 +00:00
(viper-deflocalvar viper-emacs-local-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"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.")
1997-11-01 01:46:51 +00:00
(viper-deflocalvar viper-emacs-global-user-minor-mode nil
1997-05-31 00:02:53 +00:00
"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.")
1997-05-31 00:02:53 +00:00
1997-11-01 01:46:51 +00:00
(viper-deflocalvar viper-emacs-kbd-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode for Vi style macros in Emacs state.
The corresponding keymap stores key bindings of Vi macros defined with
1999-11-01 07:16:15 +00:00
`viper-record-kbd-macro' command. There is no Ex-level command to do this
1997-05-31 00:02:53 +00:00
interactively.")
1997-11-01 01:46:51 +00:00
(viper-deflocalvar viper-emacs-state-modifier-minor-mode nil
1997-05-31 00:02:53 +00:00
"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.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-vi-minibuffer-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode that forces Vi-style when the Minibuffer is in Vi state.")
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-insert-minibuffer-minor-mode nil
1997-05-31 00:02:53 +00:00
"Minor mode that forces Vi-style when the Minibuffer is in Insert state.")
1997-05-31 00:02:53 +00:00
;; Some common error messages
1997-08-02 07:40:22 +00:00
(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" "")
1997-05-31 00:02:53 +00:00
;; Is t until viper-mode executes for the very first time.
1997-05-31 00:02:53 +00:00
;; Prevents recursive descend into startup messages.
1997-08-02 07:40:22 +00:00
(defvar viper-first-time t)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defvar viper-expert-level (if (boundp 'viper-expert-level) viper-expert-level 0)
1997-05-31 00:02:53 +00:00
"User's expert level.
1997-08-02 07:40:22 +00:00
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.
1997-07-17 19:37:07 +00:00
Use `M-x viper-set-expert-level' to change this.")
1997-05-31 00:02:53 +00:00
1999-11-01 07:16:15 +00:00
;; Max expert level supported by Viper. This is NOT a user option.
1997-05-31 00:02:53 +00:00
;; It is here to make it hard for the user from resetting it.
1997-07-17 19:37:07 +00:00
(defconst viper-max-expert-level 5)
1997-05-31 00:02:53 +00:00
1997-08-22 03:15:57 +00:00
;;; ISO characters and MULE
;; If non-nil, ISO accents will be turned on in insert/replace emacs states and
;; turned off in vi-state. For some users, this behavior may be too
1999-11-01 07:16:15 +00:00
;; primitive. In this case, use insert/emacs/vi state hooks.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-automatic-iso-accents nil "")
1999-11-01 07:16:15 +00:00
;; Set iso-accents-mode to ARG. Check if it is bound first
1997-08-22 03:15:57 +00:00
(defsubst viper-set-iso-accents-mode (arg)
(if (boundp 'iso-accents-mode)
(setq iso-accents-mode arg)))
1997-08-22 03:15:57 +00:00
;; Internal flag used to control when viper mule hooks are run.
;; Don't change this!
(defvar viper-mule-hook-flag t)
1999-11-01 07:16:15 +00:00
;; If non-nil, the default intl. input method is turned on.
1997-08-22 03:15:57 +00:00
(viper-deflocalvar viper-special-input-method nil "")
1997-08-22 03:15:57 +00:00
;; viper hook to run on input-method activation
(defun viper-activate-input-method-action ()
(if (null viper-mule-hook-flag)
()
(setq viper-special-input-method t)
;; turn off special input methods in vi-state
(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))
1997-08-22 03:15:57 +00:00
(message "Viper special input method%s: on"
(if (or current-input-method default-input-method)
(format " %S"
1997-08-22 03:15:57 +00:00
(or current-input-method default-input-method))
"")))
))
1998-05-04 22:42:59 +00:00
1997-08-22 03:15:57 +00:00
;; viper hook to run on input-method deactivation
(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))
1997-08-22 03:15:57 +00:00
(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 ()
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
(cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method))
1997-08-22 03:15:57 +00:00
(inactivate-input-method))
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
((and (featurep 'xemacs) (boundp 'current-input-method))
;; XEmacs had broken quail-mode for some time, so we are working around
;; it here
1997-08-22 03:15:57 +00:00
(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 ()
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
(cond ((and (featurep 'emacs) (fboundp 'activate-input-method))
1997-08-22 03:15:57 +00:00
(activate-input-method default-input-method))
((featurep 'xemacs)
(if (fboundp 'quail-mode) (quail-mode 1)))))
1997-08-22 03:15:57 +00:00
;; Set quail-mode to ARG
(defun viper-set-input-method (arg)
(setq viper-mule-hook-flag t) ; just a precaution
(let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks
1997-08-22 03:15:57 +00:00
(cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
;; activate input method
(viper-activate-input-method))
(t ; deactivate input method
(viper-inactivate-input-method)))
))
1997-05-31 00:02:53 +00:00
;; VI-style Undo
;; Used to 'undo' complex commands, such as replace and insert commands.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-undo-needs-adjustment nil)
(put 'viper-undo-needs-adjustment 'permanent-local t)
1997-05-31 00:02:53 +00:00
;; A mark that Viper puts on buffer-undo-list. Marks the beginning of a
1999-11-01 07:16:15 +00:00
;; complex command that must be undone atomically. If inserted, it is
1997-08-02 07:40:22 +00:00
;; erased by viper-change-state-to-vi and viper-repeat.
(defconst viper-buffer-undo-list-mark 'viper)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-keep-point-on-undo nil
1997-05-31 00:02:53 +00:00
"*Non-nil means not to move point while undoing commands.
1999-11-01 07:16:15 +00:00
This style is different from Emacs and Vi. Try it to see if
1997-07-17 19:37:07 +00:00
it better fits your working style."
:type 'boolean
:tag "Preserve Position of Point After Undo"
:group 'viper)
1997-05-31 00:02:53 +00:00
;; Replace mode and changing text
1998-05-04 22:42:59 +00:00
;; Hack used to pass global states around for short period of time
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-intermediate-command nil "")
;; This is used to pass the right Vi command key sequence to
;; viper-set-destructive-command whenever (this-command-keys) doesn't give the
1999-11-01 07:16:15 +00:00
;; right result. For instance, in commands like c/bla<RET>,
;; (this-command-keys) will return ^M, which invoked exit-minibuffer, while we
;; need "c/"
1997-08-02 07:40:22 +00:00
(defconst viper-this-command-keys nil)
1997-05-31 00:02:53 +00:00
;; Indicates that the current destructive command has started in replace mode.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-began-as-replace nil "")
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-allow-multiline-replace-regions t
1997-05-31 00:02:53 +00:00
"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
1997-07-17 19:37:07 +00:00
delete the text being replaced, as in standard Vi."
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(defcustom viper-replace-overlay-cursor-color "Red"
1997-07-17 19:37:07 +00:00
"*Cursor color when Viper is in Replace state."
:type 'string
:group 'viper)
1997-08-02 07:40:22 +00:00
(defcustom viper-insert-state-cursor-color "Green"
1997-07-17 19:37:07 +00:00
"Cursor color when Viper is in insert state."
:type 'string
:group 'viper)
1997-05-31 00:02:53 +00:00
;; viper-emacs-state-cursor-color doesn't work well. Causes cursor colors to be
;; confused in some cases. So, this var is nulled for now.
;; (defcustom viper-emacs-state-cursor-color "Magenta"
(defcustom viper-emacs-state-cursor-color nil
"Cursor color when Viper is in Emacs state."
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu> * viper-cmd.el (viper-insert-state-post-command-sentinel, viper-change-state-to-vi, viper-change-state-to-emacs): made aware of cursor coloring in the emacs state. (viper-special-read-and-insert-char): use read-char-exclusive. (viper-minibuffer-trim-tail): workaround for fields in minibuffer. * viper-init.el (viper-emacs-state-cursor-color): new variable. * viper-util.el (viper-save-cursor-color, viper-get-saved-cursor-color-in-replace-mode, viper-get-saved-cursor-color-in-insert-mode, viper-restore-cursor-color): make aware of the cursor color in emacs state. (viper-get-saved-cursor-color-in-emacs-mode): new function. * ediff-diff.el (ediff-ignore-case, ediff-ignore-case-option, ediff-ignore-case-option3, ediff-actual-diff-options, ediff-actual-diff3-options): new variables to control case sensitivity. (ediff-make-diff2-buffer, ediff-setup-fine-diff-regions, ediff-setup-diff-regions3): made aware of case-sensitivity. (ediff-toggle-ignore-case): new function. (ediff-extract-diffs, ediff-extract-diffs3): preserve point in buffers. * ediff-help.el (ediff-long-help-message-narrow2, ediff-long-help-message-compare2, ediff-long-help-message-compare3, ediff-long-help-message-word-mode): add ignore-case command. (ediff-help-for-quick-help): add ignore-case command. * ediff-merg.el: move provide to the end. * ediff-ptch.el: move provide to the end. * ediff-wind.el: move provide to the end. * ediff-mult.el: move provide to the end. (ediff-set-meta-overlay): enable follow-link. * ediff.el: move provide to the end. Break recursive load cycle in eval-when-compile. (ediff-patch-buffer): better heuristics. * ediff-util.el: move provide to the end. Break recursive load cycle in eval-when-compile. (ediff-setup-keymap): add binding for #c. Replaced some defsubsts with defuns. (ediff-submit-report): pass the values of ediff-diff3-program, ediff-diff3-options.
2006-02-19 03:16:45 +00:00
:type 'string
:group 'viper)
1999-11-01 07:16:15 +00:00
;; internal var, used to remember the default cursor color of emacs frames
(defvar viper-vi-state-cursor-color nil)
;; Frame-local variables are obsolete from Emacs 22.2 onwards, so we
;; do it by hand with viper-frame-value (qv).
(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))
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-replace-overlay nil "")
(put 'viper-replace-overlay 'permanent-local t)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-replace-region-end-delimiter "$"
1997-05-31 00:02:53 +00:00
"A string marking the end of replacement regions.
1997-08-02 07:40:22 +00:00
It is used only with TTYs or if `viper-use-replace-region-delimiters'
1997-07-17 19:37:07 +00:00
is non-nil."
:type 'string
:group 'viper)
1997-08-02 07:40:22 +00:00
(defcustom viper-replace-region-start-delimiter ""
1997-05-31 00:02:53 +00:00
"A string marking the beginning of replacement regions.
1997-08-02 07:40:22 +00:00
It is used only with TTYs or if `viper-use-replace-region-delimiters'
1997-07-17 19:37:07 +00:00
is non-nil."
:type 'string
:group 'viper)
(defcustom viper-use-replace-region-delimiters
1997-09-05 04:48:58 +00:00
(or (not (viper-has-face-support-p))
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
(and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
1997-08-02 07:40:22 +00:00
"*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
`viper-replace-region-start-delimiter' to delimit replacement regions, even on
1999-11-01 07:16:15 +00:00
color displays. By default, the delimiters are used only on TTYs."
1997-07-17 19:37:07 +00:00
:type 'boolean
:group 'viper)
1999-11-01 07:16:15 +00:00
(defcustom viper-read-buffer-function 'read-buffer
"Function to use for prompting the user for a buffer name."
:type 'symbol
:group 'viper)
1997-05-31 00:02:53 +00:00
;; XEmacs requires glyphs
(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))))
1997-05-31 00:02:53 +00:00
;; These are local marker that must be initialized to nil and moved with
1997-08-02 07:40:22 +00:00
;; `viper-move-marker-locally'
1997-05-31 00:02:53 +00:00
;;
;; Remember the last position inside the replace region.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-last-posn-in-replace-region nil)
1997-05-31 00:02:53 +00:00
;; Remember the last position while inserting
1997-08-02 07:40:22 +00:00
(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)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-sitting-in-replace nil "")
(put 'viper-sitting-in-replace 'permanent-local t)
1997-05-31 00:02:53 +00:00
;; Remember the number of characters that have to be deleted in replace
;; mode to compensate for the inserted characters.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-replace-chars-to-delete 0 "")
1997-08-22 03:15:57 +00:00
;; This variable is used internally by the before/after changed functions to
1999-11-01 07:16:15 +00:00
;; determine how many chars were deleted by the change. This can't be
1997-08-22 03:15:57 +00:00
;; determined inside after-change-functions because those get the length of the
;; deleted region, not the number of chars deleted (which are two different
;; things under MULE).
(viper-deflocalvar viper-replace-region-chars-deleted 0 "")
1997-05-31 00:02:53 +00:00
;; Insertion ring and command ring
1997-08-02 07:40:22 +00:00
(defcustom viper-insertion-ring-size 14
1997-07-17 19:37:07 +00:00
"The size of history of inserted text.
This is a list where Viper keeps the history of previously inserted pieces of
text."
:type 'integer
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-05-31 00:02:53 +00:00
;; The insertion ring.
1997-08-02 07:40:22 +00:00
(defvar viper-insertion-ring nil)
1999-11-01 07:16:15 +00:00
;; This is temp insertion ring. Used to do rotation for display purposes.
1997-08-02 07:40:22 +00:00
;; When rotation just started, it is initialized to viper-insertion-ring.
(defvar viper-temp-insertion-ring nil)
(defvar viper-last-inserted-string-from-insertion-ring "")
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-command-ring-size 14
1997-07-17 19:37:07 +00:00
"The size of history of Vi commands repeatable with dot."
:type 'integer
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-05-31 00:02:53 +00:00
;; The command ring.
1997-08-02 07:40:22 +00:00
(defvar viper-command-ring nil)
1999-11-01 07:16:15 +00:00
;; This is temp command ring. Used to do rotation for display purposes.
1997-08-02 07:40:22 +00:00
;; When rotation just started, it is initialized to viper-command-ring.
(defvar viper-temp-command-ring nil)
1997-05-31 00:02:53 +00:00
1997-07-17 19:37:07 +00:00
;; Fast keyseq and ESC keyseq timeouts
1997-08-02 07:40:22 +00:00
(defcustom viper-fast-keyseq-timeout 200
1997-07-17 19:37:07 +00:00
"*Key sequence separated by no more than this many milliseconds is viewed as a Vi-style macro, if such a macro is defined.
1999-11-01 07:16:15 +00:00
Setting this too high may slow down your typing. Setting this value too low
will make it hard to use Vi-style timeout macros."
1997-07-17 19:37:07 +00:00
:type 'integer
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-07-17 19:37:07 +00:00
;; This function determines if ESC key sequences are to be translated into
;; commands.
(defun viper-translate-all-ESC-keysequences ()
(not (viper-window-display-p)))
1997-05-31 00:02:53 +00:00
;; Modes and related variables
;; Current mode. One of: `emacs-state', `vi-state', `insert-state'
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-current-state 'emacs-state)
1997-05-31 00:02:53 +00:00
;; Autoindent in insert
;; Variable that keeps track of whether C-t has been pressed.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-cted nil "")
1997-05-31 00:02:53 +00:00
;; Preserve the indent value, used by C-d in insert mode.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-current-indent 0)
1997-05-31 00:02:53 +00:00
;; Whether to preserve the indent, used by C-d in insert mode.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-preserve-indent nil)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-auto-indent nil "")
(defcustom viper-auto-indent nil
1997-07-17 19:37:07 +00:00
"*Enable autoindent, if t.
This is a buffer-local variable."
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-electric-mode t "")
(defcustom viper-electric-mode t
1997-07-17 19:37:07 +00:00
"*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
1999-11-01 07:16:15 +00:00
appropriate to the mode of the buffer. This is especially useful for editing
1997-07-17 19:37:07 +00:00
programs and LaTeX documents."
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(defcustom viper-shift-width 8
1998-05-04 22:42:59 +00:00
"*The value of the shiftwidth.
This determines the number of columns by which the Ctl-t moves the cursor in
the Insert state."
1997-07-17 19:37:07 +00:00
:type 'integer
:group 'viper)
1997-05-31 00:02:53 +00:00
;; Variables for repeating destructive commands
1997-08-02 07:40:22 +00:00
(defcustom viper-keep-point-on-repeat t
1997-05-31 00:02:53 +00:00
"*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
1997-07-17 19:37:07 +00:00
to a new place after repeating previous Vi command."
:type 'boolean
:group 'viper)
1997-05-31 00:02:53 +00:00
;; Remember insert point as a marker. This is a local marker that must be
1997-08-02 07:40:22 +00:00
;; initialized to nil and moved with `viper-move-marker-locally'.
(viper-deflocalvar viper-insert-point nil)
(put 'viper-insert-point 'permanent-local t)
1997-05-31 00:02:53 +00:00
;; This remembers the point before dabbrev-expand was called.
1997-08-02 07:40:22 +00:00
;; If viper-insert-point turns out to be bigger than that, it is reset
;; back to viper-pre-command-point.
1997-05-31 00:02:53 +00:00
;; The reason this is needed is because dabbrev-expand (and possibly
;; others) may jump to before the insertion point, delete something and
1999-11-01 07:16:15 +00:00
;; then reinsert a bigger piece. For instance: bla^blo
1997-08-02 07:40:22 +00:00
;; If dabbrev-expand is called after `blo' and ^ undicates viper-insert-point,
1999-11-01 07:16:15 +00:00
;; then point jumps to the beginning of `blo'. If expansion is found, `blablo'
;; is deleted, and we have |^, where | denotes point. Next, dabbrev-expand
1997-05-31 00:02:53 +00:00
;; will insert the expansion, and we get: blablo^
;; Whatever we insert next goes before the ^, i.e., before the
1999-11-01 07:16:15 +00:00
;; viper-insert-point marker. So, Viper will think that nothing was
;; inserted. Remembering the orig position of the marker circumvents the
1997-05-31 00:02:53 +00:00
;; problem.
;; We don't know of any command, except dabbrev-expand, that has the same
1999-11-01 07:16:15 +00:00
;; problem. However, the same trick can be used if such a command is
1997-05-31 00:02:53 +00:00
;; discovered later.
;;
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-pre-command-point nil)
(put 'viper-pre-command-point 'permanent-local t) ; this is probably an overkill
1997-05-31 00:02:53 +00:00
;; This is used for saving inserted text.
1997-08-02 07:40:22 +00:00
(defvar viper-last-insertion nil)
1997-05-31 00:02:53 +00:00
;; Remembers the last replaced region.
1997-08-02 07:40:22 +00:00
(defvar viper-last-replace-region "")
1997-05-31 00:02:53 +00:00
;; Remember com point as a marker.
1999-11-01 07:16:15 +00:00
;; This is a local marker. Should be moved with `viper-move-marker-locally'
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-com-point nil)
1997-05-31 00:02:53 +00:00
;; If non-nil, the value is a list (M-COM VAL COM REG inserted-text cmd-keys)
;; It is used to re-execute last destructive command.
;; M-COM is a Lisp symbol representing the function to be executed.
;; VAL is the prefix argument that was used with that command.
;; COM is an internal descriptor, such as ?r, ?c, ?C, which contains
;; additional information on how the function in M-COM is to be handled.
;; REG is the register used by command
;; INSERTED-TEXT is text inserted by that command (in case of o, c, C, i, r
;; commands).
;; COMMAND-KEYS are the keys that were typed to invoke the command.
1997-08-02 07:40:22 +00:00
(defvar viper-d-com nil)
1997-05-31 00:02:53 +00:00
;; The character remembered by the Vi `r' command.
1997-08-02 07:40:22 +00:00
(defvar viper-d-char nil)
1997-05-31 00:02:53 +00:00
;; Name of register to store deleted or yanked strings
1997-08-02 07:40:22 +00:00
(defvar viper-use-register nil)
1997-05-31 00:02:53 +00:00
1997-08-22 03:15:57 +00:00
;;; Variables for Moves and Searches
1997-05-31 00:02:53 +00:00
1997-09-30 01:13:53 +00:00
(defgroup viper-search nil
"Variables that define the search and query-replace behavior of Viper."
:prefix "viper-"
:group 'viper)
1997-05-31 00:02:53 +00:00
;; For use by `;' command.
1997-08-02 07:40:22 +00:00
(defvar viper-f-char nil)
1997-05-31 00:02:53 +00:00
;; For use by `.' command.
1997-08-02 07:40:22 +00:00
(defvar viper-F-char nil)
1997-05-31 00:02:53 +00:00
;; For use by `;' command.
1997-08-02 07:40:22 +00:00
(defvar viper-f-forward nil)
1997-05-31 00:02:53 +00:00
;; For use by `;' command.
1997-08-02 07:40:22 +00:00
(defvar viper-f-offset nil)
1997-05-31 00:02:53 +00:00
;; Last search string
1997-08-02 07:40:22 +00:00
(defvar viper-s-string "")
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-quote-string "> "
1997-07-17 19:37:07 +00:00
"String inserted at the beginning of quoted region."
:type 'string
:group 'viper)
1997-05-31 00:02:53 +00:00
;; If t, search is forward.
1997-08-02 07:40:22 +00:00
(defvar viper-s-forward nil)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-case-fold-search nil
1997-07-17 19:37:07 +00:00
"*If not nil, search ignores cases."
:type 'boolean
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-re-search t
1997-07-17 19:37:07 +00:00
"*If not nil, search is regexp search, otherwise vanilla search."
:type 'boolean
:tag "Regexp Search"
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-search-scroll-threshold 2
1997-05-31 00:02:53 +00:00
"*If search lands within this threshnold 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
1997-07-17 19:37:07 +00:00
negative number."
:type 'boolean
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-07-17 19:37:07 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-re-query-replace t
1997-07-17 19:37:07 +00:00
"*If t then do regexp replace, if nil then do string replace."
:type 'boolean
:tag "Regexp Query Replace"
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-07-17 19:37:07 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-re-replace t
1999-11-01 07:16:15 +00:00
"*If t, do regexp replace. nil means do string replace."
1997-07-17 19:37:07 +00:00
:type 'boolean
:tag "Regexp Replace"
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-07-17 19:37:07 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-parse-sexp-ignore-comments t
1997-07-17 19:37:07 +00:00
"*If t, `%' ignores the parentheses that occur inside comments."
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-ex-style-motion t "")
(defcustom viper-ex-style-motion t
1997-07-17 19:37:07 +00:00
"*If t, the commands l,h do not cross lines, etc (Ex-style).
If nil, these commands cross line boundaries."
:type 'boolean
:group 'viper)
1997-08-22 03:15:57 +00:00
(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.
1997-07-17 19:37:07 +00:00
Note: this doesn't preclude `Backspace' and `Delete' from deleting characters
1999-11-01 07:16:15 +00:00
by moving past the insertion point. This is a feature, not a bug.
1997-08-22 03:15:57 +00:00
If nil, the above commands can work across lines."
1997-07-17 19:37:07 +00:00
:type 'boolean
:group 'viper)
1997-08-22 03:15:57 +00:00
(viper-deflocalvar viper-ESC-moves-cursor-back viper-ex-style-editing "")
1997-08-02 07:40:22 +00:00
(defcustom viper-ESC-moves-cursor-back nil
1997-07-17 19:37:07 +00:00
"*If t, ESC moves cursor back when changing from insert to vi state.
1997-08-22 03:15:57 +00:00
If nil, the cursor stays where it was when ESC was hit."
1997-07-17 19:37:07 +00:00
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-delete-backwards-in-replace nil "")
(defcustom viper-delete-backwards-in-replace nil
1997-05-31 00:02:53 +00:00
"*If t, DEL key will delete characters while moving the cursor backwards.
1997-07-17 19:37:07 +00:00
If nil, the cursor will move backwards without deleting anything."
:type 'boolean
:group 'viper)
1997-08-02 07:40:22 +00:00
(defcustom viper-buffer-search-char nil
1999-11-01 07:16:15 +00:00
"*Key used for buffer-searching. Must be a character type, e.g., ?g."
1997-07-17 19:37:07 +00:00
:type '(choice (const nil) character)
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-07-17 19:37:07 +00:00
(defcustom viper-search-wrap-around t
1997-07-17 19:37:07 +00:00
"*If t, search wraps around."
:type 'boolean
:tag "Search Wraps Around"
1997-09-30 01:13:53 +00:00
:group 'viper-search)
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-related-files-and-buffers-ring nil "")
(defcustom viper-related-files-and-buffers-ring nil
1997-07-17 19:37:07 +00:00
"*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
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-08-02 07:40:22 +00:00
(put 'viper-related-files-and-buffers-ring 'permanent-local t)
1997-05-31 00:02:53 +00:00
;; Used to find out if we are done with searching the current buffer.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-local-search-start-marker nil)
1997-05-31 00:02:53 +00:00
;; As above, but global
1997-08-02 07:40:22 +00:00
(defvar viper-search-start-marker (make-marker))
1997-05-31 00:02:53 +00:00
;; the search overlay
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-search-overlay nil)
1997-05-31 00:02:53 +00:00
(defvar viper-heading-start
1997-05-31 00:02:53 +00:00
(concat "^\\s-*(\\s-*defun\\s-\\|" ; lisp
"^{\\s-*$\\|^[_a-zA-Z][^()]*[()].*{\\s-*$\\|" ; C/C++
"^\\s-*class.*{\\|^\\s-*struct.*{\\|^\\s-*enum.*{\\|"
"^\\\\[sb][a-z]*{.*}\\s-*$\\|" ; latex
"^@node\\|@table\\|^@m?enu\\|^@itemize\\|^@if\\|" ; texinfo
"^.+:-") ; prolog
1999-11-01 07:16:15 +00:00
"*Regexps for Headings. Used by \[\[ and \]\].")
1997-05-31 00:02:53 +00:00
(defvar viper-heading-end
1997-05-31 00:02:53 +00:00
(concat "^}\\|" ; C/C++
"^\\\\end{\\|" ; latex
"^@end \\|" ; texinfo
")\n\n[ \t\n]*\\|" ; lisp
"\\.\\s-*$") ; prolog
1999-11-01 07:16:15 +00:00
"*Regexps to end Headings/Sections. Used by \[\].")
1997-05-31 00:02:53 +00:00
;; These two vars control the interaction of jumps performed by ' and `.
;; In this new version, '' doesn't erase the marks set by ``, so one can
;; use both kinds of jumps interchangeably and without loosing positions
;; inside the lines.
;; Remembers position of the last jump done using ``'.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-last-jump nil)
1997-05-31 00:02:53 +00:00
;; Remembers position of the last jump done using `''.
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-last-jump-ignore 0)
1997-05-31 00:02:53 +00:00
;; History variables
;; History of search strings.
1997-08-02 07:40:22 +00:00
(defvar viper-search-history (list ""))
1997-05-31 00:02:53 +00:00
;; History of query-replace strings used as a source.
1997-08-02 07:40:22 +00:00
(defvar viper-replace1-history nil)
1997-05-31 00:02:53 +00:00
;; History of query-replace strings used as replacement.
1997-08-02 07:40:22 +00:00
(defvar viper-replace2-history nil)
1997-05-31 00:02:53 +00:00
;; History of region quoting strings.
1997-08-02 07:40:22 +00:00
(defvar viper-quote-region-history (list viper-quote-string))
1997-05-31 00:02:53 +00:00
;; History of Ex-style commands.
1997-08-02 07:40:22 +00:00
(defvar viper-ex-history nil)
1997-05-31 00:02:53 +00:00
;; History of shell commands.
1997-08-02 07:40:22 +00:00
(defvar viper-shell-history nil)
1997-05-31 00:02:53 +00:00
1999-11-01 07:16:15 +00:00
;; Last shell command. There are two of these, one for Ex (in viper-ex)
1997-05-31 00:02:53 +00:00
;; and one for Vi.
;; Last shell command executed with ! command.
1997-08-02 07:40:22 +00:00
(defvar viper-last-shell-com nil)
1997-05-31 00:02:53 +00:00
1997-08-07 04:48:48 +00:00
;;; Face-saving tricks
(defgroup viper-highlighting nil
"Hilighting of replace region, search pattern, minibuffer, etc."
:prefix "viper-"
:group 'viper)
(defface viper-search
1997-08-07 04:48:48 +00:00
'((((class color)) (:foreground "Black" :background "khaki"))
(t (:underline t :stipple "gray3")))
1997-08-07 04:48:48 +00:00
"*Face used to flash out the search pattern."
:group 'viper-highlighting)
1999-11-01 07:16:15 +00:00
;; An internal variable. Viper takes the face from here.
(defvar viper-search-face 'viper-search
1997-09-30 01:13:53 +00:00
"Face used to flash out the search pattern.
1999-11-01 07:16:15 +00:00
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-search'
1997-09-30 01:13:53 +00:00
this variable represents.")
1997-08-07 04:48:48 +00:00
(defface viper-replace-overlay
1997-08-07 04:48:48 +00:00
'((((class color)) (:foreground "Black" :background "darkseagreen2"))
(t (:underline t :stipple "gray3")))
1997-08-07 04:48:48 +00:00
"*Face for highlighting replace regions on a window display."
:group 'viper-highlighting)
1999-11-01 07:16:15 +00:00
;; An internal variable. Viper takes the face from here.
(defvar viper-replace-overlay-face 'viper-replace-overlay
1997-09-30 01:13:53 +00:00
"Face for highlighting replace regions on a window display.
1999-11-01 07:16:15 +00:00
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-replace-overlay'
1997-09-30 01:13:53 +00:00
this variable represents.")
1997-08-07 04:48:48 +00:00
(defface viper-minibuffer-emacs
1997-08-07 04:48:48 +00:00
'((((class color)) (:foreground "Black" :background "darkseagreen2"))
(t (:weight bold)))
1997-08-07 04:48:48 +00:00
"Face used in the Minibuffer when it is in Emacs state."
:group 'viper-highlighting)
1999-11-01 07:16:15 +00:00
;; An internal variable. Viper takes the face from here.
(defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs
1997-09-30 01:13:53 +00:00
"Face used in the Minibuffer when it is in Emacs state.
1999-11-01 07:16:15 +00:00
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-emacs'
1997-09-30 01:13:53 +00:00
this variable represents.")
1997-08-07 04:48:48 +00:00
(defface viper-minibuffer-insert
1997-08-07 04:48:48 +00:00
'((((class color)) (:foreground "Black" :background "pink"))
(t (:slant italic)))
1997-08-07 04:48:48 +00:00
"Face used in the Minibuffer when it is in Insert state."
:group 'viper-highlighting)
1999-11-01 07:16:15 +00:00
;; An internal variable. Viper takes the face from here.
(defvar viper-minibuffer-insert-face 'viper-minibuffer-insert
1997-09-30 01:13:53 +00:00
"Face used in the Minibuffer when it is in Insert state.
1999-11-01 07:16:15 +00:00
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-insert'
1997-09-30 01:13:53 +00:00
this variable represents.")
1997-08-07 04:48:48 +00:00
(defface viper-minibuffer-vi
1997-08-07 04:48:48 +00:00
'((((class color)) (:foreground "DarkGreen" :background "grey"))
(t (:inverse-video t)))
"Face used in the Minibuffer when it is in Vi state."
:group 'viper-highlighting)
1999-11-01 07:16:15 +00:00
;; An internal variable. Viper takes the face from here.
(defvar viper-minibuffer-vi-face 'viper-minibuffer-vi
1997-09-30 01:13:53 +00:00
"Face used in the Minibuffer when it is in Vi state.
1999-11-01 07:16:15 +00:00
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-vi'
1997-09-30 01:13:53 +00:00
this variable represents.")
1997-08-07 04:48:48 +00:00
;; the current face to be used in the minibuffer
1997-09-30 01:13:53 +00:00
(viper-deflocalvar
viper-minibuffer-current-face viper-minibuffer-emacs-face "")
1997-05-31 00:02:53 +00:00
;;; Miscellaneous
1997-08-02 07:40:22 +00:00
(defvar viper-inhibit-startup-message nil
1997-05-31 00:02:53 +00:00
"Whether Viper startup message should be inhibited.")
1997-08-02 07:40:22 +00:00
(defcustom viper-spell-function 'ispell-region
1997-07-17 19:37:07 +00:00
"Spell function used by #s<move> command to spell."
:type 'function
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-05-31 00:02:53 +00:00
1997-08-02 07:40:22 +00:00
(defcustom viper-tags-file-name "TAGS"
1997-07-17 19:37:07 +00:00
"The tags file used by Viper."
:type 'string
1997-09-30 01:13:53 +00:00
:group 'viper-misc)
1997-05-31 00:02:53 +00:00
1999-11-01 07:16:15 +00:00
(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)
1997-05-31 00:02:53 +00:00
;; Minibuffer
1997-08-02 07:40:22 +00:00
(defcustom viper-vi-style-in-minibuffer t
1997-05-31 00:02:53 +00:00
"If t, use vi-style editing in minibuffer.
1997-08-02 07:40:22 +00:00
Should be set in `~/.viper' file."
1997-07-17 19:37:07 +00:00
:type 'boolean
:group 'viper)
1997-05-31 00:02:53 +00:00
;; overlay used in the minibuffer to indicate which state it is in
1997-08-02 07:40:22 +00:00
(viper-deflocalvar viper-minibuffer-overlay nil)
1999-11-01 07:16:15 +00:00
(put 'viper-minibuffer-overlay 'permanent-local t)
1997-05-31 00:02:53 +00:00
;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
1998-05-04 22:42:59 +00:00
;; This is needed because beginning with Emacs 19.26, the standard
;; `minibuffer-exit-hook' is run *after* exiting the minibuffer
(defvar viper-minibuffer-exit-hook nil)
1997-05-31 00:02:53 +00:00
;; Mode line
1997-08-02 07:40:22 +00:00
(defconst viper-vi-state-id "<V> "
1997-05-31 00:02:53 +00:00
"Mode line tag identifying the Vi mode of Viper.")
1997-08-02 07:40:22 +00:00
(defconst viper-emacs-state-id "<E> "
1997-05-31 00:02:53 +00:00
"Mode line tag identifying the Emacs mode of Viper.")
1997-08-02 07:40:22 +00:00
(defconst viper-insert-state-id "<I> "
1997-05-31 00:02:53 +00:00
"Mode line tag identifying the Insert mode of Viper.")
1997-08-02 07:40:22 +00:00
(defconst viper-replace-state-id "<R> "
1997-05-31 00:02:53 +00:00
"Mode line tag identifying the Replace mode of Viper.")
1997-09-30 01:13:53 +00:00
(defgroup viper-hooks nil
"Viper hooks."
:prefix "viper-"
:group 'viper)
(defcustom viper-vi-state-hook 'viper-restore-cursor-type
1997-07-17 19:37:07 +00:00
"*Hooks run just before the switch to Vi mode is completed."
:type 'hook
1997-09-30 01:13:53 +00:00
:group 'viper-hooks)
(defcustom viper-insert-state-hook 'viper-set-insert-cursor-type
1997-07-17 19:37:07 +00:00
"*Hooks run just before the switch to Insert mode is completed."
:type 'hook
1997-09-30 01:13:53 +00:00
:group 'viper-hooks)
(defcustom viper-replace-state-hook 'viper-restore-cursor-type
1997-07-17 19:37:07 +00:00
"*Hooks run just before the switch to Replace mode is completed."
:type 'hook
1997-09-30 01:13:53 +00:00
:group 'viper-hooks)
(defcustom viper-emacs-state-hook 'viper-restore-cursor-type
1997-07-17 19:37:07 +00:00
"*Hooks run just before the switch to Emacs mode is completed."
:type 'hook
1997-09-30 01:13:53 +00:00
:group 'viper-hooks)
1997-08-02 07:40:22 +00:00
(defcustom viper-load-hook nil
1997-07-17 19:37:07 +00:00
"Hooks run just after loading Viper."
:type 'hook
1997-09-30 01:13:53 +00:00
:group 'viper-hooks)
(defun viper-restore-cursor-type ()
(condition-case nil
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
(if (featurep 'xemacs)
(set (make-local-variable 'bar-cursor) nil)
(setq cursor-type (default-value 'cursor-type)))
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): new macro that replaces viper-emacs-p and viper-xemacs-p in many cases. Used to reduce the number of warnings. * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-standard-value): moved here from viper.el. (viper-set-unread-command-events): moved to viper-util.el (viper-check-minibuffer-overlay): make sure viper-minibuffer-overlay is moved to cover the entire input field. * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. (viper-read-key-sequence, viper-set-unread-command-events, viper-char-symbol-sequence-p, viper-char-array-p): moved here. * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, viper-event-vector-p): moved to viper-util.el * viper.el (viper-standard-value): moved to viper-cmd.el. Use viper-cond-compile-for-xemacs-or-emacs. * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new macro designed to be used in many places where ediff-emacs-p or ediff-xemacs-p was previously used. Reduces the number of warnings. Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue of ediff-xemacs-p. (ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer, ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents): moved to ediff-util.el. (ediff-event-key): moved here. * ediff-merge.el: got rid of unreferenced variables. * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. (ediff-cleanup-mess): improved the way windows are set up after quitting ediff. (ediff-janitor): use ediff-dispose-of-variant-according-to-user. (ediff-dispose-of-variant-according-to-user): new function designed to be smarter and also understands indirect buffers. (ediff-highlight-diff-in-one-buffer, ediff-unhighlight-diff-in-one-buffer, ediff-unhighlight-diffs-totally-in-one-buffer, ediff-highlight-diff, ediff-highlight-diff, ediff-unhighlight-diff, ediff-unhighlight-diffs-totally, ediff-empty-diff-region-p, ediff-whitespace-diff-region-p, ediff-get-region-contents, ediff-make-current-diff-overlay): moved here. (ediff-format-bindings-of): new function by Hannu Koivisto <azure@iki.fi>. (ediff-setup): make sure the merge buffer is always widened and modifiable. (ediff-write-merge-buffer-and-maybe-kill): refuse to write the result of a merge into a file visited by another buffer. (ediff-arrange-autosave-in-merge-jobs): check if the merge file is visited by another buffer and ask to save/delete that buffer. (ediff-verify-file-merge-buffer): new function to do the above. * ediff-vers.el: load ediff-init.el at compile time. * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. * ediff.el (ediff-windows, ediff-regions-wordwise, ediff-regions-linewise): use indirect buffers to improve robustness and make it possible to compare regions of the same buffer (even overlapping regions). (ediff-clone-buffer-for-region-comparison, ediff-clone-buffer-for-window-comparison): new functions. (ediff-files-internal): refuse to compare identical files. (ediff-regions-internal): get rid of the warning about comparing regions of the same buffer. * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. Plus the following fixes courtesy of Dave Love: Doc fixes. (ediff-word-1): Use word class and move - to the front per regexp documentation. (ediff-wordify): Bind forward-word-function outside loop. (ediff-copy-to-buffer): Use insert-buffer-substring rather than consing buffer contents. (ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
(error nil)))
(defun viper-set-insert-cursor-type ()
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus.
2007-11-09 05:20:57 +00:00
(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))
1997-07-17 19:37:07 +00:00
(provide 'viper-init)
;; Local Variables:
;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
;; End:
1997-07-17 19:37:07 +00:00
;; arch-tag: 4efa2416-1fcb-4690-be10-1a2a0248d250
;;; viper-init.el ends here