diff lisp/emulation/viper-ex.el @ 42288:3ce98f3e0608

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.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Mon, 24 Dec 2001 05:50:31 +0000
parents 50f67a72ea1b
children 633233bf2bbf
line wrap: on
line diff
--- a/lisp/emulation/viper-ex.el	Mon Dec 24 04:52:54 2001 +0000
+++ b/lisp/emulation/viper-ex.el	Mon Dec 24 05:50:31 2001 +0000
@@ -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 @@
 	(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*"