summaryrefslogtreecommitdiff
path: root/lisp/emulation/viper-ex.el
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/viper-ex.el
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/viper-ex.el')
-rw-r--r--lisp/emulation/viper-ex.el21
1 files changed, 20 insertions, 1 deletions
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*"