changeset 56035:e3ace501b5f4

(dired-revert): If buffer is marked unmodified before reverting, keep it marked unmodified. Adapt to new conventions for commenting out code. (dired-make-relative): Adapt to new conventions for commenting out code.
author Luc Teirlinck <teirllm@auburn.edu>
date Fri, 11 Jun 2004 22:36:07 +0000
parents 161424b0c2f5
children ff6f1f61fea4
files lisp/dired.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Fri Jun 11 21:48:22 2004 +0000
+++ b/lisp/dired.el	Fri Jun 11 22:36:07 2004 +0000
@@ -880,7 +880,8 @@
 Should not fail even on completely garbaged buffers.
 Preserves old cursor, marks/flags, hidden-p."
   (widen)				; just in case user narrowed
-  (let ((opoint (point))
+  (let ((modflag (buffer-modified-p))
+	(opoint (point))
 	(ofile (dired-get-filename nil t))
 	(mark-alist nil)		; save marked files
 	(hidden-subdirs (dired-remember-hidden))
@@ -907,9 +908,10 @@
     (save-excursion			; hide subdirs that were hidden
       (dolist (dir hidden-subdirs)
 	(if (dired-goto-subdir dir)
-	    (dired-hide-subdir 1)))))
+	    (dired-hide-subdir 1))))
+    (unless modflag (restore-buffer-modified-p nil)))
   ;; outside of the let scope
-;;; Might as well not override the user if the user changed this.
+;;;  Might as well not override the user if the user changed this.
 ;;;  (setq buffer-read-only t)
   )
 
@@ -1707,7 +1709,7 @@
       (setq dir (expand-file-name dir)))
   (if (string-match (concat "^" (regexp-quote dir)) file)
       (substring file (match-end 0))
-;;; (or no-error
+;;;  (or no-error
 ;;;	(error "%s: not in directory tree growing at %s" file dir))
     file))