summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>2001-12-24 05:50:31 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>2001-12-24 05:50:31 +0000
commitb9fe4732f60bef14008aa9c4735d45f23fd8f670 (patch)
treea1143820e91e6ead088b0b85b24f9388cceace95 /lisp/emulation
parentea8d3061370eb3c02cc659eb0b013a358de853b2 (diff)
downloademacs-b9fe4732f60bef14008aa9c4735d45f23fd8f670.tar.gz
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
* viper-cmd.el (viper-change-state): Got rid of make-local-hook. (viper-special-read-and-insert-char): Make C-m work right in the r comand. (viper-buffer-search-enable): Fixed format string. * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name instead of viper-info-on-file. (ex-set-visited-file-name): New function. * viper.el (viper-emacs-state-mode-list): Added mail-mode. * ediff-mult.el (ediff-meta-mark-equal-files): Added optional action argument. * ediff-init.el: Fixed some doc strings. * ediff-util.el (ediff-after-quit-hook-internal): New variable. Got rid of make-local-hook. * ediff-wind.el (ediff-setup-control-frame): Got rid of make-local-hook.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper-cmd.el40
-rw-r--r--lisp/emulation/viper-ex.el21
-rw-r--r--lisp/emulation/viper.el1
3 files changed, 51 insertions, 11 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 0df2022ae04..70347ce2aee 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -298,10 +298,12 @@
;; desirable that viper-pre-command-sentinel is the last hook and
;; viper-post-command-sentinel is the first hook.
- (make-local-hook 'viper-after-change-functions)
- (make-local-hook 'viper-before-change-functions)
- (make-local-hook 'viper-post-command-hooks)
- (make-local-hook 'viper-pre-command-hooks)
+ (if viper-xemacs-p
+ (progn
+ (make-local-hook 'viper-after-change-functions)
+ (make-local-hook 'viper-before-change-functions)
+ (make-local-hook 'viper-post-command-hooks)
+ (make-local-hook 'viper-pre-command-hooks)))
(remove-hook 'post-command-hook 'viper-post-command-sentinel)
(add-hook 'post-command-hook 'viper-post-command-sentinel)
@@ -786,9 +788,15 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
;; key translation. (Such left-overs are possible if the user
;; types a regular key.)
(let (unread-command-events)
- ;; The next 2 cmds are intended to prevent the input method
+ ;; The next cmd and viper-set-unread-command-events
+ ;; are intended to prevent the input method
;; from swallowing ^M, ^Q and other special characters
(setq ch (read-char))
+ ;; replace ^M with the newline
+ (if (eq ch ?\C-m) (setq ch ?\n))
+ ;; Make sure ^V and ^Q work as quotation chars
+ (if (memq ch '(?\C-v ?\C-q))
+ (setq ch (read-char)))
(viper-set-unread-command-events ch)
(quail-input-method nil)
@@ -806,6 +814,11 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
;; quail-input-method
(let (unread-command-events)
(setq ch (read-char))
+ ;; replace ^M with the newline
+ (if (eq ch ?\C-m) (setq ch ?\n))
+ ;; Make sure ^V and ^Q work as quotation chars
+ (if (memq ch '(?\C-v ?\C-q))
+ (setq ch (read-char)))
(viper-set-unread-command-events ch)
(quail-start-translation nil)
@@ -818,9 +831,19 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
))
((and (boundp 'iso-accents-mode) iso-accents-mode)
(setq ch (aref (read-key-sequence nil) 0))
+ ;; replace ^M with the newline
+ (if (eq ch ?\C-m) (setq ch ?\n))
+ ;; Make sure ^V and ^Q work as quotation chars
+ (if (memq ch '(?\C-v ?\C-q))
+ (setq ch (aref (read-key-sequence nil) 0)))
(insert ch))
(t
(setq ch (read-char))
+ ;; replace ^M with the newline
+ (if (eq ch ?\C-m) (setq ch ?\n))
+ ;; Make sure ^V and ^Q work as quotation chars
+ (if (memq ch '(?\C-v ?\C-q))
+ (setq ch (read-char)))
(insert ch))
)
(setq last-command-event
@@ -2554,12 +2577,9 @@ These keys are ESC, RET, and LineFeed"
(or (eq viper-intermediate-command 'viper-repeat)
(viper-special-read-and-insert-char))
- ;; Is this needed?
- (if (eq char ?\C-m) (setq char ?\n))
-
(delete-char 1 t)
-
(setq char (if com viper-d-char (viper-char-at-pos 'backward)))
+
(if com (insert char))
(setq viper-d-char char)
@@ -3836,7 +3856,7 @@ Null string will repeat previous search."
(define-key viper-vi-basic-map
(cond ((viper-characterp viper-buffer-search-char)
(char-to-string viper-buffer-search-char))
- (t (error "viper-buffer-search-char: wrong value type, %s"
+ (t (error "viper-buffer-search-char: wrong value type, %S"
viper-buffer-search-char)))
'viper-command-argument)
(aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search)
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 1ee912eb18c..9b26f468600 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -115,7 +115,7 @@
("customize" (customize-group "viper"))
("delete" (ex-delete))
("edit" (ex-edit))
- ("file" (viper-info-on-file))
+ ("file" (ex-set-visited-file-name))
("g" "global")
("global" (ex-global nil) is-mashed)
("goto" (ex-goto))
@@ -2232,6 +2232,25 @@ Type 'mak ' (including the space) to run make with no args."
(kill-buffer " *viper-info*")))
))
+
+;; Without arguments displays info on file. With an arg, sets the visited file
+;; name to that arg
+(defun ex-set-visited-file-name ()
+ (viper-get-ex-file)
+ (if (string= ex-file "")
+ (viper-info-on-file)
+ ;; If ex-file is a directory, use the file portion of the buffer
+ ;; file name (like ex-write). Do this even if ex-file is a
+ ;; non-existent directory, since set-visited-file-name signals an
+ ;; error on this condition, too.
+ (if (and (string= (file-name-nondirectory ex-file) "")
+ buffer-file-name
+ (not (file-directory-p buffer-file-name)))
+ (setq ex-file (concat (file-name-as-directory ex-file)
+ (file-name-nondirectory buffer-file-name))))
+ (set-visited-file-name ex-file)))
+
+
;; display all variables set through :set
(defun ex-show-vars ()
(with-output-to-temp-buffer " *viper-info*"
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index f1d3bb298af..a76dedd3f08 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -426,6 +426,7 @@ widget."
tar-mode
mh-folder-mode
+ mail-mode
gnus-group-mode
gnus-summary-mode