summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLuc Teirlinck <teirllm@auburn.edu>2004-05-25 18:51:07 +0000
committerLuc Teirlinck <teirllm@auburn.edu>2004-05-25 18:51:07 +0000
commit74dca654a3b587d6ba9f12fedeafdbb30bde914e (patch)
tree916bfa56bd1c0f533097828f0c3dc87128a8de8a /lisp
parent6b67a5180dcb7547e0bbb63d1047031df63dbf3f (diff)
downloademacs-74dca654a3b587d6ba9f12fedeafdbb30bde914e.tar.gz
emacs-74dca654a3b587d6ba9f12fedeafdbb30bde914e.tar.bz2
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.
Diffstat (limited to 'lisp')
-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 @@
+2004-05-25 Luc Teirlinck <teirllm@auburn.edu>
+
+ * files.el (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.
+
2004-05-24 Nick Roberts <nickrob@gnu.org>
* 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."
(signal 'file-error (list "File is not readable"
filename)))
;; Unconditionally set error
- (setq error t)))))
- (condition-case ()
- (let ((inhibit-read-only t))
- (insert-file-contents filename t))
- (file-error
- (when (and (file-exists-p filename)
- (not (file-readable-p filename)))
- (kill-buffer buf)
- (signal 'file-error (list "File is not readable"
- filename)))
- ;; Run find-file-not-found-hooks until one returns non-nil.
- (or (run-hook-with-args-until-success 'find-file-not-found-functions)
- ;; If they fail too, set error.
- (setq error t))))
+ (setq error t)))
+ (condition-case ()
+ (insert-file-contents filename t)
+ (file-error
+ (when (and (file-exists-p filename)
+ (not (file-readable-p filename)))
+ (kill-buffer buf)
+ (signal 'file-error (list "File is not readable"
+ filename)))
+ ;; Run find-file-not-found-hooks until one returns non-nil.
+ (or (run-hook-with-args-until-success 'find-file-not-found-functions)
+ ;; If they fail too, set error.
+ (setq error t))))))
;; Record the file's truename, and maybe use that as visited name.
(if (equal filename buffer-file-name)
(setq buffer-file-truename truename)
@@ -4336,21 +4335,26 @@ normally equivalent short `-D' option is just passed on to
(when (looking-at "//SUBDIRED//")
(delete-region (point) (progn (forward-line 1) (point)))
(forward-line -1))
- (let ((end (line-end-position)))
- (forward-word 1)
- (forward-char 3)
- (while (< (point) end)
- (let ((start (+ beg (read (current-buffer))))
- (end (+ beg (read (current-buffer)))))
- (if (= (char-after end) ?\n)
- (put-text-property start end 'dired-filename t)
- ;; It seems that we can't trust ls's output as to
- ;; byte positions of filenames.
- (put-text-property beg (point) 'dired-filename nil)
- (end-of-line))))
- (goto-char end)
- (beginning-of-line)
- (delete-region (point) (progn (forward-line 2) (point)))))
+ (if (looking-at "//DIRED//")
+ (let ((end (line-end-position)))
+ (forward-word 1)
+ (forward-char 3)
+ (while (< (point) end)
+ (let ((start (+ beg (read (current-buffer))))
+ (end (+ beg (read (current-buffer)))))
+ (if (= (char-after end) ?\n)
+ (put-text-property start end 'dired-filename t)
+ ;; It seems that we can't trust ls's output as to
+ ;; byte positions of filenames.
+ (put-text-property beg (point) 'dired-filename nil)
+ (end-of-line))))
+ (goto-char end)
+ (beginning-of-line)
+ (delete-region (point) (progn (forward-line 2) (point))))
+ (forward-line 1)
+ (if (looking-at "//DIRED-OPTIONS//")
+ (delete-region (point) (progn (forward-line 1) (point)))
+ (forward-line 1))))
;; Now decode what read if necessary.
(let ((coding (or coding-system-for-read