aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-05-25 18:51:07 +0000
committerLuc Teirlinck2004-05-25 18:51:07 +0000
commit74dca654a3b587d6ba9f12fedeafdbb30bde914e (patch)
tree916bfa56bd1c0f533097828f0c3dc87128a8de8a
parent6b67a5180dcb7547e0bbb63d1047031df63dbf3f (diff)
downloademacs-74dca654a3b587d6ba9f12fedeafdbb30bde914e.tar.gz
emacs-74dca654a3b587d6ba9f12fedeafdbb30bde914e.zip
(find-file-noselect-1): Fix bug introduced by Revision 1.694.
As a side effect, `inhibit-read-only' is again, by default, t during execution of `find-file-not-found-functions'. (insert-directory): Check that lines were really inserted by the --dired switch, before erasing them.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/files.el62
2 files changed, 42 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 24432ea0e3d..9cfd96f7075 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12004-05-25 Luc Teirlinck <teirllm@auburn.edu>
2
3 * files.el (find-file-noselect-1): Fix bug introduced by
4 Revision 1.694. As a side effect, `inhibit-read-only'
5 is again, by default, t during execution of
6 `find-file-not-found-functions'.
7 (insert-directory): Check that lines were really inserted by
8 the --dired switch, before erasing them.
9
12004-05-24 Nick Roberts <nickrob@gnu.org> 102004-05-24 Nick Roberts <nickrob@gnu.org>
2 11
3 * progmodes/gdb-ui.el (gdb-breakpoints-mode, gdb-frames-mode) 12 * progmodes/gdb-ui.el (gdb-breakpoints-mode, gdb-frames-mode)
diff --git a/lisp/files.el b/lisp/files.el
index ccd30a4de30..06792a0d04e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1379,20 +1379,19 @@ that are visiting the various files."
1379 (signal 'file-error (list "File is not readable" 1379 (signal 'file-error (list "File is not readable"
1380 filename))) 1380 filename)))
1381 ;; Unconditionally set error 1381 ;; Unconditionally set error
1382 (setq error t))))) 1382 (setq error t)))
1383 (condition-case () 1383 (condition-case ()
1384 (let ((inhibit-read-only t)) 1384 (insert-file-contents filename t)
1385 (insert-file-contents filename t)) 1385 (file-error
1386 (file-error 1386 (when (and (file-exists-p filename)
1387 (when (and (file-exists-p filename) 1387 (not (file-readable-p filename)))
1388 (not (file-readable-p filename))) 1388 (kill-buffer buf)
1389 (kill-buffer buf) 1389 (signal 'file-error (list "File is not readable"
1390 (signal 'file-error (list "File is not readable" 1390 filename)))
1391 filename))) 1391 ;; Run find-file-not-found-hooks until one returns non-nil.
1392 ;; Run find-file-not-found-hooks until one returns non-nil. 1392 (or (run-hook-with-args-until-success 'find-file-not-found-functions)
1393 (or (run-hook-with-args-until-success 'find-file-not-found-functions) 1393 ;; If they fail too, set error.
1394 ;; If they fail too, set error. 1394 (setq error t))))))
1395 (setq error t))))
1396 ;; Record the file's truename, and maybe use that as visited name. 1395 ;; Record the file's truename, and maybe use that as visited name.
1397 (if (equal filename buffer-file-name) 1396 (if (equal filename buffer-file-name)
1398 (setq buffer-file-truename truename) 1397 (setq buffer-file-truename truename)
@@ -4336,21 +4335,26 @@ normally equivalent short `-D' option is just passed on to
4336 (when (looking-at "//SUBDIRED//") 4335 (when (looking-at "//SUBDIRED//")
4337 (delete-region (point) (progn (forward-line 1) (point))) 4336 (delete-region (point) (progn (forward-line 1) (point)))
4338 (forward-line -1)) 4337 (forward-line -1))
4339 (let ((end (line-end-position))) 4338 (if (looking-at "//DIRED//")
4340 (forward-word 1) 4339 (let ((end (line-end-position)))
4341 (forward-char 3) 4340 (forward-word 1)
4342 (while (< (point) end) 4341 (forward-char 3)
4343 (let ((start (+ beg (read (current-buffer)))) 4342 (while (< (point) end)
4344 (end (+ beg (read (current-buffer))))) 4343 (let ((start (+ beg (read (current-buffer))))
4345 (if (= (char-after end) ?\n) 4344 (end (+ beg (read (current-buffer)))))
4346 (put-text-property start end 'dired-filename t) 4345 (if (= (char-after end) ?\n)
4347 ;; It seems that we can't trust ls's output as to 4346 (put-text-property start end 'dired-filename t)
4348 ;; byte positions of filenames. 4347 ;; It seems that we can't trust ls's output as to
4349 (put-text-property beg (point) 'dired-filename nil) 4348 ;; byte positions of filenames.
4350 (end-of-line)))) 4349 (put-text-property beg (point) 'dired-filename nil)
4351 (goto-char end) 4350 (end-of-line))))
4352 (beginning-of-line) 4351 (goto-char end)
4353 (delete-region (point) (progn (forward-line 2) (point))))) 4352 (beginning-of-line)
4353 (delete-region (point) (progn (forward-line 2) (point))))
4354 (forward-line 1)
4355 (if (looking-at "//DIRED-OPTIONS//")
4356 (delete-region (point) (progn (forward-line 1) (point)))
4357 (forward-line 1))))
4354 4358
4355 ;; Now decode what read if necessary. 4359 ;; Now decode what read if necessary.
4356 (let ((coding (or coding-system-for-read 4360 (let ((coding (or coding-system-for-read