diff options
| author | Dan Nicolaescu | 2007-11-09 05:20:57 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-11-09 05:20:57 +0000 |
| commit | e83d1fe87564d06d2fcbb4006dfd9133bc340aa8 (patch) | |
| tree | 2c21707997e91082db05963f343c5bf257c423b2 /lisp/emulation | |
| parent | 1da7a8c539f30cae62d116903e8fd0ecb0fefbff (diff) | |
| download | emacs-e83d1fe87564d06d2fcbb4006dfd9133bc340aa8.tar.gz emacs-e83d1fe87564d06d2fcbb4006dfd9133bc340aa8.zip | |
* 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.
Diffstat (limited to 'lisp/emulation')
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 22 | ||||
| -rw-r--r-- | lisp/emulation/viper-ex.el | 8 | ||||
| -rw-r--r-- | lisp/emulation/viper-init.el | 20 | ||||
| -rw-r--r-- | lisp/emulation/viper-macs.el | 2 | ||||
| -rw-r--r-- | lisp/emulation/viper-mous.el | 28 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 126 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 26 |
7 files changed, 108 insertions, 124 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 88af961e488..5e13edb9495 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -834,7 +834,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 834 | viper-emacs-kbd-minor-mode | 834 | viper-emacs-kbd-minor-mode |
| 835 | ch) | 835 | ch) |
| 836 | (cond ((and viper-special-input-method | 836 | (cond ((and viper-special-input-method |
| 837 | viper-emacs-p | 837 | (featurep 'emacs) |
| 838 | (fboundp 'quail-input-method)) | 838 | (fboundp 'quail-input-method)) |
| 839 | ;; (let ...) is used to restore unread-command-events to the | 839 | ;; (let ...) is used to restore unread-command-events to the |
| 840 | ;; original state. We don't want anything left in there after | 840 | ;; original state. We don't want anything left in there after |
| @@ -861,7 +861,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 861 | (1- (length quail-current-str))))) | 861 | (1- (length quail-current-str))))) |
| 862 | )) | 862 | )) |
| 863 | ((and viper-special-input-method | 863 | ((and viper-special-input-method |
| 864 | viper-xemacs-p | 864 | (featurep 'xemacs) |
| 865 | (fboundp 'quail-start-translation)) | 865 | (fboundp 'quail-start-translation)) |
| 866 | ;; same as above but for XEmacs, which doesn't have | 866 | ;; same as above but for XEmacs, which doesn't have |
| 867 | ;; quail-input-method | 867 | ;; quail-input-method |
| @@ -893,7 +893,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 893 | (t | 893 | (t |
| 894 | ;;(setq ch (read-char-exclusive)) | 894 | ;;(setq ch (read-char-exclusive)) |
| 895 | (setq ch (aref (read-key-sequence nil) 0)) | 895 | (setq ch (aref (read-key-sequence nil) 0)) |
| 896 | (if viper-xemacs-p | 896 | (if (featurep 'xemacs) |
| 897 | (setq ch (event-to-character ch))) | 897 | (setq ch (event-to-character ch))) |
| 898 | ;; replace ^M with the newline | 898 | ;; replace ^M with the newline |
| 899 | (if (eq ch ?\C-m) (setq ch ?\n)) | 899 | (if (eq ch ?\C-m) (setq ch ?\n)) |
| @@ -902,13 +902,13 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 902 | (progn | 902 | (progn |
| 903 | ;;(setq ch (read-char-exclusive)) | 903 | ;;(setq ch (read-char-exclusive)) |
| 904 | (setq ch (aref (read-key-sequence nil) 0)) | 904 | (setq ch (aref (read-key-sequence nil) 0)) |
| 905 | (if viper-xemacs-p | 905 | (if (featurep 'xemacs) |
| 906 | (setq ch (event-to-character ch)))) | 906 | (setq ch (event-to-character ch)))) |
| 907 | ) | 907 | ) |
| 908 | (insert ch)) | 908 | (insert ch)) |
| 909 | ) | 909 | ) |
| 910 | (setq last-command-event | 910 | (setq last-command-event |
| 911 | (viper-copy-event (if viper-xemacs-p | 911 | (viper-copy-event (if (featurep 'xemacs) |
| 912 | (character-to-event ch) ch))) | 912 | (character-to-event ch) ch))) |
| 913 | ) ; let | 913 | ) ; let |
| 914 | (error nil) | 914 | (error nil) |
| @@ -1080,10 +1080,10 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1080 | ;; and return ESC as the key-sequence | 1080 | ;; and return ESC as the key-sequence |
| 1081 | (viper-set-unread-command-events (viper-subseq keyseq 1)) | 1081 | (viper-set-unread-command-events (viper-subseq keyseq 1)) |
| 1082 | (setq last-input-event event | 1082 | (setq last-input-event event |
| 1083 | keyseq (if viper-emacs-p | 1083 | keyseq (if (featurep 'emacs) |
| 1084 | "\e" | 1084 | "\e" |
| 1085 | (vector (character-to-event ?\e))))) | 1085 | (vector (character-to-event ?\e))))) |
| 1086 | ((and viper-xemacs-p | 1086 | ((and (featurep 'xemacs) |
| 1087 | (key-press-event-p first-key) | 1087 | (key-press-event-p first-key) |
| 1088 | (equal '(meta) key-mod)) | 1088 | (equal '(meta) key-mod)) |
| 1089 | (viper-set-unread-command-events | 1089 | (viper-set-unread-command-events |
| @@ -1320,7 +1320,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1320 | (setq last-command-char char) | 1320 | (setq last-command-char char) |
| 1321 | (setq last-command-event | 1321 | (setq last-command-event |
| 1322 | (viper-copy-event | 1322 | (viper-copy-event |
| 1323 | (if viper-xemacs-p (character-to-event char) char))) | 1323 | (if (featurep 'xemacs) (character-to-event char) char))) |
| 1324 | (condition-case err | 1324 | (condition-case err |
| 1325 | (funcall cmd-to-exec-at-end cmd-info) | 1325 | (funcall cmd-to-exec-at-end cmd-info) |
| 1326 | (error | 1326 | (error |
| @@ -2791,7 +2791,7 @@ On reaching beginning of line, stop and signal error." | |||
| 2791 | (defun viper-next-line-carefully (arg) | 2791 | (defun viper-next-line-carefully (arg) |
| 2792 | (condition-case nil | 2792 | (condition-case nil |
| 2793 | ;; do not use forward-line! need to keep column | 2793 | ;; do not use forward-line! need to keep column |
| 2794 | (next-line arg) | 2794 | (with-no-warnings (next-line arg)) |
| 2795 | (error nil))) | 2795 | (error nil))) |
| 2796 | 2796 | ||
| 2797 | 2797 | ||
| @@ -3091,7 +3091,7 @@ On reaching beginning of line, stop and signal error." | |||
| 3091 | (com (viper-getCom arg))) | 3091 | (com (viper-getCom arg))) |
| 3092 | (if com (viper-move-marker-locally 'viper-com-point (point))) | 3092 | (if com (viper-move-marker-locally 'viper-com-point (point))) |
| 3093 | ;; do not use forward-line! need to keep column | 3093 | ;; do not use forward-line! need to keep column |
| 3094 | (next-line val) | 3094 | (with-no-warnings (next-line val)) |
| 3095 | (if viper-ex-style-motion | 3095 | (if viper-ex-style-motion |
| 3096 | (if (and (eolp) (not (bolp))) (backward-char 1))) | 3096 | (if (and (eolp) (not (bolp))) (backward-char 1))) |
| 3097 | (setq this-command 'next-line) | 3097 | (setq this-command 'next-line) |
| @@ -3135,7 +3135,7 @@ If point is on a widget or a button, simulate clicking on that widget/button." | |||
| 3135 | (com (viper-getCom arg))) | 3135 | (com (viper-getCom arg))) |
| 3136 | (if com (viper-move-marker-locally 'viper-com-point (point))) | 3136 | (if com (viper-move-marker-locally 'viper-com-point (point))) |
| 3137 | ;; do not use forward-line! need to keep column | 3137 | ;; do not use forward-line! need to keep column |
| 3138 | (previous-line val) | 3138 | (with-no-warnings (previous-line val)) |
| 3139 | (if viper-ex-style-motion | 3139 | (if viper-ex-style-motion |
| 3140 | (if (and (eolp) (not (bolp))) (backward-char 1))) | 3140 | (if (and (eolp) (not (bolp))) (backward-char 1))) |
| 3141 | (setq this-command 'previous-line) | 3141 | (setq this-command 'previous-line) |
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index d9cc97719ca..caeecd12c8a 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el | |||
| @@ -1103,7 +1103,7 @@ reversed." | |||
| 1103 | beg end cont val) | 1103 | beg end cont val) |
| 1104 | 1104 | ||
| 1105 | (viper-add-keymap ex-read-filename-map | 1105 | (viper-add-keymap ex-read-filename-map |
| 1106 | (if viper-emacs-p | 1106 | (if (featurep 'emacs) |
| 1107 | minibuffer-local-completion-map | 1107 | minibuffer-local-completion-map |
| 1108 | read-file-name-map)) | 1108 | read-file-name-map)) |
| 1109 | 1109 | ||
| @@ -1558,7 +1558,7 @@ reversed." | |||
| 1558 | ;; setup buffer | 1558 | ;; setup buffer |
| 1559 | (if (setq wind (viper-get-visible-buffer-window buf)) | 1559 | (if (setq wind (viper-get-visible-buffer-window buf)) |
| 1560 | () | 1560 | () |
| 1561 | (setq wind (get-lru-window (if viper-xemacs-p nil 'visible))) | 1561 | (setq wind (get-lru-window (if (featurep 'xemacs) nil 'visible))) |
| 1562 | (set-window-buffer wind buf)) | 1562 | (set-window-buffer wind buf)) |
| 1563 | 1563 | ||
| 1564 | (if (viper-window-display-p) | 1564 | (if (viper-window-display-p) |
| @@ -1878,7 +1878,7 @@ reversed." | |||
| 1878 | (condition-case nil | 1878 | (condition-case nil |
| 1879 | (progn | 1879 | (progn |
| 1880 | (pop-to-buffer (get-buffer-create "*info*")) | 1880 | (pop-to-buffer (get-buffer-create "*info*")) |
| 1881 | (info (if viper-xemacs-p "viper.info" "viper")) | 1881 | (info (if (featurep 'xemacs) "viper.info" "viper")) |
| 1882 | (message "Type `i' to search for a specific topic")) | 1882 | (message "Type `i' to search for a specific topic")) |
| 1883 | (error (beep 1) | 1883 | (error (beep 1) |
| 1884 | (with-output-to-temp-buffer " *viper-info*" | 1884 | (with-output-to-temp-buffer " *viper-info*" |
| @@ -1887,7 +1887,7 @@ The Info file for Viper does not seem to be installed. | |||
| 1887 | 1887 | ||
| 1888 | This file is part of the standard distribution of %sEmacs. | 1888 | This file is part of the standard distribution of %sEmacs. |
| 1889 | Please contact your system administrator. " | 1889 | Please contact your system administrator. " |
| 1890 | (if viper-xemacs-p "X" "") | 1890 | (if (featurep 'xemacs) "X" "") |
| 1891 | )))))) | 1891 | )))))) |
| 1892 | 1892 | ||
| 1893 | ;; Ex source command. Loads the file specified as argument or `~/.viper' | 1893 | ;; Ex source command. Loads the file specified as argument or `~/.viper' |
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 1b05ef7189d..1b1e07a0a0c 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -49,10 +49,6 @@ | |||
| 49 | (interactive) | 49 | (interactive) |
| 50 | (message "Viper version is %s" viper-version)) | 50 | (message "Viper version is %s" viper-version)) |
| 51 | 51 | ||
| 52 | ;; Is it XEmacs? | ||
| 53 | (defconst viper-xemacs-p (featurep 'xemacs)) | ||
| 54 | ;; Is it Emacs? | ||
| 55 | (defconst viper-emacs-p (not viper-xemacs-p)) | ||
| 56 | ;; Tell whether we are running as a window application or on a TTY | 52 | ;; Tell whether we are running as a window application or on a TTY |
| 57 | 53 | ||
| 58 | ;; This is used to avoid compilation warnings. When emacs/xemacs forms can | 54 | ;; This is used to avoid compilation warnings. When emacs/xemacs forms can |
| @@ -116,8 +112,8 @@ In all likelihood, you don't need to bother with this setting." | |||
| 116 | (cond ((viper-window-display-p)) | 112 | (cond ((viper-window-display-p)) |
| 117 | (viper-force-faces) | 113 | (viper-force-faces) |
| 118 | ((viper-color-display-p)) | 114 | ((viper-color-display-p)) |
| 119 | (viper-emacs-p (memq (viper-device-type) '(pc))) | 115 | ((featurep 'emacs) (memq (viper-device-type) '(pc))) |
| 120 | (viper-xemacs-p (memq (viper-device-type) '(tty pc))))) | 116 | ((featurep 'xemacs) (memq (viper-device-type) '(tty pc))))) |
| 121 | 117 | ||
| 122 | 118 | ||
| 123 | ;;; Macros | 119 | ;;; Macros |
| @@ -356,9 +352,9 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 356 | ""))))) | 352 | ""))))) |
| 357 | 353 | ||
| 358 | (defun viper-inactivate-input-method () | 354 | (defun viper-inactivate-input-method () |
| 359 | (cond ((and viper-emacs-p (fboundp 'inactivate-input-method)) | 355 | (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method)) |
| 360 | (inactivate-input-method)) | 356 | (inactivate-input-method)) |
| 361 | ((and viper-xemacs-p (boundp 'current-input-method)) | 357 | ((and (featurep 'xemacs) (boundp 'current-input-method)) |
| 362 | ;; XEmacs had broken quil-mode for some time, so we are working around | 358 | ;; XEmacs had broken quil-mode for some time, so we are working around |
| 363 | ;; it here | 359 | ;; it here |
| 364 | (setq quail-mode nil) | 360 | (setq quail-mode nil) |
| @@ -370,7 +366,7 @@ Use `M-x viper-set-expert-level' to change this.") | |||
| 370 | (force-mode-line-update)) | 366 | (force-mode-line-update)) |
| 371 | )) | 367 | )) |
| 372 | (defun viper-activate-input-method () | 368 | (defun viper-activate-input-method () |
| 373 | (cond ((and viper-emacs-p (fboundp 'activate-input-method)) | 369 | (cond ((and (featurep 'emacs) (fboundp 'activate-input-method)) |
| 374 | (activate-input-method default-input-method)) | 370 | (activate-input-method default-input-method)) |
| 375 | ((featurep 'xemacs) | 371 | ((featurep 'xemacs) |
| 376 | (if (fboundp 'quail-mode) (quail-mode 1))))) | 372 | (if (fboundp 'quail-mode) (quail-mode 1))))) |
| @@ -475,7 +471,7 @@ is non-nil." | |||
| 475 | :group 'viper) | 471 | :group 'viper) |
| 476 | (defcustom viper-use-replace-region-delimiters | 472 | (defcustom viper-use-replace-region-delimiters |
| 477 | (or (not (viper-has-face-support-p)) | 473 | (or (not (viper-has-face-support-p)) |
| 478 | (and viper-xemacs-p (eq (viper-device-type) 'tty))) | 474 | (and (featurep 'xemacs) (eq (viper-device-type) 'tty))) |
| 479 | "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and | 475 | "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and |
| 480 | `viper-replace-region-start-delimiter' to delimit replacement regions, even on | 476 | `viper-replace-region-start-delimiter' to delimit replacement regions, even on |
| 481 | color displays. By default, the delimiters are used only on TTYs." | 477 | color displays. By default, the delimiters are used only on TTYs." |
| @@ -1018,13 +1014,13 @@ Should be set in `~/.viper' file." | |||
| 1018 | 1014 | ||
| 1019 | (defun viper-restore-cursor-type () | 1015 | (defun viper-restore-cursor-type () |
| 1020 | (condition-case nil | 1016 | (condition-case nil |
| 1021 | (if viper-xemacs-p | 1017 | (if (featurep 'xemacs) |
| 1022 | (set (make-local-variable 'bar-cursor) nil) | 1018 | (set (make-local-variable 'bar-cursor) nil) |
| 1023 | (setq cursor-type default-cursor-type)) | 1019 | (setq cursor-type default-cursor-type)) |
| 1024 | (error nil))) | 1020 | (error nil))) |
| 1025 | 1021 | ||
| 1026 | (defun viper-set-insert-cursor-type () | 1022 | (defun viper-set-insert-cursor-type () |
| 1027 | (if viper-xemacs-p | 1023 | (if (featurep 'xemacs) |
| 1028 | (set (make-local-variable 'bar-cursor) 2) | 1024 | (set (make-local-variable 'bar-cursor) 2) |
| 1029 | (setq cursor-type '(bar . 2)))) | 1025 | (setq cursor-type '(bar . 2)))) |
| 1030 | 1026 | ||
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index bf3f0eefb39..788feaf86e6 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el | |||
| @@ -826,7 +826,7 @@ name from there." | |||
| 826 | (defun viper-char-array-to-macro (array) | 826 | (defun viper-char-array-to-macro (array) |
| 827 | (let ((vec (vconcat array)) | 827 | (let ((vec (vconcat array)) |
| 828 | macro) | 828 | macro) |
| 829 | (if viper-xemacs-p | 829 | (if (featurep 'xemacs) |
| 830 | (setq macro (mapcar 'character-to-event vec)) | 830 | (setq macro (mapcar 'character-to-event vec)) |
| 831 | (setq macro vec)) | 831 | (setq macro vec)) |
| 832 | (vconcat (mapcar 'viper-event-key macro)))) | 832 | (vconcat (mapcar 'viper-event-key macro)))) |
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index e95e80aa4e0..7a47d321890 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el | |||
| @@ -79,7 +79,7 @@ or a tripple-click." | |||
| 79 | ;; time interval in millisecond within which successive clicks are | 79 | ;; time interval in millisecond within which successive clicks are |
| 80 | ;; considered related | 80 | ;; considered related |
| 81 | (defcustom viper-multiclick-timeout (if (viper-window-display-p) | 81 | (defcustom viper-multiclick-timeout (if (viper-window-display-p) |
| 82 | (if viper-xemacs-p | 82 | (if (featurep 'xemacs) |
| 83 | mouse-track-multi-click-time | 83 | mouse-track-multi-click-time |
| 84 | double-click-time) | 84 | double-click-time) |
| 85 | 500) | 85 | 500) |
| @@ -227,7 +227,7 @@ is ignored." | |||
| 227 | ) ; if | 227 | ) ; if |
| 228 | ;; XEmacs doesn't have set-text-properties, but there buffer-substring | 228 | ;; XEmacs doesn't have set-text-properties, but there buffer-substring |
| 229 | ;; doesn't return properties together with the string, so it's not needed. | 229 | ;; doesn't return properties together with the string, so it's not needed. |
| 230 | (if viper-emacs-p | 230 | (if (featurep 'emacs) |
| 231 | (set-text-properties 0 (length result) nil result)) | 231 | (set-text-properties 0 (length result) nil result)) |
| 232 | result | 232 | result |
| 233 | )) | 233 | )) |
| @@ -273,7 +273,7 @@ See `viper-surrounding-word' for the definition of a word in this case." | |||
| 273 | 'viper-mouse-catch-frame-switch)) | 273 | 'viper-mouse-catch-frame-switch)) |
| 274 | (not (eq (key-binding viper-mouse-up-insert-key-parsed) | 274 | (not (eq (key-binding viper-mouse-up-insert-key-parsed) |
| 275 | 'viper-mouse-click-insert-word)) | 275 | 'viper-mouse-click-insert-word)) |
| 276 | (and viper-xemacs-p (not (event-over-text-area-p click))))) | 276 | (and (featurep 'xemacs) (not (event-over-text-area-p click))))) |
| 277 | () ; do nothing, if binding isn't right or not over text | 277 | () ; do nothing, if binding isn't right or not over text |
| 278 | ;; turn arg into a number | 278 | ;; turn arg into a number |
| 279 | (cond ((integerp arg) nil) | 279 | (cond ((integerp arg) nil) |
| @@ -364,7 +364,7 @@ this command." | |||
| 364 | 'viper-mouse-catch-frame-switch)) | 364 | 'viper-mouse-catch-frame-switch)) |
| 365 | (not (eq (key-binding viper-mouse-up-search-key-parsed) | 365 | (not (eq (key-binding viper-mouse-up-search-key-parsed) |
| 366 | 'viper-mouse-click-search-word)) | 366 | 'viper-mouse-click-search-word)) |
| 367 | (and viper-xemacs-p (not (event-over-text-area-p click))))) | 367 | (and (featurep 'xemacs) (not (event-over-text-area-p click))))) |
| 368 | () ; do nothing, if binding isn't right or not over text | 368 | () ; do nothing, if binding isn't right or not over text |
| 369 | (let ((previous-search-string viper-s-string) | 369 | (let ((previous-search-string viper-s-string) |
| 370 | click-word click-count) | 370 | click-word click-count) |
| @@ -507,19 +507,19 @@ bindings in the Viper manual." | |||
| 507 | () | 507 | () |
| 508 | (setq button-spec | 508 | (setq button-spec |
| 509 | (cond ((memq 1 key) | 509 | (cond ((memq 1 key) |
| 510 | (if viper-emacs-p | 510 | (if (featurep 'emacs) |
| 511 | (if (eq 'up event-type) | 511 | (if (eq 'up event-type) |
| 512 | "mouse-1" "down-mouse-1") | 512 | "mouse-1" "down-mouse-1") |
| 513 | (if (eq 'up event-type) | 513 | (if (eq 'up event-type) |
| 514 | 'button1up 'button1))) | 514 | 'button1up 'button1))) |
| 515 | ((memq 2 key) | 515 | ((memq 2 key) |
| 516 | (if viper-emacs-p | 516 | (if (featurep 'emacs) |
| 517 | (if (eq 'up event-type) | 517 | (if (eq 'up event-type) |
| 518 | "mouse-2" "down-mouse-2") | 518 | "mouse-2" "down-mouse-2") |
| 519 | (if (eq 'up event-type) | 519 | (if (eq 'up event-type) |
| 520 | 'button2up 'button2))) | 520 | 'button2up 'button2))) |
| 521 | ((memq 3 key) | 521 | ((memq 3 key) |
| 522 | (if viper-emacs-p | 522 | (if (featurep 'emacs) |
| 523 | (if (eq 'up event-type) | 523 | (if (eq 'up event-type) |
| 524 | "mouse-3" "down-mouse-3") | 524 | "mouse-3" "down-mouse-3") |
| 525 | (if (eq 'up event-type) | 525 | (if (eq 'up event-type) |
| @@ -528,18 +528,18 @@ bindings in the Viper manual." | |||
| 528 | "%S: invalid button number, %S" key-var key))) | 528 | "%S: invalid button number, %S" key-var key))) |
| 529 | meta-spec | 529 | meta-spec |
| 530 | (if (memq 'meta key) | 530 | (if (memq 'meta key) |
| 531 | (if viper-emacs-p "M-" 'meta) | 531 | (if (featurep 'emacs) "M-" 'meta) |
| 532 | (if viper-emacs-p "" nil)) | 532 | (if (featurep 'emacs) "" nil)) |
| 533 | shift-spec | 533 | shift-spec |
| 534 | (if (memq 'shift key) | 534 | (if (memq 'shift key) |
| 535 | (if viper-emacs-p "S-" 'shift) | 535 | (if (featurep 'emacs) "S-" 'shift) |
| 536 | (if viper-emacs-p "" nil)) | 536 | (if (featurep 'emacs) "" nil)) |
| 537 | control-spec | 537 | control-spec |
| 538 | (if (memq 'control key) | 538 | (if (memq 'control key) |
| 539 | (if viper-emacs-p "C-" 'control) | 539 | (if (featurep 'emacs) "C-" 'control) |
| 540 | (if viper-emacs-p "" nil))) | 540 | (if (featurep 'emacs) "" nil))) |
| 541 | 541 | ||
| 542 | (setq key-spec (if viper-emacs-p | 542 | (setq key-spec (if (featurep 'emacs) |
| 543 | (vector | 543 | (vector |
| 544 | (intern | 544 | (intern |
| 545 | (concat | 545 | (concat |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 7073cd019dd..c757eb63aef 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -64,48 +64,34 @@ | |||
| 64 | (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p))) | 64 | (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p))) |
| 65 | 65 | ||
| 66 | 66 | ||
| 67 | ;;; XEmacs support | 67 | (defalias 'viper-overlay-p |
| 68 | 68 | (if (featurep 'xemacs) 'extentp 'overlayp)) | |
| 69 | 69 | (defalias 'viper-make-overlay | |
| 70 | (viper-cond-compile-for-xemacs-or-emacs | 70 | (if (featurep 'xemacs) 'make-extent 'make-overlay)) |
| 71 | (progn ; xemacs | 71 | (defalias 'viper-overlay-live-p |
| 72 | (fset 'viper-overlay-p (symbol-function 'extentp)) | 72 | (if (featurep 'xemacs) 'extent-live-p 'overlayp)) |
| 73 | (fset 'viper-make-overlay (symbol-function 'make-extent)) | 73 | (defalias 'viper-move-overlay |
| 74 | (fset 'viper-overlay-live-p (symbol-function 'extent-live-p)) | 74 | (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay)) |
| 75 | (fset 'viper-move-overlay (symbol-function 'set-extent-endpoints)) | 75 | (defalias 'viper-overlay-start |
| 76 | (fset 'viper-overlay-start (symbol-function 'extent-start-position)) | 76 | (if (featurep 'xemacs) 'extent-start-position 'overlay-start)) |
| 77 | (fset 'viper-overlay-end (symbol-function 'extent-end-position)) | 77 | (defalias 'viper-overlay-end |
| 78 | (fset 'viper-overlay-get (symbol-function 'extent-property)) | 78 | (if (featurep 'xemacs) 'extent-end-position 'overlay-end)) |
| 79 | (fset 'viper-overlay-put (symbol-function 'set-extent-property)) | 79 | (defalias 'viper-overlay-get |
| 80 | (fset 'viper-read-event (symbol-function 'next-command-event)) | 80 | (if (featurep 'xemacs) 'extent-property 'overlay-get)) |
| 81 | (fset 'viper-characterp (symbol-function 'characterp)) | 81 | (defalias 'viper-overlay-put |
| 82 | (fset 'viper-int-to-char (symbol-function 'int-to-char)) | 82 | (if (featurep 'xemacs) 'set-extent-property 'overlay-put)) |
| 83 | (if (viper-window-display-p) | 83 | (defalias 'viper-read-event |
| 84 | (fset 'viper-iconify (symbol-function 'iconify-frame))) | 84 | (if (featurep 'xemacs) 'next-command-event 'read-event)) |
| 85 | (cond ((viper-has-face-support-p) | 85 | (defalias 'viper-characterp |
| 86 | (fset 'viper-get-face (symbol-function 'get-face)) | 86 | (if (featurep 'xemacs) 'characterp 'integerp)) |
| 87 | (fset 'viper-color-defined-p (symbol-function 'valid-color-name-p)) | 87 | (defalias 'viper-int-to-char |
| 88 | ))) | 88 | (if (featurep 'xemacs) 'int-to-char 'identity)) |
| 89 | (progn ; emacs | 89 | (defalias 'viper-get-face |
| 90 | (fset 'viper-overlay-p (symbol-function 'overlayp)) | 90 | (if (featurep 'xemacs) 'get-face 'internal-get-face)) |
| 91 | (fset 'viper-make-overlay (symbol-function 'make-overlay)) | 91 | (defalias 'viper-color-defined-p |
| 92 | (fset 'viper-overlay-live-p (symbol-function 'overlayp)) | 92 | (if (featurep 'xemacs) 'valid-color-name-p 'x-color-defined-p)) |
| 93 | (fset 'viper-move-overlay (symbol-function 'move-overlay)) | 93 | (defalias 'viper-iconify |
| 94 | (fset 'viper-overlay-start (symbol-function 'overlay-start)) | 94 | (if (featurep 'xemacs) 'iconify-frame 'iconify-or-deiconify-frame)) |
| 95 | (fset 'viper-overlay-end (symbol-function 'overlay-end)) | ||
| 96 | (fset 'viper-overlay-get (symbol-function 'overlay-get)) | ||
| 97 | (fset 'viper-overlay-put (symbol-function 'overlay-put)) | ||
| 98 | (fset 'viper-read-event (symbol-function 'read-event)) | ||
| 99 | (fset 'viper-characterp (symbol-function 'integerp)) | ||
| 100 | (fset 'viper-int-to-char (symbol-function 'identity)) | ||
| 101 | (if (viper-window-display-p) | ||
| 102 | (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame))) | ||
| 103 | (cond ((viper-has-face-support-p) | ||
| 104 | (fset 'viper-get-face (symbol-function 'internal-get-face)) | ||
| 105 | (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p)) | ||
| 106 | ))) | ||
| 107 | ) | ||
| 108 | |||
| 109 | 95 | ||
| 110 | 96 | ||
| 111 | ;; CHAR is supposed to be a char or an integer (positive or negative) | 97 | ;; CHAR is supposed to be a char or an integer (positive or negative) |
| @@ -201,7 +187,7 @@ | |||
| 201 | (defsubst viper-get-saved-cursor-color-in-replace-mode () | 187 | (defsubst viper-get-saved-cursor-color-in-replace-mode () |
| 202 | (or | 188 | (or |
| 203 | (funcall | 189 | (funcall |
| 204 | (if viper-emacs-p 'frame-parameter 'frame-property) | 190 | (if (featurep 'emacs) 'frame-parameter 'frame-property) |
| 205 | (selected-frame) | 191 | (selected-frame) |
| 206 | 'viper-saved-cursor-color-in-replace-mode) | 192 | 'viper-saved-cursor-color-in-replace-mode) |
| 207 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) | 193 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) |
| @@ -211,7 +197,7 @@ | |||
| 211 | (defsubst viper-get-saved-cursor-color-in-insert-mode () | 197 | (defsubst viper-get-saved-cursor-color-in-insert-mode () |
| 212 | (or | 198 | (or |
| 213 | (funcall | 199 | (funcall |
| 214 | (if viper-emacs-p 'frame-parameter 'frame-property) | 200 | (if (featurep 'emacs) 'frame-parameter 'frame-property) |
| 215 | (selected-frame) | 201 | (selected-frame) |
| 216 | 'viper-saved-cursor-color-in-insert-mode) | 202 | 'viper-saved-cursor-color-in-insert-mode) |
| 217 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) | 203 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) |
| @@ -221,7 +207,7 @@ | |||
| 221 | (defsubst viper-get-saved-cursor-color-in-emacs-mode () | 207 | (defsubst viper-get-saved-cursor-color-in-emacs-mode () |
| 222 | (or | 208 | (or |
| 223 | (funcall | 209 | (funcall |
| 224 | (if viper-emacs-p 'frame-parameter 'frame-property) | 210 | (if (featurep 'emacs) 'frame-parameter 'frame-property) |
| 225 | (selected-frame) | 211 | (selected-frame) |
| 226 | 'viper-saved-cursor-color-in-emacs-mode) | 212 | 'viper-saved-cursor-color-in-emacs-mode) |
| 227 | viper-vi-state-cursor-color)) | 213 | viper-vi-state-cursor-color)) |
| @@ -249,8 +235,8 @@ | |||
| 249 | ;; testing for sufficiently high Emacs versions. | 235 | ;; testing for sufficiently high Emacs versions. |
| 250 | (defun viper-check-version (op major minor &optional type-of-emacs) | 236 | (defun viper-check-version (op major minor &optional type-of-emacs) |
| 251 | (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) | 237 | (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) |
| 252 | (and (cond ((eq type-of-emacs 'xemacs) viper-xemacs-p) | 238 | (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) |
| 253 | ((eq type-of-emacs 'emacs) viper-emacs-p) | 239 | ((eq type-of-emacs 'emacs) (featurep 'emacs)) |
| 254 | (t t)) | 240 | (t t)) |
| 255 | (cond ((eq op '=) (and (= emacs-minor-version minor) | 241 | (cond ((eq op '=) (and (= emacs-minor-version minor) |
| 256 | (= emacs-major-version major))) | 242 | (= emacs-major-version major))) |
| @@ -267,7 +253,7 @@ | |||
| 267 | 253 | ||
| 268 | 254 | ||
| 269 | (defun viper-get-visible-buffer-window (wind) | 255 | (defun viper-get-visible-buffer-window (wind) |
| 270 | (if viper-xemacs-p | 256 | (if (featurep 'xemacs) |
| 271 | (get-buffer-window wind t) | 257 | (get-buffer-window wind t) |
| 272 | (get-buffer-window wind 'visible))) | 258 | (get-buffer-window wind 'visible))) |
| 273 | 259 | ||
| @@ -724,13 +710,14 @@ | |||
| 724 | (defsubst viper-file-checked-in-p (file) | 710 | (defsubst viper-file-checked-in-p (file) |
| 725 | (and (featurep 'vc-hooks) | 711 | (and (featurep 'vc-hooks) |
| 726 | ;; CVS files are considered not checked in | 712 | ;; CVS files are considered not checked in |
| 713 | ;; FIXME: Should this deal with more than CVS? | ||
| 727 | (not (memq (vc-backend file) '(nil CVS))) | 714 | (not (memq (vc-backend file) '(nil CVS))) |
| 728 | (if (fboundp 'vc-state) | 715 | (if (fboundp 'vc-state) |
| 729 | (and | 716 | (and |
| 730 | (not (memq (vc-state file) '(edited needs-merge))) | 717 | (not (memq (vc-state file) '(edited needs-merge))) |
| 731 | (not (stringp (vc-state file)))) | 718 | (not (stringp (vc-state file)))) |
| 732 | ;; XEmacs has no vc-state | 719 | ;; XEmacs has no vc-state |
| 733 | (not (vc-locking-user file))) | 720 | (if (featurep 'xemacs)(not (vc-locking-user file)))) |
| 734 | )) | 721 | )) |
| 735 | 722 | ||
| 736 | ;; checkout if visited file is checked in | 723 | ;; checkout if visited file is checked in |
| @@ -787,7 +774,7 @@ | |||
| 787 | (setq viper-replace-overlay (viper-make-overlay beg end (current-buffer))) | 774 | (setq viper-replace-overlay (viper-make-overlay beg end (current-buffer))) |
| 788 | ;; never detach | 775 | ;; never detach |
| 789 | (viper-overlay-put | 776 | (viper-overlay-put |
| 790 | viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil) | 777 | viper-replace-overlay (if (featurep 'emacs) 'evaporate 'detachable) nil) |
| 791 | (viper-overlay-put | 778 | (viper-overlay-put |
| 792 | viper-replace-overlay 'priority viper-replace-overlay-priority) | 779 | viper-replace-overlay 'priority viper-replace-overlay-priority) |
| 793 | ;; If Emacs will start supporting overlay maps, as it currently supports | 780 | ;; If Emacs will start supporting overlay maps, as it currently supports |
| @@ -795,7 +782,7 @@ | |||
| 795 | ;; just have keymap attached to replace overlay. | 782 | ;; just have keymap attached to replace overlay. |
| 796 | ;;(viper-overlay-put | 783 | ;;(viper-overlay-put |
| 797 | ;; viper-replace-overlay | 784 | ;; viper-replace-overlay |
| 798 | ;; (if viper-xemacs-p 'keymap 'local-map) | 785 | ;; (if (featurep 'xemacs) 'keymap 'local-map) |
| 799 | ;; viper-replace-map) | 786 | ;; viper-replace-map) |
| 800 | ) | 787 | ) |
| 801 | (if (viper-has-face-support-p) | 788 | (if (viper-has-face-support-p) |
| @@ -811,8 +798,8 @@ | |||
| 811 | (viper-set-replace-overlay (point-min) (point-min))) | 798 | (viper-set-replace-overlay (point-min) (point-min))) |
| 812 | (if (or (not (viper-has-face-support-p)) | 799 | (if (or (not (viper-has-face-support-p)) |
| 813 | viper-use-replace-region-delimiters) | 800 | viper-use-replace-region-delimiters) |
| 814 | (let ((before-name (if viper-xemacs-p 'begin-glyph 'before-string)) | 801 | (let ((before-name (if (featurep 'xemacs) 'begin-glyph 'before-string)) |
| 815 | (after-name (if viper-xemacs-p 'end-glyph 'after-string))) | 802 | (after-name (if (featurep 'xemacs) 'end-glyph 'after-string))) |
| 816 | (viper-overlay-put viper-replace-overlay before-name before-glyph) | 803 | (viper-overlay-put viper-replace-overlay before-name before-glyph) |
| 817 | (viper-overlay-put viper-replace-overlay after-name after-glyph)))) | 804 | (viper-overlay-put viper-replace-overlay after-name after-glyph)))) |
| 818 | 805 | ||
| @@ -843,11 +830,11 @@ | |||
| 843 | ;; never detach | 830 | ;; never detach |
| 844 | (viper-overlay-put | 831 | (viper-overlay-put |
| 845 | viper-minibuffer-overlay | 832 | viper-minibuffer-overlay |
| 846 | (if viper-emacs-p 'evaporate 'detachable) | 833 | (if (featurep 'emacs) 'evaporate 'detachable) |
| 847 | nil) | 834 | nil) |
| 848 | ;; make viper-minibuffer-overlay open-ended | 835 | ;; make viper-minibuffer-overlay open-ended |
| 849 | ;; In emacs, it is made open ended at creation time | 836 | ;; In emacs, it is made open ended at creation time |
| 850 | (if viper-xemacs-p | 837 | (if (featurep 'xemacs) |
| 851 | (progn | 838 | (progn |
| 852 | (viper-overlay-put viper-minibuffer-overlay 'start-open nil) | 839 | (viper-overlay-put viper-minibuffer-overlay 'start-open nil) |
| 853 | (viper-overlay-put viper-minibuffer-overlay 'end-open nil))) | 840 | (viper-overlay-put viper-minibuffer-overlay 'end-open nil))) |
| @@ -860,7 +847,7 @@ | |||
| 860 | (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) | 847 | (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) |
| 861 | (1+ (buffer-size))) | 848 | (1+ (buffer-size))) |
| 862 | (setq viper-minibuffer-overlay | 849 | (setq viper-minibuffer-overlay |
| 863 | (if viper-xemacs-p | 850 | (if (featurep 'xemacs) |
| 864 | (viper-make-overlay 1 (1+ (buffer-size)) (current-buffer)) | 851 | (viper-make-overlay 1 (1+ (buffer-size)) (current-buffer)) |
| 865 | ;; make overlay open-ended | 852 | ;; make overlay open-ended |
| 866 | (viper-make-overlay | 853 | (viper-make-overlay |
| @@ -983,7 +970,7 @@ | |||
| 983 | (defun viper-read-key-sequence (prompt &optional continue-echo) | 970 | (defun viper-read-key-sequence (prompt &optional continue-echo) |
| 984 | (let (inhibit-quit event keyseq) | 971 | (let (inhibit-quit event keyseq) |
| 985 | (setq keyseq (read-key-sequence prompt continue-echo)) | 972 | (setq keyseq (read-key-sequence prompt continue-echo)) |
| 986 | (setq event (if viper-xemacs-p | 973 | (setq event (if (featurep 'xemacs) |
| 987 | (elt keyseq 0) ; XEmacs returns vector of events | 974 | (elt keyseq 0) ; XEmacs returns vector of events |
| 988 | (elt (listify-key-sequence keyseq) 0))) | 975 | (elt (listify-key-sequence keyseq) 0))) |
| 989 | (if (viper-ESC-event-p event) | 976 | (if (viper-ESC-event-p event) |
| @@ -1078,7 +1065,7 @@ | |||
| 1078 | 1065 | ||
| 1079 | (defun viper-key-to-emacs-key (key) | 1066 | (defun viper-key-to-emacs-key (key) |
| 1080 | (let (key-name char-p modifiers mod-char-list base-key base-key-name) | 1067 | (let (key-name char-p modifiers mod-char-list base-key base-key-name) |
| 1081 | (cond (viper-xemacs-p key) | 1068 | (cond ((featurep 'xemacs) key) |
| 1082 | 1069 | ||
| 1083 | ((symbolp key) | 1070 | ((symbolp key) |
| 1084 | (setq key-name (symbol-name key)) | 1071 | (setq key-name (symbol-name key)) |
| @@ -1086,10 +1073,10 @@ | |||
| 1086 | (string-to-char key-name)) | 1073 | (string-to-char key-name)) |
| 1087 | ;; Emacs doesn't recognize `return' and `escape' as events on | 1074 | ;; Emacs doesn't recognize `return' and `escape' as events on |
| 1088 | ;; dumb terminals, so we translate them into characters | 1075 | ;; dumb terminals, so we translate them into characters |
| 1089 | ((and viper-emacs-p (not (viper-window-display-p)) | 1076 | ((and (featurep 'emacs) (not (viper-window-display-p)) |
| 1090 | (string= key-name "return")) | 1077 | (string= key-name "return")) |
| 1091 | ?\C-m) | 1078 | ?\C-m) |
| 1092 | ((and viper-emacs-p (not (viper-window-display-p)) | 1079 | ((and (featurep 'emacs) (not (viper-window-display-p)) |
| 1093 | (string= key-name "escape")) | 1080 | (string= key-name "escape")) |
| 1094 | ?\e) | 1081 | ?\e) |
| 1095 | ;; pass symbol-event as is | 1082 | ;; pass symbol-event as is |
| @@ -1123,14 +1110,15 @@ | |||
| 1123 | 1110 | ||
| 1124 | ;; LIS is assumed to be a list of events of characters | 1111 | ;; LIS is assumed to be a list of events of characters |
| 1125 | (defun viper-eventify-list-xemacs (lis) | 1112 | (defun viper-eventify-list-xemacs (lis) |
| 1126 | (mapcar | 1113 | (if (featurep 'xemacs) |
| 1127 | (lambda (elt) | 1114 | (mapcar |
| 1128 | (cond ((viper-characterp elt) (character-to-event elt)) | 1115 | (lambda (elt) |
| 1129 | ((eventp elt) elt) | 1116 | (cond ((viper-characterp elt) (character-to-event elt)) |
| 1130 | (t (error | 1117 | ((eventp elt) elt) |
| 1131 | "viper-eventify-list-xemacs: can't convert to event, %S" | 1118 | (t (error |
| 1132 | elt)))) | 1119 | "viper-eventify-list-xemacs: can't convert to event, %S" |
| 1133 | lis)) | 1120 | elt)))) |
| 1121 | lis))) | ||
| 1134 | 1122 | ||
| 1135 | 1123 | ||
| 1136 | ;; Smoothes out the difference between Emacs' unread-command-events | 1124 | ;; Smoothes out the difference between Emacs' unread-command-events |
| @@ -1142,7 +1130,7 @@ | |||
| 1142 | ;; into an event. Below, we delete nil from event lists, since nil is the most | 1130 | ;; into an event. Below, we delete nil from event lists, since nil is the most |
| 1143 | ;; common symbol that might appear in this wrong context. | 1131 | ;; common symbol that might appear in this wrong context. |
| 1144 | (defun viper-set-unread-command-events (arg) | 1132 | (defun viper-set-unread-command-events (arg) |
| 1145 | (if viper-emacs-p | 1133 | (if (featurep 'emacs) |
| 1146 | (setq | 1134 | (setq |
| 1147 | unread-command-events | 1135 | unread-command-events |
| 1148 | (let ((new-events | 1136 | (let ((new-events |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index c0118250167..65d40e8bad7 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -690,7 +690,7 @@ It also can't undo some Viper settings." | |||
| 690 | (setq default-major-mode | 690 | (setq default-major-mode |
| 691 | (viper-standard-value 'default-major-mode viper-saved-non-viper-variables)) | 691 | (viper-standard-value 'default-major-mode viper-saved-non-viper-variables)) |
| 692 | 692 | ||
| 693 | (if viper-emacs-p | 693 | (if (featurep 'emacs) |
| 694 | (setq-default | 694 | (setq-default |
| 695 | mark-even-if-inactive | 695 | mark-even-if-inactive |
| 696 | (viper-standard-value | 696 | (viper-standard-value |
| @@ -701,7 +701,7 @@ It also can't undo some Viper settings." | |||
| 701 | (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) | 701 | (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) |
| 702 | (viper-delocalize-var 'minor-mode-map-alist)) | 702 | (viper-delocalize-var 'minor-mode-map-alist)) |
| 703 | (viper-delocalize-var 'require-final-newline) | 703 | (viper-delocalize-var 'require-final-newline) |
| 704 | (if viper-xemacs-p (viper-delocalize-var 'bar-cursor)) | 704 | (if (featurep 'xemacs) (viper-delocalize-var 'bar-cursor)) |
| 705 | 705 | ||
| 706 | 706 | ||
| 707 | ;; deactivate all advices done by Viper. | 707 | ;; deactivate all advices done by Viper. |
| @@ -788,7 +788,7 @@ It also can't undo some Viper settings." | |||
| 788 | ;; In emacs, we have to advice handle-switch-frame | 788 | ;; In emacs, we have to advice handle-switch-frame |
| 789 | ;; This advice is undone earlier, when all advices matchine "viper-" are | 789 | ;; This advice is undone earlier, when all advices matchine "viper-" are |
| 790 | ;; deactivated. | 790 | ;; deactivated. |
| 791 | (if viper-xemacs-p | 791 | (if (featurep 'xemacs) |
| 792 | (remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame)) | 792 | (remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame)) |
| 793 | ) ; end viper-go-away | 793 | ) ; end viper-go-away |
| 794 | 794 | ||
| @@ -981,7 +981,7 @@ It also can't undo some Viper settings." | |||
| 981 | ))) | 981 | ))) |
| 982 | 982 | ||
| 983 | ;; International input methods | 983 | ;; International input methods |
| 984 | (if viper-emacs-p | 984 | (if (featurep 'emacs) |
| 985 | (eval-after-load "mule-cmds" | 985 | (eval-after-load "mule-cmds" |
| 986 | '(progn | 986 | '(progn |
| 987 | (defadvice inactivate-input-method (after viper-mule-advice activate) | 987 | (defadvice inactivate-input-method (after viper-mule-advice activate) |
| @@ -1022,7 +1022,7 @@ It also can't undo some Viper settings." | |||
| 1022 | require-final-newline t) | 1022 | require-final-newline t) |
| 1023 | 1023 | ||
| 1024 | ;; don't bark when mark is inactive | 1024 | ;; don't bark when mark is inactive |
| 1025 | (if viper-emacs-p | 1025 | (if (featurep 'emacs) |
| 1026 | (setq mark-even-if-inactive t)) | 1026 | (setq mark-even-if-inactive t)) |
| 1027 | 1027 | ||
| 1028 | (setq scroll-step 1) | 1028 | (setq scroll-step 1) |
| @@ -1094,12 +1094,12 @@ It also can't undo some Viper settings." | |||
| 1094 | "Use `read-file-name' for reading arguments." | 1094 | "Use `read-file-name' for reading arguments." |
| 1095 | (interactive (cons (read-file-name "Find file: " nil default-directory) | 1095 | (interactive (cons (read-file-name "Find file: " nil default-directory) |
| 1096 | ;; XEmacs: if Mule & prefix arg, ask for coding system | 1096 | ;; XEmacs: if Mule & prefix arg, ask for coding system |
| 1097 | (cond ((and viper-xemacs-p (featurep 'mule)) | 1097 | (cond ((and (featurep 'xemacs) (featurep 'mule)) |
| 1098 | (list | 1098 | (list |
| 1099 | (and current-prefix-arg | 1099 | (and current-prefix-arg |
| 1100 | (read-coding-system "Coding-system: ")))) | 1100 | (read-coding-system "Coding-system: ")))) |
| 1101 | ;; Emacs: do wildcards | 1101 | ;; Emacs: do wildcards |
| 1102 | ((and viper-emacs-p (boundp 'find-file-wildcards)) | 1102 | ((and (featurep 'emacs) (boundp 'find-file-wildcards)) |
| 1103 | (list find-file-wildcards)))) | 1103 | (list find-file-wildcards)))) |
| 1104 | )) | 1104 | )) |
| 1105 | 1105 | ||
| @@ -1108,12 +1108,12 @@ It also can't undo some Viper settings." | |||
| 1108 | (interactive (cons (read-file-name "Find file in other window: " | 1108 | (interactive (cons (read-file-name "Find file in other window: " |
| 1109 | nil default-directory) | 1109 | nil default-directory) |
| 1110 | ;; XEmacs: if Mule & prefix arg, ask for coding system | 1110 | ;; XEmacs: if Mule & prefix arg, ask for coding system |
| 1111 | (cond ((and viper-xemacs-p (featurep 'mule)) | 1111 | (cond ((and (featurep 'xemacs) (featurep 'mule)) |
| 1112 | (list | 1112 | (list |
| 1113 | (and current-prefix-arg | 1113 | (and current-prefix-arg |
| 1114 | (read-coding-system "Coding-system: ")))) | 1114 | (read-coding-system "Coding-system: ")))) |
| 1115 | ;; Emacs: do wildcards | 1115 | ;; Emacs: do wildcards |
| 1116 | ((and viper-emacs-p (boundp 'find-file-wildcards)) | 1116 | ((and (featurep 'emacs) (boundp 'find-file-wildcards)) |
| 1117 | (list find-file-wildcards)))) | 1117 | (list find-file-wildcards)))) |
| 1118 | )) | 1118 | )) |
| 1119 | 1119 | ||
| @@ -1123,12 +1123,12 @@ It also can't undo some Viper settings." | |||
| 1123 | (interactive (cons (read-file-name "Find file in other frame: " | 1123 | (interactive (cons (read-file-name "Find file in other frame: " |
| 1124 | nil default-directory) | 1124 | nil default-directory) |
| 1125 | ;; XEmacs: if Mule & prefix arg, ask for coding system | 1125 | ;; XEmacs: if Mule & prefix arg, ask for coding system |
| 1126 | (cond ((and viper-xemacs-p (featurep 'mule)) | 1126 | (cond ((and (featurep 'xemacs) (featurep 'mule)) |
| 1127 | (list | 1127 | (list |
| 1128 | (and current-prefix-arg | 1128 | (and current-prefix-arg |
| 1129 | (read-coding-system "Coding-system: ")))) | 1129 | (read-coding-system "Coding-system: ")))) |
| 1130 | ;; Emacs: do wildcards | 1130 | ;; Emacs: do wildcards |
| 1131 | ((and viper-emacs-p (boundp 'find-file-wildcards)) | 1131 | ((and (featurep 'emacs) (boundp 'find-file-wildcards)) |
| 1132 | (list find-file-wildcards)))) | 1132 | (list find-file-wildcards)))) |
| 1133 | )) | 1133 | )) |
| 1134 | 1134 | ||
| @@ -1159,7 +1159,7 @@ It also can't undo some Viper settings." | |||
| 1159 | 1159 | ||
| 1160 | ;; catch frame switching event | 1160 | ;; catch frame switching event |
| 1161 | (if (viper-window-display-p) | 1161 | (if (viper-window-display-p) |
| 1162 | (if viper-xemacs-p | 1162 | (if (featurep 'xemacs) |
| 1163 | (add-hook 'mouse-leave-frame-hook | 1163 | (add-hook 'mouse-leave-frame-hook |
| 1164 | 'viper-remember-current-frame) | 1164 | 'viper-remember-current-frame) |
| 1165 | (defadvice handle-switch-frame (before viper-frame-advice activate) | 1165 | (defadvice handle-switch-frame (before viper-frame-advice activate) |
| @@ -1227,7 +1227,7 @@ These two lines must come in the order given. | |||
| 1227 | (cons 'mode-line-buffer-identification | 1227 | (cons 'mode-line-buffer-identification |
| 1228 | (list (default-value 'mode-line-buffer-identification))) | 1228 | (list (default-value 'mode-line-buffer-identification))) |
| 1229 | (cons 'global-mode-string (list global-mode-string)) | 1229 | (cons 'global-mode-string (list global-mode-string)) |
| 1230 | (if viper-emacs-p | 1230 | (if (featurep 'emacs) |
| 1231 | (cons 'mark-even-if-inactive (list mark-even-if-inactive))) | 1231 | (cons 'mark-even-if-inactive (list mark-even-if-inactive))) |
| 1232 | ))) | 1232 | ))) |
| 1233 | 1233 | ||