* 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.
This commit is contained in:
Dan Nicolaescu 2007-11-09 05:20:57 +00:00
parent 1da7a8c539
commit e83d1fe875
16 changed files with 230 additions and 193 deletions

View file

@ -834,7 +834,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
viper-emacs-kbd-minor-mode
ch)
(cond ((and viper-special-input-method
viper-emacs-p
(featurep 'emacs)
(fboundp 'quail-input-method))
;; (let ...) is used to restore unread-command-events to the
;; 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
(1- (length quail-current-str)))))
))
((and viper-special-input-method
viper-xemacs-p
(featurep 'xemacs)
(fboundp 'quail-start-translation))
;; same as above but for XEmacs, which doesn't have
;; quail-input-method
@ -893,7 +893,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
(t
;;(setq ch (read-char-exclusive))
(setq ch (aref (read-key-sequence nil) 0))
(if viper-xemacs-p
(if (featurep 'xemacs)
(setq ch (event-to-character ch)))
;; replace ^M with the newline
(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
(progn
;;(setq ch (read-char-exclusive))
(setq ch (aref (read-key-sequence nil) 0))
(if viper-xemacs-p
(if (featurep 'xemacs)
(setq ch (event-to-character ch))))
)
(insert ch))
)
(setq last-command-event
(viper-copy-event (if viper-xemacs-p
(viper-copy-event (if (featurep 'xemacs)
(character-to-event ch) ch)))
) ; let
(error nil)
@ -1080,10 +1080,10 @@ as a Meta key and any number of multiple escapes is allowed."
;; and return ESC as the key-sequence
(viper-set-unread-command-events (viper-subseq keyseq 1))
(setq last-input-event event
keyseq (if viper-emacs-p
keyseq (if (featurep 'emacs)
"\e"
(vector (character-to-event ?\e)))))
((and viper-xemacs-p
((and (featurep 'xemacs)
(key-press-event-p first-key)
(equal '(meta) key-mod))
(viper-set-unread-command-events
@ -1320,7 +1320,7 @@ as a Meta key and any number of multiple escapes is allowed."
(setq last-command-char char)
(setq last-command-event
(viper-copy-event
(if viper-xemacs-p (character-to-event char) char)))
(if (featurep 'xemacs) (character-to-event char) char)))
(condition-case err
(funcall cmd-to-exec-at-end cmd-info)
(error
@ -2791,7 +2791,7 @@ On reaching beginning of line, stop and signal error."
(defun viper-next-line-carefully (arg)
(condition-case nil
;; do not use forward-line! need to keep column
(next-line arg)
(with-no-warnings (next-line arg))
(error nil)))
@ -3091,7 +3091,7 @@ On reaching beginning of line, stop and signal error."
(com (viper-getCom arg)))
(if com (viper-move-marker-locally 'viper-com-point (point)))
;; do not use forward-line! need to keep column
(next-line val)
(with-no-warnings (next-line val))
(if viper-ex-style-motion
(if (and (eolp) (not (bolp))) (backward-char 1)))
(setq this-command 'next-line)
@ -3135,7 +3135,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
(com (viper-getCom arg)))
(if com (viper-move-marker-locally 'viper-com-point (point)))
;; do not use forward-line! need to keep column
(previous-line val)
(with-no-warnings (previous-line val))
(if viper-ex-style-motion
(if (and (eolp) (not (bolp))) (backward-char 1)))
(setq this-command 'previous-line)

View file

@ -1103,7 +1103,7 @@ reversed."
beg end cont val)
(viper-add-keymap ex-read-filename-map
(if viper-emacs-p
(if (featurep 'emacs)
minibuffer-local-completion-map
read-file-name-map))
@ -1558,7 +1558,7 @@ reversed."
;; setup buffer
(if (setq wind (viper-get-visible-buffer-window buf))
()
(setq wind (get-lru-window (if viper-xemacs-p nil 'visible)))
(setq wind (get-lru-window (if (featurep 'xemacs) nil 'visible)))
(set-window-buffer wind buf))
(if (viper-window-display-p)
@ -1878,7 +1878,7 @@ reversed."
(condition-case nil
(progn
(pop-to-buffer (get-buffer-create "*info*"))
(info (if viper-xemacs-p "viper.info" "viper"))
(info (if (featurep 'xemacs) "viper.info" "viper"))
(message "Type `i' to search for a specific topic"))
(error (beep 1)
(with-output-to-temp-buffer " *viper-info*"
@ -1887,7 +1887,7 @@ The Info file for Viper does not seem to be installed.
This file is part of the standard distribution of %sEmacs.
Please contact your system administrator. "
(if viper-xemacs-p "X" "")
(if (featurep 'xemacs) "X" "")
))))))
;; Ex source command. Loads the file specified as argument or `~/.viper'

View file

@ -49,10 +49,6 @@
(interactive)
(message "Viper version is %s" viper-version))
;; Is it XEmacs?
(defconst viper-xemacs-p (featurep 'xemacs))
;; Is it Emacs?
(defconst viper-emacs-p (not viper-xemacs-p))
;; Tell whether we are running as a window application or on a TTY
;; 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."
(cond ((viper-window-display-p))
(viper-force-faces)
((viper-color-display-p))
(viper-emacs-p (memq (viper-device-type) '(pc)))
(viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
((featurep 'emacs) (memq (viper-device-type) '(pc)))
((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
;;; Macros
@ -356,9 +352,9 @@ Use `M-x viper-set-expert-level' to change this.")
"")))))
(defun viper-inactivate-input-method ()
(cond ((and viper-emacs-p (fboundp 'inactivate-input-method))
(cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method))
(inactivate-input-method))
((and viper-xemacs-p (boundp 'current-input-method))
((and (featurep 'xemacs) (boundp 'current-input-method))
;; XEmacs had broken quil-mode for some time, so we are working around
;; it here
(setq quail-mode nil)
@ -370,7 +366,7 @@ Use `M-x viper-set-expert-level' to change this.")
(force-mode-line-update))
))
(defun viper-activate-input-method ()
(cond ((and viper-emacs-p (fboundp 'activate-input-method))
(cond ((and (featurep 'emacs) (fboundp 'activate-input-method))
(activate-input-method default-input-method))
((featurep 'xemacs)
(if (fboundp 'quail-mode) (quail-mode 1)))))
@ -475,7 +471,7 @@ is non-nil."
:group 'viper)
(defcustom viper-use-replace-region-delimiters
(or (not (viper-has-face-support-p))
(and viper-xemacs-p (eq (viper-device-type) 'tty)))
(and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
"*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
`viper-replace-region-start-delimiter' to delimit replacement regions, even on
color displays. By default, the delimiters are used only on TTYs."
@ -1018,13 +1014,13 @@ Should be set in `~/.viper' file."
(defun viper-restore-cursor-type ()
(condition-case nil
(if viper-xemacs-p
(if (featurep 'xemacs)
(set (make-local-variable 'bar-cursor) nil)
(setq cursor-type default-cursor-type))
(error nil)))
(defun viper-set-insert-cursor-type ()
(if viper-xemacs-p
(if (featurep 'xemacs)
(set (make-local-variable 'bar-cursor) 2)
(setq cursor-type '(bar . 2))))

View file

@ -826,7 +826,7 @@ name from there."
(defun viper-char-array-to-macro (array)
(let ((vec (vconcat array))
macro)
(if viper-xemacs-p
(if (featurep 'xemacs)
(setq macro (mapcar 'character-to-event vec))
(setq macro vec))
(vconcat (mapcar 'viper-event-key macro))))

View file

@ -79,7 +79,7 @@ or a tripple-click."
;; time interval in millisecond within which successive clicks are
;; considered related
(defcustom viper-multiclick-timeout (if (viper-window-display-p)
(if viper-xemacs-p
(if (featurep 'xemacs)
mouse-track-multi-click-time
double-click-time)
500)
@ -227,7 +227,7 @@ is ignored."
) ; if
;; XEmacs doesn't have set-text-properties, but there buffer-substring
;; doesn't return properties together with the string, so it's not needed.
(if viper-emacs-p
(if (featurep 'emacs)
(set-text-properties 0 (length result) nil result))
result
))
@ -273,7 +273,7 @@ See `viper-surrounding-word' for the definition of a word in this case."
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-insert-key-parsed)
'viper-mouse-click-insert-word))
(and viper-xemacs-p (not (event-over-text-area-p click)))))
(and (featurep 'xemacs) (not (event-over-text-area-p click)))))
() ; do nothing, if binding isn't right or not over text
;; turn arg into a number
(cond ((integerp arg) nil)
@ -364,7 +364,7 @@ this command."
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-search-key-parsed)
'viper-mouse-click-search-word))
(and viper-xemacs-p (not (event-over-text-area-p click)))))
(and (featurep 'xemacs) (not (event-over-text-area-p click)))))
() ; do nothing, if binding isn't right or not over text
(let ((previous-search-string viper-s-string)
click-word click-count)
@ -507,19 +507,19 @@ bindings in the Viper manual."
()
(setq button-spec
(cond ((memq 1 key)
(if viper-emacs-p
(if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-1" "down-mouse-1")
(if (eq 'up event-type)
'button1up 'button1)))
((memq 2 key)
(if viper-emacs-p
(if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-2" "down-mouse-2")
(if (eq 'up event-type)
'button2up 'button2)))
((memq 3 key)
(if viper-emacs-p
(if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-3" "down-mouse-3")
(if (eq 'up event-type)
@ -528,18 +528,18 @@ bindings in the Viper manual."
"%S: invalid button number, %S" key-var key)))
meta-spec
(if (memq 'meta key)
(if viper-emacs-p "M-" 'meta)
(if viper-emacs-p "" nil))
(if (featurep 'emacs) "M-" 'meta)
(if (featurep 'emacs) "" nil))
shift-spec
(if (memq 'shift key)
(if viper-emacs-p "S-" 'shift)
(if viper-emacs-p "" nil))
(if (featurep 'emacs) "S-" 'shift)
(if (featurep 'emacs) "" nil))
control-spec
(if (memq 'control key)
(if viper-emacs-p "C-" 'control)
(if viper-emacs-p "" nil)))
(if (featurep 'emacs) "C-" 'control)
(if (featurep 'emacs) "" nil)))
(setq key-spec (if viper-emacs-p
(setq key-spec (if (featurep 'emacs)
(vector
(intern
(concat

View file

@ -64,48 +64,34 @@
(fset 'x-color-defined-p (symbol-function 'ns-color-defined-p)))
;;; XEmacs support
(viper-cond-compile-for-xemacs-or-emacs
(progn ; xemacs
(fset 'viper-overlay-p (symbol-function 'extentp))
(fset 'viper-make-overlay (symbol-function 'make-extent))
(fset 'viper-overlay-live-p (symbol-function 'extent-live-p))
(fset 'viper-move-overlay (symbol-function 'set-extent-endpoints))
(fset 'viper-overlay-start (symbol-function 'extent-start-position))
(fset 'viper-overlay-end (symbol-function 'extent-end-position))
(fset 'viper-overlay-get (symbol-function 'extent-property))
(fset 'viper-overlay-put (symbol-function 'set-extent-property))
(fset 'viper-read-event (symbol-function 'next-command-event))
(fset 'viper-characterp (symbol-function 'characterp))
(fset 'viper-int-to-char (symbol-function 'int-to-char))
(if (viper-window-display-p)
(fset 'viper-iconify (symbol-function 'iconify-frame)))
(cond ((viper-has-face-support-p)
(fset 'viper-get-face (symbol-function 'get-face))
(fset 'viper-color-defined-p (symbol-function 'valid-color-name-p))
)))
(progn ; emacs
(fset 'viper-overlay-p (symbol-function 'overlayp))
(fset 'viper-make-overlay (symbol-function 'make-overlay))
(fset 'viper-overlay-live-p (symbol-function 'overlayp))
(fset 'viper-move-overlay (symbol-function 'move-overlay))
(fset 'viper-overlay-start (symbol-function 'overlay-start))
(fset 'viper-overlay-end (symbol-function 'overlay-end))
(fset 'viper-overlay-get (symbol-function 'overlay-get))
(fset 'viper-overlay-put (symbol-function 'overlay-put))
(fset 'viper-read-event (symbol-function 'read-event))
(fset 'viper-characterp (symbol-function 'integerp))
(fset 'viper-int-to-char (symbol-function 'identity))
(if (viper-window-display-p)
(fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
(cond ((viper-has-face-support-p)
(fset 'viper-get-face (symbol-function 'internal-get-face))
(fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
)))
)
(defalias 'viper-overlay-p
(if (featurep 'xemacs) 'extentp 'overlayp))
(defalias 'viper-make-overlay
(if (featurep 'xemacs) 'make-extent 'make-overlay))
(defalias 'viper-overlay-live-p
(if (featurep 'xemacs) 'extent-live-p 'overlayp))
(defalias 'viper-move-overlay
(if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay))
(defalias 'viper-overlay-start
(if (featurep 'xemacs) 'extent-start-position 'overlay-start))
(defalias 'viper-overlay-end
(if (featurep 'xemacs) 'extent-end-position 'overlay-end))
(defalias 'viper-overlay-get
(if (featurep 'xemacs) 'extent-property 'overlay-get))
(defalias 'viper-overlay-put
(if (featurep 'xemacs) 'set-extent-property 'overlay-put))
(defalias 'viper-read-event
(if (featurep 'xemacs) 'next-command-event 'read-event))
(defalias 'viper-characterp
(if (featurep 'xemacs) 'characterp 'integerp))
(defalias 'viper-int-to-char
(if (featurep 'xemacs) 'int-to-char 'identity))
(defalias 'viper-get-face
(if (featurep 'xemacs) 'get-face 'internal-get-face))
(defalias 'viper-color-defined-p
(if (featurep 'xemacs) 'valid-color-name-p 'x-color-defined-p))
(defalias 'viper-iconify
(if (featurep 'xemacs) 'iconify-frame 'iconify-or-deiconify-frame))
;; CHAR is supposed to be a char or an integer (positive or negative)
@ -201,7 +187,7 @@
(defsubst viper-get-saved-cursor-color-in-replace-mode ()
(or
(funcall
(if viper-emacs-p 'frame-parameter 'frame-property)
(if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-replace-mode)
(if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
@ -211,7 +197,7 @@
(defsubst viper-get-saved-cursor-color-in-insert-mode ()
(or
(funcall
(if viper-emacs-p 'frame-parameter 'frame-property)
(if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-insert-mode)
(if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
@ -221,7 +207,7 @@
(defsubst viper-get-saved-cursor-color-in-emacs-mode ()
(or
(funcall
(if viper-emacs-p 'frame-parameter 'frame-property)
(if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-emacs-mode)
viper-vi-state-cursor-color))
@ -249,8 +235,8 @@
;; testing for sufficiently high Emacs versions.
(defun viper-check-version (op major minor &optional type-of-emacs)
(if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version))
(and (cond ((eq type-of-emacs 'xemacs) viper-xemacs-p)
((eq type-of-emacs 'emacs) viper-emacs-p)
(and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
((eq type-of-emacs 'emacs) (featurep 'emacs))
(t t))
(cond ((eq op '=) (and (= emacs-minor-version minor)
(= emacs-major-version major)))
@ -267,7 +253,7 @@
(defun viper-get-visible-buffer-window (wind)
(if viper-xemacs-p
(if (featurep 'xemacs)
(get-buffer-window wind t)
(get-buffer-window wind 'visible)))
@ -724,13 +710,14 @@
(defsubst viper-file-checked-in-p (file)
(and (featurep 'vc-hooks)
;; CVS files are considered not checked in
;; FIXME: Should this deal with more than CVS?
(not (memq (vc-backend file) '(nil CVS)))
(if (fboundp 'vc-state)
(and
(not (memq (vc-state file) '(edited needs-merge)))
(not (stringp (vc-state file))))
;; XEmacs has no vc-state
(not (vc-locking-user file)))
(if (featurep 'xemacs)(not (vc-locking-user file))))
))
;; checkout if visited file is checked in
@ -787,7 +774,7 @@
(setq viper-replace-overlay (viper-make-overlay beg end (current-buffer)))
;; never detach
(viper-overlay-put
viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil)
viper-replace-overlay (if (featurep 'emacs) 'evaporate 'detachable) nil)
(viper-overlay-put
viper-replace-overlay 'priority viper-replace-overlay-priority)
;; If Emacs will start supporting overlay maps, as it currently supports
@ -795,7 +782,7 @@
;; just have keymap attached to replace overlay.
;;(viper-overlay-put
;; viper-replace-overlay
;; (if viper-xemacs-p 'keymap 'local-map)
;; (if (featurep 'xemacs) 'keymap 'local-map)
;; viper-replace-map)
)
(if (viper-has-face-support-p)
@ -811,8 +798,8 @@
(viper-set-replace-overlay (point-min) (point-min)))
(if (or (not (viper-has-face-support-p))
viper-use-replace-region-delimiters)
(let ((before-name (if viper-xemacs-p 'begin-glyph 'before-string))
(after-name (if viper-xemacs-p 'end-glyph 'after-string)))
(let ((before-name (if (featurep 'xemacs) 'begin-glyph 'before-string))
(after-name (if (featurep 'xemacs) 'end-glyph 'after-string)))
(viper-overlay-put viper-replace-overlay before-name before-glyph)
(viper-overlay-put viper-replace-overlay after-name after-glyph))))
@ -843,11 +830,11 @@
;; never detach
(viper-overlay-put
viper-minibuffer-overlay
(if viper-emacs-p 'evaporate 'detachable)
(if (featurep 'emacs) 'evaporate 'detachable)
nil)
;; make viper-minibuffer-overlay open-ended
;; In emacs, it is made open ended at creation time
(if viper-xemacs-p
(if (featurep 'xemacs)
(progn
(viper-overlay-put viper-minibuffer-overlay 'start-open nil)
(viper-overlay-put viper-minibuffer-overlay 'end-open nil)))
@ -860,7 +847,7 @@
(if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1)
(1+ (buffer-size)))
(setq viper-minibuffer-overlay
(if viper-xemacs-p
(if (featurep 'xemacs)
(viper-make-overlay 1 (1+ (buffer-size)) (current-buffer))
;; make overlay open-ended
(viper-make-overlay
@ -983,7 +970,7 @@
(defun viper-read-key-sequence (prompt &optional continue-echo)
(let (inhibit-quit event keyseq)
(setq keyseq (read-key-sequence prompt continue-echo))
(setq event (if viper-xemacs-p
(setq event (if (featurep 'xemacs)
(elt keyseq 0) ; XEmacs returns vector of events
(elt (listify-key-sequence keyseq) 0)))
(if (viper-ESC-event-p event)
@ -1078,7 +1065,7 @@
(defun viper-key-to-emacs-key (key)
(let (key-name char-p modifiers mod-char-list base-key base-key-name)
(cond (viper-xemacs-p key)
(cond ((featurep 'xemacs) key)
((symbolp key)
(setq key-name (symbol-name key))
@ -1086,10 +1073,10 @@
(string-to-char key-name))
;; Emacs doesn't recognize `return' and `escape' as events on
;; dumb terminals, so we translate them into characters
((and viper-emacs-p (not (viper-window-display-p))
((and (featurep 'emacs) (not (viper-window-display-p))
(string= key-name "return"))
?\C-m)
((and viper-emacs-p (not (viper-window-display-p))
((and (featurep 'emacs) (not (viper-window-display-p))
(string= key-name "escape"))
?\e)
;; pass symbol-event as is
@ -1123,14 +1110,15 @@
;; LIS is assumed to be a list of events of characters
(defun viper-eventify-list-xemacs (lis)
(mapcar
(lambda (elt)
(cond ((viper-characterp elt) (character-to-event elt))
((eventp elt) elt)
(t (error
"viper-eventify-list-xemacs: can't convert to event, %S"
elt))))
lis))
(if (featurep 'xemacs)
(mapcar
(lambda (elt)
(cond ((viper-characterp elt) (character-to-event elt))
((eventp elt) elt)
(t (error
"viper-eventify-list-xemacs: can't convert to event, %S"
elt))))
lis)))
;; Smoothes out the difference between Emacs' unread-command-events
@ -1142,7 +1130,7 @@
;; into an event. Below, we delete nil from event lists, since nil is the most
;; common symbol that might appear in this wrong context.
(defun viper-set-unread-command-events (arg)
(if viper-emacs-p
(if (featurep 'emacs)
(setq
unread-command-events
(let ((new-events

View file

@ -690,7 +690,7 @@ It also can't undo some Viper settings."
(setq default-major-mode
(viper-standard-value 'default-major-mode viper-saved-non-viper-variables))
(if viper-emacs-p
(if (featurep 'emacs)
(setq-default
mark-even-if-inactive
(viper-standard-value
@ -701,7 +701,7 @@ It also can't undo some Viper settings."
(and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
(viper-delocalize-var 'minor-mode-map-alist))
(viper-delocalize-var 'require-final-newline)
(if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
(if (featurep 'xemacs) (viper-delocalize-var 'bar-cursor))
;; deactivate all advices done by Viper.
@ -788,7 +788,7 @@ It also can't undo some Viper settings."
;; In emacs, we have to advice handle-switch-frame
;; This advice is undone earlier, when all advices matchine "viper-" are
;; deactivated.
(if viper-xemacs-p
(if (featurep 'xemacs)
(remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame))
) ; end viper-go-away
@ -981,7 +981,7 @@ It also can't undo some Viper settings."
)))
;; International input methods
(if viper-emacs-p
(if (featurep 'emacs)
(eval-after-load "mule-cmds"
'(progn
(defadvice inactivate-input-method (after viper-mule-advice activate)
@ -1022,7 +1022,7 @@ It also can't undo some Viper settings."
require-final-newline t)
;; don't bark when mark is inactive
(if viper-emacs-p
(if (featurep 'emacs)
(setq mark-even-if-inactive t))
(setq scroll-step 1)
@ -1094,12 +1094,12 @@ It also can't undo some Viper settings."
"Use `read-file-name' for reading arguments."
(interactive (cons (read-file-name "Find file: " nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
(cond ((and viper-xemacs-p (featurep 'mule))
(cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
((and viper-emacs-p (boundp 'find-file-wildcards))
((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@ -1108,12 +1108,12 @@ It also can't undo some Viper settings."
(interactive (cons (read-file-name "Find file in other window: "
nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
(cond ((and viper-xemacs-p (featurep 'mule))
(cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
((and viper-emacs-p (boundp 'find-file-wildcards))
((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@ -1123,12 +1123,12 @@ It also can't undo some Viper settings."
(interactive (cons (read-file-name "Find file in other frame: "
nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
(cond ((and viper-xemacs-p (featurep 'mule))
(cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
((and viper-emacs-p (boundp 'find-file-wildcards))
((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@ -1159,7 +1159,7 @@ It also can't undo some Viper settings."
;; catch frame switching event
(if (viper-window-display-p)
(if viper-xemacs-p
(if (featurep 'xemacs)
(add-hook 'mouse-leave-frame-hook
'viper-remember-current-frame)
(defadvice handle-switch-frame (before viper-frame-advice activate)
@ -1227,7 +1227,7 @@ These two lines must come in the order given.
(cons 'mode-line-buffer-identification
(list (default-value 'mode-line-buffer-identification)))
(cons 'global-mode-string (list global-mode-string))
(if viper-emacs-p
(if (featurep 'emacs)
(cons 'mark-even-if-inactive (list mark-even-if-inactive)))
)))