diff options
| author | Michael Kifer | 2009-11-22 03:14:14 +0000 |
|---|---|---|
| committer | Michael Kifer | 2009-11-22 03:14:14 +0000 |
| commit | 433d9ace74fbd35205c06bcef487bd3e5d41e6bb (patch) | |
| tree | a7d85bd9038bbc883093b9a830980723b4639b03 | |
| parent | 5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076 (diff) | |
| download | emacs-433d9ace74fbd35205c06bcef487bd3e5d41e6bb.tar.gz emacs-433d9ace74fbd35205c06bcef487bd3e5d41e6bb.zip | |
2009-11-22 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-cmd.el: use viper-last-command-char instead of
last-command-char/last-command-event.
(viper-prefix-arg-value): do correct conversion of event-char for
XEmacs.
* viper-util.el, viper.el: use viper-last-command-char instead of
last-command-char/last-command-event.
* ediff-init.el, ediff-mult.el, ediff-util.el: relpace
last-command-char and last-command-event with (ediff-last-command-char) everywhere.
* ediff-vers.el (ediff-rcs-get-output-buffer): make sure the buffer is
created in fundamental mode.
* ediff.el (ediff-version): revert the change of interactive-p to
called-interactively-p.
| -rw-r--r-- | doc/misc/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/ediff-init.el | 3 | ||||
| -rw-r--r-- | lisp/ediff-mult.el | 4 | ||||
| -rw-r--r-- | lisp/ediff-util.el | 26 | ||||
| -rw-r--r-- | lisp/ediff-vers.el | 3 | ||||
| -rw-r--r-- | lisp/ediff.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 27 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 11 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 5 |
9 files changed, 74 insertions, 28 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 8d5dcc09a0b..00038eec491 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2009-11-22 Michael Kifer <kifer@cs.stonybrook.edu> | ||
| 2 | |||
| 3 | * viper-cmd.el: use viper-last-command-char instead of | ||
| 4 | last-command-char/last-command-event. | ||
| 5 | (viper-prefix-arg-value): do correct conversion of event-char for | ||
| 6 | XEmacs. | ||
| 7 | |||
| 8 | * viper-util.el, viper.el: use viper-last-command-char instead of | ||
| 9 | last-command-char/last-command-event. | ||
| 10 | |||
| 11 | * ediff-init.el, ediff-mult.el, ediff-util.el: relpace | ||
| 12 | last-command-char and last-command-event with (ediff-last-command-char) everywhere. | ||
| 13 | |||
| 14 | * ediff-vers.el (ediff-rcs-get-output-buffer): make sure the buffer is | ||
| 15 | created in fundamental mode. | ||
| 16 | |||
| 17 | * ediff.el (ediff-version): revert the change of interactive-p to | ||
| 18 | called-interactively-p. | ||
| 19 | |||
| 1 | 2009-11-22 Jay Belanger <jay.p.belanger@gmail.com> | 20 | 2009-11-22 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 21 | ||
| 3 | * calc.texi (Radix modes): Discuss alternate bases for two's complement | 22 | * calc.texi (Radix modes): Discuss alternate bases for two's complement |
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index d58008f9d12..09c62df631d 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el | |||
| @@ -1551,6 +1551,9 @@ This default should work without changes." | |||
| 1551 | (if (eventp event-or-key) (event-key event-or-key) event-or-key) | 1551 | (if (eventp event-or-key) (event-key event-or-key) event-or-key) |
| 1552 | event-or-key)) | 1552 | event-or-key)) |
| 1553 | 1553 | ||
| 1554 | (defun ediff-last-command-char () | ||
| 1555 | (ediff-event-key last-command-event)) | ||
| 1556 | |||
| 1554 | 1557 | ||
| 1555 | (defsubst ediff-frame-iconified-p (frame) | 1558 | (defsubst ediff-frame-iconified-p (frame) |
| 1556 | (and (ediff-window-display-p) (frame-live-p frame) | 1559 | (and (ediff-window-display-p) (frame-live-p frame) |
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index a1dfbded153..f2365f53060 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el | |||
| @@ -2342,10 +2342,10 @@ If this is a session registry buffer then just bury it." | |||
| 2342 | This is used only for sessions that involve 2 or 3 files at the same time. | 2342 | This is used only for sessions that involve 2 or 3 files at the same time. |
| 2343 | ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark | 2343 | ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark |
| 2344 | for operation, or simply indicate which are equal files. If it is nil, then | 2344 | for operation, or simply indicate which are equal files. If it is nil, then |
| 2345 | `last-command-event' is used to decide which action to take." | 2345 | `(ediff-last-command-char)' is used to decide which action to take." |
| 2346 | (interactive) | 2346 | (interactive) |
| 2347 | (if (null action) | 2347 | (if (null action) |
| 2348 | (setq action last-command-event)) | 2348 | (setq action (ediff-last-command-char))) |
| 2349 | (let ((list (cdr ediff-meta-list)) | 2349 | (let ((list (cdr ediff-meta-list)) |
| 2350 | marked1 marked2 marked3 | 2350 | marked1 marked2 marked3 |
| 2351 | fileinfo1 fileinfo2 fileinfo3 elt) | 2351 | fileinfo1 fileinfo2 fileinfo3 elt) |
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index a6247395eff..ea12ef7532a 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el | |||
| @@ -1011,7 +1011,7 @@ of the current buffer." | |||
| 1011 | (interactive) | 1011 | (interactive) |
| 1012 | (ediff-barf-if-not-control-buffer) | 1012 | (ediff-barf-if-not-control-buffer) |
| 1013 | (let ((ctl-buf (if (null buf) (current-buffer))) | 1013 | (let ((ctl-buf (if (null buf) (current-buffer))) |
| 1014 | (buf-type (ediff-char-to-buftype last-command-event))) | 1014 | (buf-type (ediff-char-to-buftype (ediff-last-command-char)))) |
| 1015 | (or buf (ediff-recenter)) | 1015 | (or buf (ediff-recenter)) |
| 1016 | (or buf | 1016 | (or buf |
| 1017 | (setq buf (ediff-get-buffer buf-type))) | 1017 | (setq buf (ediff-get-buffer buf-type))) |
| @@ -1513,7 +1513,7 @@ the one half of the height of window-A." | |||
| 1513 | (error ediff-KILLED-VITAL-BUFFER)) | 1513 | (error ediff-KILLED-VITAL-BUFFER)) |
| 1514 | 1514 | ||
| 1515 | (ediff-operate-on-windows | 1515 | (ediff-operate-on-windows |
| 1516 | (if (memq last-command-event '(?v ?\C-v)) | 1516 | (if (memq (ediff-last-command-char) '(?v ?\C-v)) |
| 1517 | 'scroll-up | 1517 | 'scroll-up |
| 1518 | 'scroll-down) | 1518 | 'scroll-down) |
| 1519 | ;; calculate argument to scroll-up/down | 1519 | ;; calculate argument to scroll-up/down |
| @@ -1561,7 +1561,7 @@ the width of the A/B/C windows." | |||
| 1561 | ;; interactively so that they set the window's min_hscroll. | 1561 | ;; interactively so that they set the window's min_hscroll. |
| 1562 | ;; Otherwise, automatic hscrolling will undo the effect of | 1562 | ;; Otherwise, automatic hscrolling will undo the effect of |
| 1563 | ;; hscrolling. | 1563 | ;; hscrolling. |
| 1564 | (if (= last-command-event ?<) | 1564 | (if (= (ediff-last-command-char) ?<) |
| 1565 | (lambda (arg) | 1565 | (lambda (arg) |
| 1566 | (let ((prefix-arg arg)) | 1566 | (let ((prefix-arg arg)) |
| 1567 | (call-interactively 'scroll-left))) | 1567 | (call-interactively 'scroll-left))) |
| @@ -1825,7 +1825,7 @@ With a prefix argument, synchronize all files around the current point position | |||
| 1825 | in the specified buffer." | 1825 | in the specified buffer." |
| 1826 | (interactive "P") | 1826 | (interactive "P") |
| 1827 | (ediff-barf-if-not-control-buffer) | 1827 | (ediff-barf-if-not-control-buffer) |
| 1828 | (let* ((buf-type (ediff-char-to-buftype last-command-event)) | 1828 | (let* ((buf-type (ediff-char-to-buftype (ediff-last-command-char))) |
| 1829 | (buffer (ediff-get-buffer buf-type)) | 1829 | (buffer (ediff-get-buffer buf-type)) |
| 1830 | (pt (ediff-with-current-buffer buffer (point))) | 1830 | (pt (ediff-with-current-buffer buffer (point))) |
| 1831 | (diff-no (ediff-diff-at-point buf-type nil (if arg 'after))) | 1831 | (diff-no (ediff-diff-at-point buf-type nil (if arg 'after))) |
| @@ -2161,13 +2161,13 @@ ARG is a prefix argument. If nil, copy the current difference region." | |||
| 2161 | "Restore ARGth diff from `ediff-killed-diffs-alist'. | 2161 | "Restore ARGth diff from `ediff-killed-diffs-alist'. |
| 2162 | ARG is a prefix argument. If ARG is nil, restore the current-difference. | 2162 | ARG is a prefix argument. If ARG is nil, restore the current-difference. |
| 2163 | If the second optional argument, a character, is given, use it to | 2163 | If the second optional argument, a character, is given, use it to |
| 2164 | determine the target buffer instead of last-command-event" | 2164 | determine the target buffer instead of (ediff-last-command-char)" |
| 2165 | (interactive "P") | 2165 | (interactive "P") |
| 2166 | (ediff-barf-if-not-control-buffer) | 2166 | (ediff-barf-if-not-control-buffer) |
| 2167 | (if (numberp arg) | 2167 | (if (numberp arg) |
| 2168 | (ediff-jump-to-difference arg)) | 2168 | (ediff-jump-to-difference arg)) |
| 2169 | (ediff-pop-diff ediff-current-difference | 2169 | (ediff-pop-diff ediff-current-difference |
| 2170 | (ediff-char-to-buftype (or key last-command-event))) | 2170 | (ediff-char-to-buftype (or key (ediff-last-command-char)))) |
| 2171 | ;; recenter with rehighlighting, but no messages | 2171 | ;; recenter with rehighlighting, but no messages |
| 2172 | (let (ediff-verbose-p) | 2172 | (let (ediff-verbose-p) |
| 2173 | (ediff-recenter))) | 2173 | (ediff-recenter))) |
| @@ -2191,13 +2191,13 @@ a regular expression typed in by the user." | |||
| 2191 | (cond | 2191 | (cond |
| 2192 | ((or (and (eq ediff-skip-diff-region-function | 2192 | ((or (and (eq ediff-skip-diff-region-function |
| 2193 | ediff-focus-on-regexp-matches-function) | 2193 | ediff-focus-on-regexp-matches-function) |
| 2194 | (eq last-command-event ?f)) | 2194 | (eq (ediff-last-command-char) ?f)) |
| 2195 | (and (eq ediff-skip-diff-region-function | 2195 | (and (eq ediff-skip-diff-region-function |
| 2196 | ediff-hide-regexp-matches-function) | 2196 | ediff-hide-regexp-matches-function) |
| 2197 | (eq last-command-event ?h))) | 2197 | (eq (ediff-last-command-char) ?h))) |
| 2198 | (message "Selective browsing by regexp turned off") | 2198 | (message "Selective browsing by regexp turned off") |
| 2199 | (setq ediff-skip-diff-region-function 'ediff-show-all-diffs)) | 2199 | (setq ediff-skip-diff-region-function 'ediff-show-all-diffs)) |
| 2200 | ((eq last-command-event ?h) | 2200 | ((eq (ediff-last-command-char) ?h) |
| 2201 | (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function | 2201 | (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function |
| 2202 | regexp-A | 2202 | regexp-A |
| 2203 | (read-string | 2203 | (read-string |
| @@ -2235,7 +2235,7 @@ a regular expression typed in by the user." | |||
| 2235 | (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B)) | 2235 | (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B)) |
| 2236 | (or (string= regexp-C "") (setq ediff-regexp-hide-C regexp-C))) | 2236 | (or (string= regexp-C "") (setq ediff-regexp-hide-C regexp-C))) |
| 2237 | 2237 | ||
| 2238 | ((eq last-command-event ?f) | 2238 | ((eq (ediff-last-command-char) ?f) |
| 2239 | (setq ediff-skip-diff-region-function | 2239 | (setq ediff-skip-diff-region-function |
| 2240 | ediff-focus-on-regexp-matches-function | 2240 | ediff-focus-on-regexp-matches-function |
| 2241 | regexp-A | 2241 | regexp-A |
| @@ -3301,10 +3301,10 @@ Without an argument, it saves customized diff argument, if available | |||
| 3301 | (ediff-barf-if-not-control-buffer) | 3301 | (ediff-barf-if-not-control-buffer) |
| 3302 | (ediff-compute-custom-diffs-maybe) | 3302 | (ediff-compute-custom-diffs-maybe) |
| 3303 | (ediff-with-current-buffer | 3303 | (ediff-with-current-buffer |
| 3304 | (cond ((memq last-command-event '(?a ?b ?c)) | 3304 | (cond ((memq (ediff-last-command-char) '(?a ?b ?c)) |
| 3305 | (ediff-get-buffer | 3305 | (ediff-get-buffer |
| 3306 | (ediff-char-to-buftype last-command-event))) | 3306 | (ediff-char-to-buftype (ediff-last-command-char)))) |
| 3307 | ((eq last-command-event ?d) | 3307 | ((eq (ediff-last-command-char) ?d) |
| 3308 | (message "Saving diff output ...") | 3308 | (message "Saving diff output ...") |
| 3309 | (sit-for 1) ; let the user see the message | 3309 | (sit-for 1) ; let the user see the message |
| 3310 | (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer)) | 3310 | (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer)) |
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el index b5c0c0bd942..0cc321ade33 100644 --- a/lisp/ediff-vers.el +++ b/lisp/ediff-vers.el | |||
| @@ -136,7 +136,8 @@ comparison or merge operations are being performed." | |||
| 136 | ;; Optional NAME is name to use instead of `*RCS-output*'. | 136 | ;; Optional NAME is name to use instead of `*RCS-output*'. |
| 137 | ;; This is a modified version from rcs.el v1.1. I use it here to make | 137 | ;; This is a modified version from rcs.el v1.1. I use it here to make |
| 138 | ;; Ediff immune to changes in rcs.el | 138 | ;; Ediff immune to changes in rcs.el |
| 139 | (let ((buf (get-buffer-create name))) | 139 | (let* ((default-major-mode 'fundamental-mode) ; no frills! |
| 140 | (buf (get-buffer-create name))) | ||
| 140 | (with-current-buffer buf | 141 | (with-current-buffer buf |
| 141 | (setq buffer-read-only nil | 142 | (setq buffer-read-only nil |
| 142 | default-directory (file-name-directory (expand-file-name file))) | 143 | default-directory (file-name-directory (expand-file-name file))) |
diff --git a/lisp/ediff.el b/lisp/ediff.el index 33f53130caf..ad2f3c0de2e 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el | |||
| @@ -1451,7 +1451,9 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." | |||
| 1451 | "Return string describing the version of Ediff. | 1451 | "Return string describing the version of Ediff. |
| 1452 | When called interactively, displays the version." | 1452 | When called interactively, displays the version." |
| 1453 | (interactive) | 1453 | (interactive) |
| 1454 | (if (called-interactively-p 'interactive) | 1454 | ;; called-interactively-p - not in XEmacs |
| 1455 | ;; (if (called-interactively-p 'interactive) | ||
| 1456 | (if (interactive-p) | ||
| 1455 | (message "%s" (ediff-version)) | 1457 | (message "%s" (ediff-version)) |
| 1456 | (format "Ediff %s of %s" ediff-version ediff-date))) | 1458 | (format "Ediff %s of %s" ediff-version ediff-date))) |
| 1457 | 1459 | ||
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index fdaeb13f3e2..56fead09156 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -719,7 +719,7 @@ | |||
| 719 | ARG is used as the prefix value for the executed command. If | 719 | ARG is used as the prefix value for the executed command. If |
| 720 | EVENTS is a list of events, which become the beginning of the command." | 720 | EVENTS is a list of events, which become the beginning of the command." |
| 721 | (interactive "P") | 721 | (interactive "P") |
| 722 | (if (viper= last-command-event ?\\) | 722 | (if (viper= (viper-last-command-char) ?\\) |
| 723 | (message "Switched to EMACS state for the next command...")) | 723 | (message "Switched to EMACS state for the next command...")) |
| 724 | (viper-escape-to-state arg events 'emacs-state)) | 724 | (viper-escape-to-state arg events 'emacs-state)) |
| 725 | 725 | ||
| @@ -1181,7 +1181,10 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1181 | ((eq event-char 'delete) (setq event-char ?\C-?)) | 1181 | ((eq event-char 'delete) (setq event-char ?\C-?)) |
| 1182 | ((eq event-char 'backspace) (setq event-char ?\C-h)) | 1182 | ((eq event-char 'backspace) (setq event-char ?\C-h)) |
| 1183 | ((eq event-char 'space) (setq event-char ?\ ))) | 1183 | ((eq event-char 'space) (setq event-char ?\ ))) |
| 1184 | (setq last-command-event (or com event-char)) | 1184 | (setq last-command-event |
| 1185 | (if (featurep 'xemacs) | ||
| 1186 | (character-to-event (or com event-char)) | ||
| 1187 | (or com event-char))) | ||
| 1185 | (setq func (viper-exec-form-in-vi | 1188 | (setq func (viper-exec-form-in-vi |
| 1186 | `(key-binding (char-to-string ,event-char)))) | 1189 | `(key-binding (char-to-string ,event-char)))) |
| 1187 | (funcall func prefix-arg) | 1190 | (funcall func prefix-arg) |
| @@ -1311,7 +1314,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1311 | (interactive "P") | 1314 | (interactive "P") |
| 1312 | (viper-leave-region-active) | 1315 | (viper-leave-region-active) |
| 1313 | (viper-prefix-arg-value | 1316 | (viper-prefix-arg-value |
| 1314 | last-command-event (if (consp arg) (cdr arg) nil))) | 1317 | (viper-last-command-char) (if (consp arg) (cdr arg) nil))) |
| 1315 | 1318 | ||
| 1316 | (defun viper-command-argument (arg) | 1319 | (defun viper-command-argument (arg) |
| 1317 | "Accept a motion command as an argument." | 1320 | "Accept a motion command as an argument." |
| @@ -1319,7 +1322,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1319 | (let ((viper-intermediate-command 'viper-command-argument)) | 1322 | (let ((viper-intermediate-command 'viper-command-argument)) |
| 1320 | (condition-case nil | 1323 | (condition-case nil |
| 1321 | (viper-prefix-arg-com | 1324 | (viper-prefix-arg-com |
| 1322 | last-command-event | 1325 | (viper-last-command-char) |
| 1323 | (cond ((null arg) nil) | 1326 | (cond ((null arg) nil) |
| 1324 | ((consp arg) (car arg)) | 1327 | ((consp arg) (car arg)) |
| 1325 | ((integerp arg) arg) | 1328 | ((integerp arg) arg) |
| @@ -2096,7 +2099,7 @@ Undo previous insertion and inserts new." | |||
| 2096 | "Exit minibuffer Viper way." | 2099 | "Exit minibuffer Viper way." |
| 2097 | (interactive) | 2100 | (interactive) |
| 2098 | (let (command) | 2101 | (let (command) |
| 2099 | (setq command (local-key-binding (char-to-string last-command-event))) | 2102 | (setq command (local-key-binding (char-to-string (viper-last-command-char)))) |
| 2100 | (run-hooks 'viper-minibuffer-exit-hook) | 2103 | (run-hooks 'viper-minibuffer-exit-hook) |
| 2101 | (if command | 2104 | (if command |
| 2102 | (command-execute command) | 2105 | (command-execute command) |
| @@ -3771,7 +3774,9 @@ If MAJOR-MODE is set, set the macros only in that major mode." | |||
| 3771 | "///" 'vi-state | 3774 | "///" 'vi-state |
| 3772 | [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return] | 3775 | [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return] |
| 3773 | scope) | 3776 | scope) |
| 3774 | (if (called-interactively-p 'interactive) | 3777 | ;; XEmacs has no called-interactively-p |
| 3778 | ;; (if (called-interactively-p 'interactive) | ||
| 3779 | (if (interactive-p) | ||
| 3775 | (message | 3780 | (message |
| 3776 | "// and /// now toggle case-sensitivity and regexp search"))) | 3781 | "// and /// now toggle case-sensitivity and regexp search"))) |
| 3777 | (viper-unrecord-kbd-macro "//" 'vi-state) | 3782 | (viper-unrecord-kbd-macro "//" 'vi-state) |
| @@ -3794,7 +3799,10 @@ With a prefix argument, unsets the macro." | |||
| 3794 | "%%%" 'vi-state | 3799 | "%%%" 'vi-state |
| 3795 | [(meta x) v i p e r - t o g g l e - p a r s e - s e x p - i g n o r e - c o m m e n t s return] | 3800 | [(meta x) v i p e r - t o g g l e - p a r s e - s e x p - i g n o r e - c o m m e n t s return] |
| 3796 | 't) | 3801 | 't) |
| 3797 | (if (called-interactively-p 'interactive) | 3802 | ;; XEmacs has no called-interactively-p. And interactive-p |
| 3803 | ;; works fine here. | ||
| 3804 | ;; (if (called-interactively-p 'interactive) | ||
| 3805 | (if (interactive-p) | ||
| 3798 | (message | 3806 | (message |
| 3799 | "%%%%%% now toggles whether comments should be parsed for matching parentheses"))) | 3807 | "%%%%%% now toggles whether comments should be parsed for matching parentheses"))) |
| 3800 | (viper-unrecord-kbd-macro "%%%" 'vi-state)))) | 3808 | (viper-unrecord-kbd-macro "%%%" 'vi-state)))) |
| @@ -3823,7 +3831,10 @@ the macros are set in the current major mode. | |||
| 3823 | "///" 'emacs-state | 3831 | "///" 'emacs-state |
| 3824 | [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return] | 3832 | [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return] |
| 3825 | (or arg-majormode major-mode)) | 3833 | (or arg-majormode major-mode)) |
| 3826 | (if (called-interactively-p 'interactive) | 3834 | ;; called-interactively-p does not work for |
| 3835 | ;; XEmacs. interactive-p is ok here. | ||
| 3836 | ;; (if (called-interactively-p 'interactive) | ||
| 3837 | (if (interactive-p) | ||
| 3827 | (message | 3838 | (message |
| 3828 | "// and /// now toggle case-sensitivity and regexp search."))) | 3839 | "// and /// now toggle case-sensitivity and regexp search."))) |
| 3829 | (viper-unrecord-kbd-macro "//" 'emacs-state) | 3840 | (viper-unrecord-kbd-macro "//" 'emacs-state) |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 503265c8b85..80cf3c78f60 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -174,12 +174,14 @@ Otherwise return the normal value." | |||
| 174 | (viper-frame-value viper-vi-state-cursor-color) | 174 | (viper-frame-value viper-vi-state-cursor-color) |
| 175 | frame)))) | 175 | frame)))) |
| 176 | 176 | ||
| 177 | ;; By default, saves current frame cursor color in the | 177 | ;; By default, saves current frame cursor color before changing viper state |
| 178 | ;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay | ||
| 179 | (defun viper-save-cursor-color (before-which-mode) | 178 | (defun viper-save-cursor-color (before-which-mode) |
| 180 | (if (and (viper-window-display-p) (viper-color-display-p)) | 179 | (if (and (viper-window-display-p) (viper-color-display-p)) |
| 181 | (let ((color (viper-get-cursor-color))) | 180 | (let ((color (viper-get-cursor-color))) |
| 182 | (if (and (stringp color) (viper-color-defined-p color) | 181 | (if (and (stringp color) (viper-color-defined-p color) |
| 182 | ;; there is something fishy in that the color is not saved if | ||
| 183 | ;; it is the same as frames default cursor color. need to be | ||
| 184 | ;; checked. | ||
| 183 | (not (string= color | 185 | (not (string= color |
| 184 | (viper-frame-value | 186 | (viper-frame-value |
| 185 | viper-replace-overlay-cursor-color)))) | 187 | viper-replace-overlay-cursor-color)))) |
| @@ -1047,6 +1049,11 @@ Otherwise return the normal value." | |||
| 1047 | (append mod (list basis)) | 1049 | (append mod (list basis)) |
| 1048 | basis)))) | 1050 | basis)))) |
| 1049 | 1051 | ||
| 1052 | (defun viper-last-command-char () | ||
| 1053 | (if (featurep 'xemacs) | ||
| 1054 | (event-to-character last-command-event) | ||
| 1055 | last-command-event)) | ||
| 1056 | |||
| 1050 | (defun viper-key-to-emacs-key (key) | 1057 | (defun viper-key-to-emacs-key (key) |
| 1051 | (let (key-name char-p modifiers mod-char-list base-key base-key-name) | 1058 | (let (key-name char-p modifiers mod-char-list base-key base-key-name) |
| 1052 | (cond ((featurep 'xemacs) key) | 1059 | (cond ((featurep 'xemacs) key) |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 24ed2dc80ba..a02c144d7bd 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -889,7 +889,10 @@ It also can't undo some Viper settings." | |||
| 889 | (defadvice self-insert-command (around viper-self-insert-ad activate) | 889 | (defadvice self-insert-command (around viper-self-insert-ad activate) |
| 890 | "Ignore all self-inserting keys in the vi-state." | 890 | "Ignore all self-inserting keys in the vi-state." |
| 891 | (if (and (eq viper-current-state 'vi-state) | 891 | (if (and (eq viper-current-state 'vi-state) |
| 892 | (called-interactively-p 'interactive)) | 892 | ;; Do not use called-interactively-p here. XEmacs does not have it |
| 893 | ;; and interactive-p is just fine. | ||
| 894 | ;; (called-interactively-p 'interactive)) | ||
| 895 | (interactive-p)) | ||
| 893 | (beep 1) | 896 | (beep 1) |
| 894 | ad-do-it | 897 | ad-do-it |
| 895 | )) | 898 | )) |