emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emulation/viper-ex.el


From: Michael Kifer
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/viper-ex.el
Date: Mon, 24 Dec 2001 00:50:33 -0500

Index: emacs/lisp/emulation/viper-ex.el
diff -c emacs/lisp/emulation/viper-ex.el:1.41 
emacs/lisp/emulation/viper-ex.el:1.42
*** emacs/lisp/emulation/viper-ex.el:1.41       Sat Oct 13 17:38:19 2001
--- emacs/lisp/emulation/viper-ex.el    Mon Dec 24 00:50:31 2001
***************
*** 115,121 ****
        ("customize"            (customize-group "viper"))
        ("delete"               (ex-delete))
        ("edit"                 (ex-edit))
!       ("file"                 (viper-info-on-file))
        ("g"                    "global")
        ("global"               (ex-global nil) is-mashed)
        ("goto"                 (ex-goto))
--- 115,121 ----
        ("customize"            (customize-group "viper"))
        ("delete"               (ex-delete))
        ("edit"                 (ex-edit))
!       ("file"                 (ex-set-visited-file-name))
        ("g"                    "global")
        ("global"               (ex-global nil) is-mashed)
        ("goto"                 (ex-goto))
***************
*** 2231,2236 ****
--- 2231,2255 ----
          (viper-set-unread-command-events (viper-read-event)))
        (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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]