Commit 657f9cb8 authored by Michael Kifer's avatar Michael Kifer
Browse files

2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>

	* viper-cmd.el (viper-preserve-cursor-color): new test that avoids
	rewrawing the screen when changing cursor color.
	(viper-insert-state-pre-command-sentinel,
	viper-replace-state-pre-command-sentinel,
	viper-replace-state-post-command-sentinel): use
	viper-preserve-cursor-color.
	Many functions changed to use viper= instead of = when comparing
	characters.
	* viper-util.el (viper-memq-char,viper=): new functions for
	working with characters.
	(viper-change-cursor-color): fixed buglet.
	Many functions changed to use viper= instead of = when comparing
	characters.
	* viper.el (viper-insert-state-mode-list): added eshell.

	* ediff-init.el (ediff-before-setup-hook): new hook.
	Several typos fixed in various docstrings.
	* ediff-merg.el (ediff-show-clashes-only): docstring typo fixed.
	* ediff-nult.el (ediff-before-session-group-setup-hooks): new
	hook.
	(ediff-show-meta-buffer): run ediff-before-session-group-setup-hooks.
	* ediff-util.el (ediff-setup): run ediff-before-setup-hook.
	(ediff-other-buffer): use selected buffers if in Buffer-menu buffer.
	(ediff-get-selected-buffers): new function.
	* ediff-vers.el (ediff-vc-internal,ediff-rcs-internal,
	ediff-vc-merge-internal,ediff-rcs-merge-internal): use
	save-window-excursion.
	* ediff-wind.el (ediff-skip-unsuitable-frames): more robust
	termination check in while loop.
	* ediff.el (ediff-get-default-file-name): better defaults when in
	dired buffer.
	(ediff-files,ediff-merge-files,ediff-files3,
	ediff-merge-files-with-ancestor): use ediff-get-default-file-name.
parent 4f490d99
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
* viper-cmd.el (viper-preserve-cursor-color): new test that avoids
rewrawing the screen when changing cursor color.
(viper-insert-state-pre-command-sentinel,
viper-replace-state-pre-command-sentinel,
viper-replace-state-post-command-sentinel): use
viper-preserve-cursor-color.
Many functions changed to use viper= instead of = when comparing
characters.
* viper-util.el (viper-memq-char,viper=): new functions for
working with characters.
(viper-change-cursor-color): fixed buglet.
Many functions changed to use viper= instead of = when comparing
characters.
* viper.el (viper-insert-state-mode-list): added eshell.
* ediff-init.el (ediff-before-setup-hook): new hook.
Several typos fixed in various docstrings.
* ediff-merg.el (ediff-show-clashes-only): docstring typo fixed.
* ediff-nult.el (ediff-before-session-group-setup-hooks): new
hook.
(ediff-show-meta-buffer): run ediff-before-session-group-setup-hooks.
* ediff-util.el (ediff-setup): run ediff-before-setup-hook.
(ediff-other-buffer): use selected buffers if in Buffer-menu buffer.
(ediff-get-selected-buffers): new function.
* ediff-vers.el (ediff-vc-internal,ediff-rcs-internal,
ediff-vc-merge-internal,ediff-rcs-merge-internal): use
save-window-excursion.
* ediff-wind.el (ediff-skip-unsuitable-frames): more robust
termination check in while loop.
* ediff.el (ediff-get-default-file-name): better defaults when in
dired buffer.
(ediff-files,ediff-merge-files,ediff-files3,
ediff-merge-files-with-ancestor): use ediff-get-default-file-name.
2000-10-28 Dave Love <fx@gnu.org>
* info.el (Info-fontify-node): Add help-echo for menu items.
......
......@@ -376,10 +376,17 @@ that Ediff doesn't know about.")
;; Hook variables
(defcustom ediff-before-setup-hook nil
"*Hooks to run before Ediff begins to set up windows and buffers.
This hook can be used to save the previous window config, which can be restored
on ediff-quit or ediff-suspend."
:type 'hook
:group 'ediff-hook)
(defcustom ediff-before-setup-windows-hook nil
"*Hooks to run before Ediff sets its window configuration.
This can be used to save the previous window config, which can be restored
on ediff-quit or ediff-suspend."
This hook is called every time when Ediff arranges its windows.
This happens each time Ediff detects that the windows were messed up by the
user."
:type 'hook
:group 'ediff-hook)
(defcustom ediff-after-setup-windows-hook nil
......@@ -399,7 +406,7 @@ Can be used to move the frame where it is desired."
:type 'hook
:group 'ediff-hook)
(defcustom ediff-startup-hook nil
"*Hooks to run in the control buffer after Ediff has been set up."
"*Hooks to run in the control buffer after Ediff has been set up and is ready for the job."
:type 'hook
:group 'ediff-hook)
(defcustom ediff-select-hook nil
......@@ -777,14 +784,14 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
'display-pixel-height
'x-display-pixel-height)))))
;; A-list of current-diff-overlay symbols asssociated with buf types
;; A-list of current-diff-overlay symbols associated with buf types
(defconst ediff-current-diff-overlay-alist
'((A . ediff-current-diff-overlay-A)
(B . ediff-current-diff-overlay-B)
(C . ediff-current-diff-overlay-C)
(Ancestor . ediff-current-diff-overlay-Ancestor)))
;; A-list of current-diff-face-* symbols asssociated with buf types
;; A-list of current-diff-face-* symbols associated with buf types
(defconst ediff-current-diff-face-alist
'((A . ediff-current-diff-face-A)
(B . ediff-current-diff-face-B)
......
......@@ -80,7 +80,7 @@ STRING4
(defcustom ediff-show-clashes-only nil
"*If t, show only those diff regions where both buffers disagree with the ancestor.
This means that regions that have status prefer-A or prefer-B will be
skiped over. Nil means show all regions."
skipped over. Nil means show all regions."
:type 'boolean
:group 'ediff-merge
)
......
......@@ -187,7 +187,15 @@ This can be toggled with `ediff-toggle-filename-truncation'."
"*Hooks run just after the registry control panel is set up."
:type 'hook
:group 'ediff-mult)
(defcustom ediff-session-group-setup-hook nil
(defcustom ediff-before-session-group-setup-hooks nil
"*Hooks to run before Ediff arranges the window for group-level operations.
It is used by commands such as ediff-directories.
This hook can be used to save the previous window config, which can be restored
on ediff-quit, ediff-suspend, or ediff-quit-session-group-hook."
:type 'hook
:group 'ediff-hook)
(defcustom ediff-after-session-group-setup-hook nil
"*Hooks run just after a meta-buffer controlling a session group, such as
ediff-directories, is run."
:type 'hook
......@@ -706,7 +714,7 @@ behavior."
(if (eq ediff-metajob-name 'ediff-registry)
(run-hooks 'ediff-registry-setup-hook)
(run-hooks 'ediff-session-group-setup-hook))
(run-hooks 'ediff-after-session-group-setup-hook))
) ; eval in meta-buffer
meta-buffer))
......@@ -1719,6 +1727,7 @@ all marked sessions must be active."
(defun ediff-show-meta-buffer (&optional meta-buf session-number)
"Show the session group buffer."
(interactive)
(run-hooks 'ediff-before-directory-setup-hooks)
(let (wind frame silent)
(if meta-buf (setq silent t))
......
......@@ -254,6 +254,7 @@ to invocation.")
(defun ediff-setup (buffer-A file-A buffer-B file-B buffer-C file-C
startup-hooks setup-parameters
&optional merge-buffer-file)
(run-hooks 'ediff-before-setup-hook)
;; ediff-convert-standard-filename puts file names in the form appropriate
;; for the OS at hand.
(setq file-A (ediff-convert-standard-filename (expand-file-name file-A)))
......@@ -955,7 +956,7 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting."
(defun ediff-make-or-kill-fine-diffs (arg)
"Compute fine diffs. With negative prefix arg, kill fine diffs.
In both cases, operates on the currrent difference region."
In both cases, operates on the current difference region."
(interactive "P")
(ediff-barf-if-not-control-buffer)
(cond ((eq arg '-)
......@@ -3459,7 +3460,11 @@ Ediff Control Panel to restore highlighting."
;; EXCL-BUFF-LIST is an exclusion list.
(defun ediff-other-buffer (excl-buff-lst)
(or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst)))
(let* ((all-buffers (buffer-list))
(let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list)))
;; we compute this the second time because we need to do memq on it
;; later, and nconc above will break it. Either this or use slow
;; append instead of nconc
(selected-buffers (ediff-get-selected-buffers))
(prefered-buffer (car all-buffers))
visible-dired-buffers
(excl-buff-name-list
......@@ -3488,33 +3493,34 @@ Ediff Control Panel to restore highlighting."
(mapcar
(lambda (x)
(cond ((member (buffer-name x) excl-buff-name-list) nil)
((not (ediff-get-visible-buffer-window x)) nil)
((eq x prefered-buffer) x)
;; if prev selected buffer is dired, look only at
;; dired.
((eq use-dired-major-mode 'yes)
(if (eq (ediff-with-current-buffer x major-mode)
'dired-mode)
x nil))
((eq (ediff-with-current-buffer x major-mode)
'dired-mode)
(if (null use-dired-major-mode)
;; don't know if we must enforce dired.
;; Remember this buffer in case
;; dired buffs are the only ones visible.
(setq visible-dired-buffers
(cons x visible-dired-buffers)))
;; skip, if dired is not forced
nil)
((memq (ediff-with-current-buffer x major-mode)
'(rmail-mode
vm-mode
gnus-article-mode
mh-show-mode))
x)
((string-match "^[ *]" (buffer-name x)) nil)
((string= "*scratch*" (buffer-name x)) nil)
(t x)))
((memq x selected-buffers) x)
((not (ediff-get-visible-buffer-window x)) nil)
((eq x prefered-buffer) x)
;; if prev selected buffer is dired, look only at
;; dired.
((eq use-dired-major-mode 'yes)
(if (eq (ediff-with-current-buffer x major-mode)
'dired-mode)
x nil))
((eq (ediff-with-current-buffer x major-mode)
'dired-mode)
(if (null use-dired-major-mode)
;; don't know if we must enforce dired.
;; Remember this buffer in case
;; dired buffs are the only ones visible.
(setq visible-dired-buffers
(cons x visible-dired-buffers)))
;; skip, if dired is not forced
nil)
((memq (ediff-with-current-buffer x major-mode)
'(rmail-mode
vm-mode
gnus-article-mode
mh-show-mode))
x)
((string-match "^[ *]" (buffer-name x)) nil)
((string= "*scratch*" (buffer-name x)) nil)
(t x)))
all-buffers))
(clean-significant-buffers (delq nil significant-buffers))
less-significant-buffers)
......@@ -3547,6 +3553,23 @@ Ediff Control Panel to restore highlighting."
(t "*scratch*"))
))
;; If current buffer is a Buffer-menu buffer, then take the selected buffers
;; and append the buffer at the cursor to the end.
;; This list would be the preferred list.
(defun ediff-get-selected-buffers ()
(if (eq major-mode 'Buffer-menu-mode)
(let ((lis (condition-case nil
(list (Buffer-menu-buffer t))
(error))
))
(save-excursion
(goto-char (point-max))
(while (search-backward "\n>" nil t)
(forward-char 1)
(setq lis (cons (Buffer-menu-buffer t) lis)))
lis))
))
;; Construct a unique buffer name.
;; The first one tried is prefixsuffix, then prefix<2>suffix,
......
......@@ -47,20 +47,21 @@
;; If the current buffer is named `F', the version is named `F.~REV~'.
;; If `F.~REV~' already exists, it is used instead of being re-created.
(let (file1 file2 rev1buf rev2buf)
(save-excursion
(vc-version-other-window rev1)
(setq rev1buf (current-buffer)
file1 (buffer-file-name)))
(save-excursion
(or (string= rev2 "") ; use current buffer
(vc-version-other-window rev2))
(setq rev2buf (current-buffer)
file2 (buffer-file-name)))
(setq startup-hooks
(cons `(lambda ()
(delete-file ,file1)
(or ,(string= rev2 "") (delete-file ,file2)))
startup-hooks))
(save-window-excursion
(save-excursion
(vc-version-other-window rev1)
(setq rev1buf (current-buffer)
file1 (buffer-file-name)))
(save-excursion
(or (string= rev2 "") ; use current buffer
(vc-version-other-window rev2))
(setq rev2buf (current-buffer)
file2 (buffer-file-name)))
(setq startup-hooks
(cons `(lambda ()
(delete-file ,file1)
(or ,(string= rev2 "") (delete-file ,file2)))
startup-hooks)))
(ediff-buffers
rev1buf rev2buf
startup-hooks
......@@ -107,10 +108,12 @@
(defun ediff-rcs-internal (rev1 rev2 &optional startup-hooks)
;; Run Ediff on versions of the current buffer.
;; If REV2 is "" then use current buffer.
(let ((rev2buf (if (string= rev2 "")
(current-buffer)
(rcs-ediff-view-revision rev2)))
(rev1buf (rcs-ediff-view-revision rev1)))
(let (rev2buf rev1buf)
(save-window-excursion
(setq rev2buf (if (string= rev2 "")
(current-buffer)
(rcs-ediff-view-revision rev2))
rev1buf (rcs-ediff-view-revision rev1)))
;; rcs.el doesn't create temp version files, so we don't have to delete
;; anything in startup hooks to ediff-buffers
......@@ -149,30 +152,31 @@
&optional startup-hooks merge-buffer-file)
;; If ANCESTOR-REV non-nil, merge with ancestor
(let (buf1 buf2 ancestor-buf)
(save-excursion
(vc-version-other-window rev1)
(setq buf1 (current-buffer)))
(save-excursion
(or (string= rev2 "")
(vc-version-other-window rev2))
(setq buf2 (current-buffer)))
(if ancestor-rev
(save-excursion
(if (string= ancestor-rev "")
(setq ancestor-rev (vc-workfile-version buffer-file-name)))
(vc-version-other-window ancestor-rev)
(setq ancestor-buf (current-buffer))))
(setq startup-hooks
(cons
`(lambda ()
(delete-file ,(buffer-file-name buf1))
(or ,(string= rev2 "")
(delete-file ,(buffer-file-name buf2)))
(or ,(string= ancestor-rev "")
,(not ancestor-rev)
(delete-file ,(buffer-file-name ancestor-buf)))
)
startup-hooks))
(save-window-excursion
(save-excursion
(vc-version-other-window rev1)
(setq buf1 (current-buffer)))
(save-excursion
(or (string= rev2 "")
(vc-version-other-window rev2))
(setq buf2 (current-buffer)))
(if ancestor-rev
(save-excursion
(if (string= ancestor-rev "")
(setq ancestor-rev (vc-workfile-version buffer-file-name)))
(vc-version-other-window ancestor-rev)
(setq ancestor-buf (current-buffer))))
(setq startup-hooks
(cons
`(lambda ()
(delete-file ,(buffer-file-name buf1))
(or ,(string= rev2 "")
(delete-file ,(buffer-file-name buf2)))
(or ,(string= ancestor-rev "")
,(not ancestor-rev)
(delete-file ,(buffer-file-name ancestor-buf)))
)
startup-hooks)))
(if ancestor-rev
(ediff-merge-buffers-with-ancestor
buf1 buf2 ancestor-buf
......@@ -186,14 +190,15 @@
startup-hooks merge-buffer-file)
;; If ANCESTOR-REV non-nil, merge with ancestor
(let (buf1 buf2 ancestor-buf)
(setq buf1 (rcs-ediff-view-revision rev1)
buf2 (if (string= rev2 "")
(current-buffer)
(rcs-ediff-view-revision rev2))
ancestor-buf (if ancestor-rev
(if (string= ancestor-rev "")
(current-buffer)
(rcs-ediff-view-revision ancestor-rev))))
(save-window-excursion
(setq buf1 (rcs-ediff-view-revision rev1)
buf2 (if (string= rev2 "")
(current-buffer)
(rcs-ediff-view-revision rev2))
ancestor-buf (if ancestor-rev
(if (string= ancestor-rev "")
(current-buffer)
(rcs-ediff-view-revision ancestor-rev)))))
;; rcs.el doesn't create temp version files, so we don't have to delete
;; anything in startup hooks to ediff-buffers
(if ancestor-rev
......
......@@ -151,7 +151,6 @@ In this case, Ediff will use those frames to display these buffers."
'(vertical-scroll-bars . nil) ; Emacs only
'(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only
'(tool-bar-lines . 0) ; Emacs only
;; don't lower and auto-raise
'(auto-lower . nil)
'(auto-raise . t)
......@@ -831,8 +830,14 @@ into icons, regardless of the window manager."
;; create a new splittable frame if none is found
(defun ediff-skip-unsuitable-frames (&optional ok-unsplittable)
(if (ediff-window-display-p)
(let (last-window)
(while (and (not (eq (selected-window) last-window))
;;(let (last-window)
(let (seen-windows)
;; (memq ... seen-windows) has quadratic behavior,
;; but (eq ... last-window) runs into an emacs bug where next-window
;; gets stuck in a loop if the only frame is the minibuffer.
;;
;;(while (and (not (eq (selected-window) last-window))
(while (and (not (memq (selected-window) seen-windows))
(or
(ediff-frame-has-dedicated-windows (selected-frame))
(ediff-frame-iconified-p (selected-frame))
......@@ -846,10 +851,12 @@ into icons, regardless of the window manager."
nil
(ediff-frame-unsplittable-p (selected-frame)))))
;; remember where started
(or last-window (setq last-window (selected-window)))
;;(or last-window (setq last-window (selected-window)))
(setq seen-windows (cons (selected-window) seen-windows))
;; try new window
(other-window 1 t))
(if (eq (selected-window) last-window)
;;(if (eq (selected-window) last-window)
(if (memq (selected-window) seen-windows)
;; fed up, no appropriate frame
(progn
(select-frame (make-frame '((unsplittable)))))))))
......
......@@ -6,8 +6,8 @@
;; Created: February 2, 1994
;; Keywords: comparing, merging, patching, version control.
(defconst ediff-version "2.74" "The current version of Ediff")
(defconst ediff-date "October 31, 1999" "Date of last update")
(defconst ediff-version "2.75" "The current version of Ediff")
(defconst ediff-date "October 29, 2000" "Date of last update")
;; This file is part of GNU Emacs.
......@@ -163,13 +163,27 @@
(toggle-read-only 1)))
;; Return a plausible default for ediff's first file:
;; In dired, return the file name under the point, unless it is a directory
;; If the buffer has a file name, return that file name.
(defun ediff-get-default-file-name ()
;; In dired, return the file number FILENO (or 0) in the list
;; (all-selected-files, filename under the cursor), where directories are
;; ignored. Otherwise, return DEFAULT file name, if non-nil. Else,
;; if the buffer is visiting a file, return that file name.
(defun ediff-get-default-file-name (&optional default fileno)
(cond ((eq major-mode 'dired-mode)
(let ((f (dired-get-filename nil 'no-error)))
(if (and (stringp f) (not (file-directory-p f)))
f)))
(let ((current (dired-get-filename nil 'no-error))
(marked (condition-case nil
(dired-get-marked-files 'no-dir)
(error)))
aux-list choices result)
(or (integerp fileno) (setq fileno 0))
(if (stringp default)
(setq aux-list (cons default aux-list)))
(if (and (stringp current) (not (file-directory-p current)))
(setq aux-list (cons current aux-list)))
(setq choices (nconc marked aux-list))
(setq result (elt choices fileno))
(or result
default)))
((stringp default) default)
((buffer-file-name (current-buffer))
(file-name-nondirectory (buffer-file-name (current-buffer))))
))
......@@ -199,7 +213,7 @@
(file-name-nondirectory f)
dir-B))
file-name-history))
f))
(ediff-get-default-file-name f 1)))
)))
(ediff-files-internal file-A
(if (file-directory-p file-B)
......@@ -234,7 +248,7 @@
(file-name-nondirectory f)
dir-B))
file-name-history))
f)))
(ediff-get-default-file-name f 1))))
(ediff-read-file-name "File C to compare"
(setq dir-C (if ediff-use-last-dir
ediff-last-dir-C
......@@ -246,7 +260,7 @@
(file-name-nondirectory ff)
dir-C))
file-name-history))
ff))
(ediff-get-default-file-name ff 2)))
)))
(ediff-files-internal file-A
(if (file-directory-p file-B)
......@@ -1009,7 +1023,7 @@ Continue anyway? (y/n) "))
(file-name-nondirectory f)
dir-B))
file-name-history))
f))
(ediff-get-default-file-name f 1)))
)))
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
(ediff-files-internal file-A
......@@ -1052,7 +1066,7 @@ Continue anyway? (y/n) "))
(file-name-nondirectory f)
dir-B))
file-name-history))
f)))
(ediff-get-default-file-name f 1))))
(ediff-read-file-name "Ancestor file"
(setq dir-ancestor
(if ediff-use-last-dir
......@@ -1065,7 +1079,7 @@ Continue anyway? (y/n) "))
(file-name-nondirectory ff)
dir-ancestor))
file-name-history))
ff))
(ediff-get-default-file-name ff 2)))
)))
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
(ediff-files-internal file-A
......
......@@ -79,8 +79,11 @@
(nm-p (intern (concat snm "-p")))
(nms (intern (concat snm "s"))))
`(defun ,nm-p (com)
(consp (memq (if (and (viper-characterp com) (< com 0))
(- com) com) ,nms)))))
(consp (viper-memq-char
(if (and (viper-characterp com) (< com 0))
(- com) com)
,nms)
))))
;; Variables for defining VI commands
......@@ -191,11 +194,19 @@
(viper-move-marker-locally viper-insert-point viper-pre-command-point))
)
(defsubst viper-insert-state-pre-command-sentinel ()
(or (memq this-command '(self-insert-command))
(defsubst viper-preserve-cursor-color ()
(or (memq this-command '(self-insert-command
viper-del-backward-char-in-insert
viper-del-backward-char-in-replace
viper-delete-backward-char
viper-join-lines
viper-delete-char))
(memq (viper-event-key last-command-event)
'(up down left right (meta f) (meta b)
(control n) (control p) (control f) (control b)))
(control n) (control p) (control f) (control b)))))
(defsubst viper-insert-state-pre-command-sentinel ()
(or (viper-preserve-cursor-color)
(viper-restore-cursor-color 'after-insert-mode))
(if (and (memq this-command '(dabbrev-expand hippie-expand))
(markerp viper-insert-point)
......@@ -218,10 +229,7 @@
;; to speed up, don't change cursor color before self-insert
;; and common move commands
(defsubst viper-replace-state-pre-command-sentinel ()
(or (memq this-command '(self-insert-command))
(memq (viper-event-key last-command-event)
'(up down left right (meta f) (meta b)
(control n) (control p) (control f) (control b)))
(or (viper-preserve-cursor-color)
(viper-restore-cursor-color 'after-replace-mode)))
......@@ -248,10 +256,11 @@
;; we set the point outside the replacement region, then the cursor color
;; will remain red. Restoring the default, below, fixes this problem.
;;
;; We optimize for self-insert-command's here, since they either don't change
;; We optimize for some commands, like self-insert-command,
;; viper-delete-backward-char, etc., since they either don't change
;; cursor color or, if they terminate replace mode, the color will be changed
;; in viper-finish-change
(or (memq this-command '(self-insert-command))
(or (viper-preserve-cursor-color)
(viper-restore-cursor-color 'after-replace-mode))
(cond
((eq viper-current-state 'replace-state)
......@@ -679,7 +688,7 @@
ARG is used as the prefix value for the executed command. If
EVENTS is a list of events, which become the beginning of the command."
(interactive "P")
(if (= last-command-char ?\\)
(if (viper= last-command-char ?\\)
(message "Switched to EMACS state for the next command..."))
(viper-escape-to-state arg events 'emacs-state))
......@@ -981,17 +990,17 @@ as a Meta key and any number of multiple escapes is allowed."
;; Get com part of prefix-argument ARG and modify it.
(defun viper-getCom (arg)
(let ((com (viper-getcom arg)))
(cond ((equal com ?c) ?c)
(cond ((viper= com ?c) ?c)
;; Previously, ?c was being converted to ?C, but this prevented
;; multiline replace regions.
;;((equal com ?c) ?C)
((equal com ?d) ?D)
((equal com ?y) ?Y)
;;((viper= com ?c) ?C)
((viper= com ?d) ?D)
((viper= com ?y) ?Y)
(t com))))
;; Compute numeric prefix arg value.
;; Invoked by EVENT. COM is the command part obtained so far.
;; Invoked by EVENT-CHAR. COM is the command part obtained so far.
(defun viper-prefix-arg-value (event-char com)
(let ((viper-intermediate-command 'viper-digit-argument)
value func)
......@@ -1046,31 +1055,31 @@ as a Meta key and any number of multiple escapes is allowed."
cmd-info
cmd-to-exec-at-end)
(while (and cont
(memq char
(list ?c ?d ?y ?! ?< ?> ?= ?# ?r ?R ?\"
viper-buffer-search-char)))
(viper-memq-char char
(list ?c ?d ?y ?! ?< ?> ?= ?# ?r ?R ?\"
viper-buffer-search-char)))
(if com
;; this means that we already have a command character, so we
;; construct a com list and exit while. however, if char is "
;; it is an error.
(progn
;; new com is (CHAR . OLDCOM)
(if (memq char '(?# ?\")) (error ""))
(if (viper-memq-char char '(?# ?\")) (error ""))