aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-04 14:29:58 +0200
committerLars Ingebrigtsen2019-10-04 14:30:21 +0200
commit07959a0ffbb585931d1d62c266e83d79931cc561 (patch)
tree3e9fd269fd13b994e1213423e8684d28163fdae6
parent7174a2b59f4cb883beb70bb3d182d59ab425e2f1 (diff)
downloademacs-07959a0ffbb585931d1d62c266e83d79931cc561.tar.gz
emacs-07959a0ffbb585931d1d62c266e83d79931cc561.zip
Remove more XEmacs compat code from viper-*.el
* lisp/emulation/viper-cmd.el (viper-special-read-and-insert-char) (viper-next-line-carefully, viper-next-line) (viper-previous-line): Ditto. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-parse-mouse-key): Remove XEmacs compat code.
-rw-r--r--lisp/emulation/viper-cmd.el16
-rw-r--r--lisp/emulation/viper-mous.el56
2 files changed, 22 insertions, 50 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index bdb205ce7c8..f193c4273b2 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -789,7 +789,6 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
789 viper-emacs-kbd-minor-mode 789 viper-emacs-kbd-minor-mode
790 ch) 790 ch)
791 (cond ((and viper-special-input-method 791 (cond ((and viper-special-input-method
792 (featurep 'emacs)
793 (fboundp 'quail-input-method)) 792 (fboundp 'quail-input-method))
794 ;; (let ...) is used to restore unread-command-events to the 793 ;; (let ...) is used to restore unread-command-events to the
795 ;; original state. We don't want anything left in there after 794 ;; original state. We don't want anything left in there after
@@ -2594,9 +2593,8 @@ On reaching beginning of line, stop and signal error."
2594 (condition-case nil 2593 (condition-case nil
2595 ;; do not use forward-line! need to keep column 2594 ;; do not use forward-line! need to keep column
2596 (let ((line-move-visual nil)) 2595 (let ((line-move-visual nil))
2597 (if (featurep 'emacs) 2596 (with-no-warnings
2598 (with-no-warnings (next-line arg)) 2597 (next-line arg)))
2599 (next-line arg)))
2600 (error nil))) 2598 (error nil)))
2601 2599
2602 2600
@@ -2886,9 +2884,8 @@ On reaching beginning of line, stop and signal error."
2886 (if com (viper-move-marker-locally 'viper-com-point (point))) 2884 (if com (viper-move-marker-locally 'viper-com-point (point)))
2887 ;; do not use forward-line! need to keep column 2885 ;; do not use forward-line! need to keep column
2888 (let ((line-move-visual nil)) 2886 (let ((line-move-visual nil))
2889 (if (featurep 'emacs) 2887 (with-no-warnings
2890 (with-no-warnings (next-line val)) 2888 (next-line val)))
2891 (next-line val)))
2892 (if viper-ex-style-motion 2889 (if viper-ex-style-motion
2893 (if (and (eolp) (not (bolp))) (backward-char 1))) 2890 (if (and (eolp) (not (bolp))) (backward-char 1)))
2894 (setq this-command 'next-line) 2891 (setq this-command 'next-line)
@@ -2934,9 +2931,8 @@ If point is on a widget or a button, simulate clicking on that widget/button."
2934 (if com (viper-move-marker-locally 'viper-com-point (point))) 2931 (if com (viper-move-marker-locally 'viper-com-point (point)))
2935 ;; do not use forward-line! need to keep column 2932 ;; do not use forward-line! need to keep column
2936 (let ((line-move-visual nil)) 2933 (let ((line-move-visual nil))
2937 (if (featurep 'emacs) 2934 (with-no-warnings
2938 (with-no-warnings (previous-line val)) 2935 (previous-line val)))
2939 (previous-line val)))
2940 (if viper-ex-style-motion 2936 (if viper-ex-style-motion
2941 (if (and (eolp) (not (bolp))) (backward-char 1))) 2937 (if (and (eolp) (not (bolp))) (backward-char 1)))
2942 (setq this-command 'previous-line) 2938 (setq this-command 'previous-line)
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index e1f7c1643bd..e076e988866 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -214,10 +214,8 @@ is ignored."
214 ) ; if 214 ) ; if
215 ;; XEmacs doesn't have set-text-properties, but there buffer-substring 215 ;; XEmacs doesn't have set-text-properties, but there buffer-substring
216 ;; doesn't return properties together with the string, so it's not needed. 216 ;; doesn't return properties together with the string, so it's not needed.
217 (if (featurep 'emacs) 217 (set-text-properties 0 (length result) nil result)
218 (set-text-properties 0 (length result) nil result)) 218 result))
219 result
220 ))
221 219
222 220
223(defun viper-mouse-click-get-word (click count click-count) 221(defun viper-mouse-click-get-word (click count click-count)
@@ -493,49 +491,27 @@ bindings in the Viper manual."
493 () 491 ()
494 (setq button-spec 492 (setq button-spec
495 (cond ((memq 1 key) 493 (cond ((memq 1 key)
496 (if (featurep 'emacs) 494 (if (eq 'up event-type)
497 (if (eq 'up event-type) 495 "mouse-1" "down-mouse-1"))
498 "mouse-1" "down-mouse-1")
499 (if (eq 'up event-type)
500 'button1up 'button1)))
501 ((memq 2 key) 496 ((memq 2 key)
502 (if (featurep 'emacs) 497 (if (eq 'up event-type)
503 (if (eq 'up event-type) 498 "mouse-2" "down-mouse-2"))
504 "mouse-2" "down-mouse-2")
505 (if (eq 'up event-type)
506 'button2up 'button2)))
507 ((memq 3 key) 499 ((memq 3 key)
508 (if (featurep 'emacs) 500 (if (eq 'up event-type)
509 (if (eq 'up event-type) 501 "mouse-3" "down-mouse-3"))
510 "mouse-3" "down-mouse-3")
511 (if (eq 'up event-type)
512 'button3up 'button3)))
513 (t (error 502 (t (error
514 "%S: invalid button number, %S" key-var key))) 503 "%S: invalid button number, %S" key-var key)))
515 meta-spec 504 meta-spec
516 (if (memq 'meta key) 505 (if (memq 'meta key) "M-" "")
517 (if (featurep 'emacs) "M-" 'meta)
518 (if (featurep 'emacs) "" nil))
519 shift-spec 506 shift-spec
520 (if (memq 'shift key) 507 (if (memq 'shift key) "S-" "")
521 (if (featurep 'emacs) "S-" 'shift)
522 (if (featurep 'emacs) "" nil))
523 control-spec 508 control-spec
524 (if (memq 'control key) 509 (if (memq 'control key) "C-" ""))
525 (if (featurep 'emacs) "C-" 'control) 510
526 (if (featurep 'emacs) "" nil))) 511 (setq key-spec
527 512 (vector
528 (setq key-spec (if (featurep 'emacs) 513 (intern (concat control-spec meta-spec
529 (vector 514 shift-spec button-spec)))))))
530 (intern
531 (concat
532 control-spec meta-spec shift-spec button-spec)))
533 (vector
534 (delq
535 nil
536 (list
537 control-spec meta-spec shift-spec button-spec)))))
538 )))
539 515
540(defun viper-unbind-mouse-search-key () 516(defun viper-unbind-mouse-search-key ()
541 (if viper-mouse-up-search-key-parsed 517 (if viper-mouse-up-search-key-parsed