comparison lisp/files.el @ 2622:15cb6ba42da3

(find-file-noselect): On VMS, maybe set buffer-file-name to the truename. Depends on find-file-not-true-dirname-list
author Richard M. Stallman <rms@gnu.org>
date Sun, 02 May 1993 12:46:26 +0000
parents 709f672f450e
children 47cf3a387530
comparison
equal deleted inserted replaced
2621:40bed0333cd3 2622:15cb6ba42da3
481 ;; make it start with `~' instead. 481 ;; make it start with `~' instead.
482 (if (string-match abbreviated-home-dir filename) 482 (if (string-match abbreviated-home-dir filename)
483 (setq filename 483 (setq filename
484 (concat "~" (substring filename (match-end 0))))) 484 (concat "~" (substring filename (match-end 0)))))
485 filename)) 485 filename))
486
487 (defvar find-file-not-true-dirname-list nil
488 "*List of logical names for which visiting shouldn't save the true dirname.
489 On VMS, when you visit a file using a logical name that searches a path,
490 you may or may not want the visited file name to record the specific
491 directory where the file was found. If you *do not* want that, add the logical
492 name to this list as a string.")
486 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.
489 If a buffer exists visiting FILENAME, return that one, but 496 If a buffer exists visiting FILENAME, return that one, but
490 verify that the file has not changed since visited or saved. 497 verify that the file has not changed since visited or saved.
575 (while (and hooks 582 (while (and hooks
576 (not (funcall (car hooks)))) 583 (not (funcall (car hooks))))
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.
584 (setq default-directory (file-name-directory filename)) 600 (setq default-directory (file-name-directory filename))
585 ;; Turn off backup files for certain file names. Since 601 ;; Turn off backup files for certain file names. Since