comparison lisp/files.el @ 31724:187803ce240e

(find-file-suppress-same-file-warnings): New user-option. (find-file-noselect): Use it.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 19 Sep 2000 15:14:24 +0000
parents 46752ce55a92
children ce648c184860
comparison
equal deleted inserted replaced
31723:8162eb7a8a98 31724:187803ce240e
964 whose names match the pattern." 964 whose names match the pattern."
965 :group 'files 965 :group 'files
966 :version "20.4" 966 :version "20.4"
967 :type 'boolean) 967 :type 'boolean)
968 968
969 (defcustom find-file-suppress-same-file-warnings nil
970 "*Non-nil means suppress warning messages for symlinked files.
971 When nil, Emacs prints a warning when visiting a file that is already
972 visited, but with a different name. Setting this option to t
973 suppresses this warning "
974 :group 'files
975 :version "21.1"
976 :type 'boolean)
977
969 (defun find-file-noselect (filename &optional nowarn rawfile wildcards) 978 (defun find-file-noselect (filename &optional nowarn rawfile wildcards)
970 "Read file FILENAME into a buffer and return the buffer. 979 "Read file FILENAME into a buffer and return the buffer.
971 If a buffer exists visiting FILENAME, return that one, but 980 If a buffer exists visiting FILENAME, return that one, but
972 verify that the file has not changed since visited or saved. 981 verify that the file has not changed since visited or saved.
973 The buffer is not selected, just returned to the caller. 982 The buffer is not selected, just returned to the caller.
1006 (other (and (not buf) (find-buffer-visiting filename)))) 1015 (other (and (not buf) (find-buffer-visiting filename))))
1007 ;; Let user know if there is a buffer with the same truename. 1016 ;; Let user know if there is a buffer with the same truename.
1008 (if other 1017 (if other
1009 (progn 1018 (progn
1010 (or nowarn 1019 (or nowarn
1020 find-file-suppress-same-file-warnings
1011 (string-equal filename (buffer-file-name other)) 1021 (string-equal filename (buffer-file-name other))
1012 (message "%s and %s are the same file" 1022 (message "%s and %s are the same file"
1013 filename (buffer-file-name other))) 1023 filename (buffer-file-name other)))
1014 ;; Optionally also find that buffer. 1024 ;; Optionally also find that buffer.
1015 (if (or find-file-existing-other-name find-file-visit-truename) 1025 (if (or find-file-existing-other-name find-file-visit-truename)