aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-02 12:46:26 +0000
committerRichard M. Stallman1993-05-02 12:46:26 +0000
commit1770543d431e48624a4460e4bdaf979a346e2cab (patch)
treecac138aa4a3c5037f15cb748a6633012686d6dbd
parentc1be1b30791c56587cedd024006f6d20496e5eb8 (diff)
downloademacs-1770543d431e48624a4460e4bdaf979a346e2cab.tar.gz
emacs-1770543d431e48624a4460e4bdaf979a346e2cab.zip
(find-file-noselect): On VMS, maybe set buffer-file-name
to the truename. Depends on find-file-not-true-dirname-list
-rw-r--r--lisp/files.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index eb61fff1de1..038dc538a66 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -484,6 +484,13 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information."
484 (concat "~" (substring filename (match-end 0))))) 484 (concat "~" (substring filename (match-end 0)))))
485 filename)) 485 filename))
486 486
487(defvar find-file-not-true-dirname-list nil
488 "*List of logical names for which visiting shouldn't save the true dirname.
489On VMS, when you visit a file using a logical name that searches a path,
490you may or may not want the visited file name to record the specific
491directory where the file was found. If you *do not* want that, add the logical
492name to this list as a string.")
493
487(defun find-file-noselect (filename &optional nowarn) 494(defun find-file-noselect (filename &optional nowarn)
488 "Read file FILENAME into a buffer and return the buffer. 495 "Read file FILENAME into a buffer and return the buffer.
489If a buffer exists visiting FILENAME, return that one, but 496If a buffer exists visiting FILENAME, return that one, but
@@ -577,7 +584,16 @@ The buffer is not selected, just returned to the caller."
577 (setq hooks (cdr hooks)))))) 584 (setq hooks (cdr hooks))))))
578 ;; Find the file's truename, and maybe use that as visited name. 585 ;; Find the file's truename, and maybe use that as visited name.
579 (setq buffer-file-truename (abbreviate-file-name truename)) 586 (setq buffer-file-truename (abbreviate-file-name truename))
580 (setq buffer-file-number number) 587 (setq buffer-file-number number)
588 ;; On VMS, we may want to remember which directory in a search list
589 ;; the file was found in.
590 (and (eq system-type 'vax-vms)
591 (let (logical)
592 (if (string-match ":" (file-name-directory filename))
593 (setq logical (substring (file-name-directory filename)
594 0 (match-beginning 0))))
595 (not (member logical find-file-not-true-dirname-list)))
596 (setq buffer-file-name buffer-file-truename))
581 (if find-file-visit-truename 597 (if find-file-visit-truename
582 (setq buffer-file-name (setq filename buffer-file-truename))) 598 (setq buffer-file-name (setq filename buffer-file-truename)))
583 ;; Set buffer's default directory to that of the file. 599 ;; Set buffer's default directory to that of the file.