aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2011-07-13 01:25:50 +0200
committerLars Magne Ingebrigtsen2011-07-13 01:25:50 +0200
commit7152b011c2bae3bfcb7a6d195911ba52e4d112b3 (patch)
tree350d3e755ad2526356877f93354271b6d7cf5172 /lisp
parent536f3d362f589a3045617f8e4ed25478b8c892e8 (diff)
downloademacs-7152b011c2bae3bfcb7a6d195911ba52e4d112b3.tar.gz
emacs-7152b011c2bae3bfcb7a6d195911ba52e4d112b3.zip
Give better error messages when trying to load non-existent symlinks
* files.el (after-find-file): Give a better error message when trying to find a symlink that points to a file that doesn't exist (bug#4398).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/files.el6
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d75309e905..19c80a65888 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org> 12011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * files.el (after-find-file): Give a better error message when
4 trying to find a symlink that points to a file that doesn't exist
5 (bug#4398).
6
3 * progmodes/cc-vars.el: Remove (probably) misleading comment 7 * progmodes/cc-vars.el: Remove (probably) misleading comment
4 (bug#4396). 8 (bug#4396).
5 9
diff --git a/lisp/files.el b/lisp/files.el
index 1071adb6967..bf38ce39a07 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2060,7 +2060,11 @@ unless NOMODES is non-nil."
2060 ((not warn) nil) 2060 ((not warn) nil)
2061 ((and error (file-attributes buffer-file-name)) 2061 ((and error (file-attributes buffer-file-name))
2062 (setq buffer-read-only t) 2062 (setq buffer-read-only t)
2063 "File exists, but cannot be read") 2063 (if (and (file-symlink-p buffer-file-name)
2064 (not (file-exists-p
2065 (file-chase-links buffer-file-name))))
2066 "Symbolic link that points to nonexistent file"
2067 "File exists, but cannot be read"))
2064 ((not buffer-read-only) 2068 ((not buffer-read-only)
2065 (if (and warn 2069 (if (and warn
2066 ;; No need to warn if buffer is auto-saved 2070 ;; No need to warn if buffer is auto-saved