aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-03-05 18:46:36 +0000
committerRichard M. Stallman2007-03-05 18:46:36 +0000
commit2c5b1db7f5d4582ee735b2f33b29616f5e370244 (patch)
treef1871853c0dd434488c1b343d12714805967df18
parent4e776917b9d9d01f169310ee0ca7c40b7f348e85 (diff)
downloademacs-2c5b1db7f5d4582ee735b2f33b29616f5e370244.tar.gz
emacs-2c5b1db7f5d4582ee735b2f33b29616f5e370244.zip
(find-file-noselect): No error if file no longer exists.
Display a message and avoid other questions.
-rw-r--r--lisp/files.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 719cda70739..02b50123a50 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1474,11 +1474,12 @@ the various files."
1474 (error "Aborted")) 1474 (error "Aborted"))
1475 (if buf 1475 (if buf
1476 ;; We are using an existing buffer. 1476 ;; We are using an existing buffer.
1477 (progn 1477 (let (nonexistent)
1478 (or nowarn 1478 (or nowarn
1479 (verify-visited-file-modtime buf) 1479 (verify-visited-file-modtime buf)
1480 (cond ((not (file-exists-p filename)) 1480 (cond ((not (file-exists-p filename))
1481 (error "File %s no longer exists!" filename)) 1481 (setq nonexistent t)
1482 (message "File %s no longer exists!" filename))
1482 ;; Certain files should be reverted automatically 1483 ;; Certain files should be reverted automatically
1483 ;; if they have changed on disk and not in the buffer. 1484 ;; if they have changed on disk and not in the buffer.
1484 ((and (not (buffer-modified-p buf)) 1485 ((and (not (buffer-modified-p buf))
@@ -1515,7 +1516,8 @@ the various files."
1515 ;; writable and vice versa, but if the buffer agrees 1516 ;; writable and vice versa, but if the buffer agrees
1516 ;; with the new state of the file, that is ok too. 1517 ;; with the new state of the file, that is ok too.
1517 (let ((read-only (not (file-writable-p buffer-file-name)))) 1518 (let ((read-only (not (file-writable-p buffer-file-name))))
1518 (unless (or (eq read-only buffer-file-read-only) 1519 (unless (or nonexistent
1520 (eq read-only buffer-file-read-only)
1519 (eq read-only buffer-read-only)) 1521 (eq read-only buffer-read-only))
1520 (when (or nowarn 1522 (when (or nowarn
1521 (let ((question 1523 (let ((question
@@ -1528,6 +1530,7 @@ the various files."
1528 1530
1529 (when (and (not (eq (not (null rawfile)) 1531 (when (and (not (eq (not (null rawfile))
1530 (not (null find-file-literally)))) 1532 (not (null find-file-literally))))
1533 (not nonexistent)
1531 ;; It is confusing to ask whether to visit 1534 ;; It is confusing to ask whether to visit
1532 ;; non-literally if they have the file in 1535 ;; non-literally if they have the file in
1533 ;; hexl-mode. 1536 ;; hexl-mode.