* lisp/saveplace.el (save-place-to-alist): Add `dired-filename' as
[bpt/emacs.git] / lisp / dired.el
index 70fee53..e971a70 100644 (file)
@@ -34,6 +34,9 @@
 
 ;;; Code:
 
+(declare-function dired-buffer-more-recently-used-p
+                 "dired-x" (buffer1 buffer2))
+
 ;;; Customizable variables
 
 (defgroup dired nil
@@ -217,7 +220,7 @@ with the buffer narrowed to the listing."
 ;; Note this can't simply be run inside function `dired-ls' as the hook
 ;; functions probably depend on the dired-subdir-alist to be OK.
 
-(defcustom dired-initial-point-hook nil
+(defcustom dired-initial-position-hook nil
   "This hook is used to position the point.
 It is run the function `dired-initial-position'."
   :group 'dired
@@ -730,7 +733,9 @@ Don't use that together with FILTER."
 
 (defun dired-file-name-at-point ()
   "Try to get a file name at point in the current dired buffer.
-This hook is intended to be put in `file-name-at-point-functions'."
+This hook is intended to be put in `file-name-at-point-functions'.
+Note that it returns an abbreviated name that can't be used
+as an argument to `dired-goto-file'."
   (let ((filename (dired-get-filename nil t)))
     (when filename
       (if (file-directory-p filename)
@@ -1225,7 +1230,7 @@ see `dired-use-ls-dired' for more details.")
       (save-excursion
        (goto-char opoint)
        (when (and (or hdr wildcard)
-                  (not (and (looking-at-p "^  \\(.*\\):$")
+                  (not (and (looking-at "^  \\(.*\\):$")
                             (file-name-absolute-p (match-string 1)))))
          ;; Note that dired-build-subdir-alist will replace the name
          ;; by its expansion, so it does not matter whether what we insert
@@ -1242,26 +1247,25 @@ see `dired-use-ls-dired' for more details.")
   (save-excursion
     (goto-char beg)
     (while (< (point) end)
-      (condition-case nil
-         (if (not (dired-move-to-filename))
-             (put-text-property (line-beginning-position)
-                                (1+ (line-end-position))
-                                'invisible 'dired-hide-details-information)
-           (put-text-property (+ (line-beginning-position) 1) (1- (point))
-                              'invisible 'dired-hide-details-detail)
-           (add-text-properties
-            (point)
-            (progn
-              (dired-move-to-end-of-filename)
-              (point))
-            '(mouse-face
-              highlight
-              dired-filename t
-              help-echo "mouse-2: visit this file in other window"))
-           (when (< (+ (point) 4) (line-end-position))
-             (put-text-property (+ (point) 4) (line-end-position)
-                                'invisible 'dired-hide-details-link)))
-       (error nil))
+      (ignore-errors
+       (if (not (dired-move-to-filename))
+           (put-text-property (line-beginning-position)
+                              (1+ (line-end-position))
+                              'invisible 'dired-hide-details-information)
+         (put-text-property (+ (line-beginning-position) 1) (1- (point))
+                            'invisible 'dired-hide-details-detail)
+         (add-text-properties
+          (point)
+          (progn
+            (dired-move-to-end-of-filename)
+            (point))
+          '(mouse-face
+            highlight
+            dired-filename t
+            help-echo "mouse-2: visit this file in other window"))
+         (when (< (+ (point) 4) (line-end-position))
+           (put-text-property (+ (point) 4) (line-end-position)
+                              'invisible 'dired-hide-details-link))))
       (forward-line 1))))
 \f
 ;; Reverting a dired buffer
@@ -1401,11 +1405,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
          (setq elt (car old-subdir-alist)
                old-subdir-alist (cdr old-subdir-alist)
                dir (car elt))
-         (condition-case ()
-             (progn
-               (dired-uncache dir)
-               (dired-insert-subdir dir))
-           (error nil))))))
+         (ignore-errors
+           (dired-uncache dir)
+           (dired-insert-subdir dir))))))
 
 (defun dired-uncache (dir)
   "Remove directory DIR from any directory cache."
@@ -2763,7 +2765,7 @@ It runs the hook `dired-initial-position-hook'."
   (and (featurep 'dired-x) dired-find-subdir
        (dired-goto-subdir dirname))
   (if dired-trivial-filenames (dired-goto-next-nontrivial-file))
-  (run-hooks 'dired-initial-point-hook))
+  (run-hooks 'dired-initial-position-hook))
 \f
 ;; These are hooks which make tree dired work.
 ;; They are in this file because other parts of dired need to call them.
@@ -3079,24 +3081,23 @@ argument or confirmation)."
       (apply function args)
     (let ((buffer (get-buffer-create (or buffer-or-name " *Marked Files*"))))
       (with-current-buffer buffer
-       (let ((split-height-threshold 0))
-         (with-temp-buffer-window
-          buffer
-          (cons 'display-buffer-below-selected
-                '((window-height . fit-window-to-buffer)))
-          #'(lambda (window _value)
-              (with-selected-window window
-                (unwind-protect
-                    (apply function args)
-                  (when (window-live-p window)
-                    (quit-restore-window window 'kill)))))
-          ;; Handle (t FILE) just like (FILE), here.  That value is
-          ;; used (only in some cases), to mean just one file that was
-          ;; marked, rather than the current line file.
-          (dired-format-columns-of-files
-           (if (eq (car files) t) (cdr files) files))
-          (remove-text-properties (point-min) (point-max)
-                                  '(mouse-face nil help-echo nil))))))))
+       (with-temp-buffer-window
+        buffer
+        (cons 'display-buffer-below-selected
+              '((window-height . fit-window-to-buffer)))
+        #'(lambda (window _value)
+            (with-selected-window window
+              (unwind-protect
+                  (apply function args)
+                (when (window-live-p window)
+                  (quit-restore-window window 'kill)))))
+        ;; Handle (t FILE) just like (FILE), here.  That value is
+        ;; used (only in some cases), to mean just one file that was
+        ;; marked, rather than the current line file.
+        (dired-format-columns-of-files
+         (if (eq (car files) t) (cdr files) files))
+        (remove-text-properties (point-min) (point-max)
+                                '(mouse-face nil help-echo nil)))))))
 
 (defun dired-format-columns-of-files (files)
   (let ((beg (point)))
@@ -3849,22 +3850,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
 \f
 ;;; Start of automatically extracted autoloads.
 \f
-;;;### (autoloads (dired-show-file-type dired-do-query-replace-regexp
-;;;;;;  dired-do-search dired-do-isearch-regexp dired-do-isearch
-;;;;;;  dired-isearch-filenames-regexp dired-isearch-filenames dired-isearch-filenames-setup
-;;;;;;  dired-hide-all dired-hide-subdir dired-tree-down dired-tree-up
-;;;;;;  dired-kill-subdir dired-mark-subdir-files dired-goto-subdir
-;;;;;;  dired-prev-subdir dired-insert-subdir dired-maybe-insert-subdir
-;;;;;;  dired-downcase dired-upcase dired-do-symlink-regexp dired-do-hardlink-regexp
-;;;;;;  dired-do-copy-regexp dired-do-rename-regexp dired-do-rename
-;;;;;;  dired-do-hardlink dired-do-symlink dired-do-copy dired-create-directory
-;;;;;;  dired-rename-file dired-copy-file dired-relist-file dired-remove-file
-;;;;;;  dired-add-file dired-do-redisplay dired-do-load dired-do-byte-compile
-;;;;;;  dired-do-compress dired-query dired-compress-file dired-do-kill-lines
-;;;;;;  dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
-;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
-;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "8f5af3aa4eee1b3448525896fa6f39a3")
+;;;### (autoloads nil "dired-aux" "dired-aux.el" "4cb9d594789dacdf2445f338b9189357")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
@@ -4367,7 +4353,7 @@ instead.
 
 ;;;***
 \f
-;;;### (autoloads nil "dired-x" "dired-x.el" "4b863621846609105c0371f8ffb8c1cf")
+;;;### (autoloads nil "dired-x" "dired-x.el" "732d08c173295dd14a0736fa222f532a")
 ;;; Generated autoloads from dired-x.el
 
 (autoload 'dired-jump "dired-x" "\