comparison lisp/dired.el @ 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 e7e7513282b4
children fb8b1f758f89 4c90ffeb71c5
comparison
equal deleted inserted replaced
56034:161424b0c2f5 56035:e3ace501b5f4
878 "Reread the dired buffer. 878 "Reread the dired buffer.
879 Must also be called after dired-actual-switches have changed. 879 Must also be called after dired-actual-switches have changed.
880 Should not fail even on completely garbaged buffers. 880 Should not fail even on completely garbaged buffers.
881 Preserves old cursor, marks/flags, hidden-p." 881 Preserves old cursor, marks/flags, hidden-p."
882 (widen) ; just in case user narrowed 882 (widen) ; just in case user narrowed
883 (let ((opoint (point)) 883 (let ((modflag (buffer-modified-p))
884 (opoint (point))
884 (ofile (dired-get-filename nil t)) 885 (ofile (dired-get-filename nil t))
885 (mark-alist nil) ; save marked files 886 (mark-alist nil) ; save marked files
886 (hidden-subdirs (dired-remember-hidden)) 887 (hidden-subdirs (dired-remember-hidden))
887 (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd 888 (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd
888 (case-fold-search nil) ; we check for upper case ls flags 889 (case-fold-search nil) ; we check for upper case ls flags
905 (goto-char opoint)) ; was before 906 (goto-char opoint)) ; was before
906 (dired-move-to-filename) 907 (dired-move-to-filename)
907 (save-excursion ; hide subdirs that were hidden 908 (save-excursion ; hide subdirs that were hidden
908 (dolist (dir hidden-subdirs) 909 (dolist (dir hidden-subdirs)
909 (if (dired-goto-subdir dir) 910 (if (dired-goto-subdir dir)
910 (dired-hide-subdir 1))))) 911 (dired-hide-subdir 1))))
912 (unless modflag (restore-buffer-modified-p nil)))
911 ;; outside of the let scope 913 ;; outside of the let scope
912 ;;; Might as well not override the user if the user changed this. 914 ;;; Might as well not override the user if the user changed this.
913 ;;; (setq buffer-read-only t) 915 ;;; (setq buffer-read-only t)
914 ) 916 )
915 917
916 ;; Subroutines of dired-revert 918 ;; Subroutines of dired-revert
917 ;; Some of these are also used when inserting subdirs. 919 ;; Some of these are also used when inserting subdirs.
1705 ;; use ~. 1707 ;; use ~.
1706 (if (and (> (length dir) 0) (= (aref dir 0) ?~)) 1708 (if (and (> (length dir) 0) (= (aref dir 0) ?~))
1707 (setq dir (expand-file-name dir))) 1709 (setq dir (expand-file-name dir)))
1708 (if (string-match (concat "^" (regexp-quote dir)) file) 1710 (if (string-match (concat "^" (regexp-quote dir)) file)
1709 (substring file (match-end 0)) 1711 (substring file (match-end 0))
1710 ;;; (or no-error 1712 ;;; (or no-error
1711 ;;; (error "%s: not in directory tree growing at %s" file dir)) 1713 ;;; (error "%s: not in directory tree growing at %s" file dir))
1712 file)) 1714 file))
1713 1715
1714 ;;; Functions for finding the file name in a dired buffer line. 1716 ;;; Functions for finding the file name in a dired buffer line.
1715 1717