X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c7bef6a4f033fa6b22906de0be6da54958d5b3c3..d6ec146ff9b66a1849932f90f3a5edade28d4579:/lisp/dired.el diff --git a/lisp/dired.el b/lisp/dired.el index 63124fce5e..38979b5244 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1453,7 +1453,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map "." 'dired-clean-directory) (define-key map "~" 'dired-flag-backup-files) ;; Upper case keys (except !) for operating on the marked files - (define-key map "A" 'dired-do-search) + (define-key map "A" 'dired-do-find-regexp) (define-key map "C" 'dired-do-copy) (define-key map "B" 'dired-do-byte-compile) (define-key map "D" 'dired-do-delete) @@ -1463,7 +1463,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map "M" 'dired-do-chmod) (define-key map "O" 'dired-do-chown) (define-key map "P" 'dired-do-print) - (define-key map "Q" 'dired-do-query-replace-regexp) + (define-key map "Q" 'dired-do-find-regexp-and-replace) (define-key map "R" 'dired-do-rename) (define-key map "S" 'dired-do-symlink) (define-key map "T" 'dired-do-touch) @@ -2740,9 +2740,18 @@ instead of `dired-actual-switches'." (save-excursion (goto-char (point-min)) (dired-goto-file-1 file file (point-max))) - ;; Otherwise, look for it as a relative name. The - ;; hair is to get the result of `dired-goto-subdir' - ;; without calling it if we don't have any subdirs. + ;; Next, look for it as a relative name with leading + ;; subdirectories. (This happens in Dired buffers + ;; created by find-dired, for example.) + (save-excursion + (goto-char (point-min)) + (dired-goto-file-1 (file-relative-name file + default-directory) + file (point-max))) + ;; Otherwise, look for it as a relative name, a base + ;; name only. The hair is to get the result of + ;; `dired-goto-subdir' without calling it if we don't + ;; have any subdirs. (save-excursion (when (if (string= dir (expand-file-name default-directory)) (goto-char (point-min)) @@ -3348,7 +3357,12 @@ object files--just `.o' will mark more than you might think." (defun dired-mark-files-containing-regexp (regexp &optional marker-char) "Mark all files with contents containing REGEXP for use in later commands. A prefix argument means to unmark them instead. -`.' and `..' are never marked." +`.' and `..' are never marked. + +Note that if a file is visited in an Emacs buffer, this command will +look in the buffer without revisiting the file, so the results might +be inconsistent with the file on disk if its contents has changed +since it was last visited." (interactive (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark") " files containing (regexp): ")