Function: locate-mode
locate-mode is an interactive and byte-compiled function defined in
locate.el.gz.
Signature
(locate-mode)
Documentation
Major mode for the *Locate* buffer made by M-x locate (locate).
In that buffer, you can use almost all the usual Dired bindings.
V (locate-find-directory) visits the directory of the file on the current line.
This function runs locate-mode-hook before returning.
Operating on listed files works, but does not always
automatically update the buffer as in ordinary Dired.
This is true both for the main listing and for subdirectories.
Reverting the buffer using g (revert-buffer) deletes all subdirectories.
Specific locate-mode commands, such as V (locate-find-directory),
do not work in subdirectories.
! dired-do-shell-command
# dired-flag-auto-save-files
$ dired-hide-subdir
% & dired-flag-garbage-files
% C dired-do-copy-regexp
% H dired-do-hardlink-regexp
% R dired-do-rename-regexp
% S dired-do-symlink-regexp
% Y dired-do-relsymlink-regexp
% d dired-flag-files-regexp
% g dired-mark-files-containing-regexp
% l dired-downcase
% m dired-mark-files-regexp
% r dired-do-rename-regexp
% u dired-upcase
& dired-do-async-shell-command
( dired-hide-details-mode(var)/dired-hide-details-mode(fun)
* ! dired-unmark-all-marks
* % dired-mark-files-regexp
* * dired-mark-executables
* / dired-mark-directories
* ? dired-unmark-all-files
* @ dired-mark-symlinks
* C-n dired-next-marked-file
* C-p dired-prev-marked-file
* DEL dired-unmark-backward
* N dired-number-of-marked-files
* c dired-change-marks
* m dired-mark
* s dired-mark-subdir-files
* t dired-toggle-marks
* u dired-unmark
+ dired-create-directory
- negative-argument
. dired-clean-directory
0 digit-argument
1 digit-argument
2 digit-argument
3 digit-argument
4 digit-argument
5 digit-argument
6 digit-argument
7 digit-argument
8 digit-argument
9 digit-argument
: d epa-dired-do-decrypt
: e epa-dired-do-encrypt
: s epa-dired-do-sign
: v epa-dired-do-verify
< beginning-of-buffer
< dired-prev-dirline
<follow-link> mouse-face
<mouse-2> dired-mouse-find-file-other-window
<touchscreen-hold> dired-enable-click-to-select-mode
= dired-diff
> dired-next-dirline
> end-of-buffer
? describe-mode
? dired-summary
@ hycontrol-windows-grid
A dired-do-find-regexp
B dired-do-byte-compile
C dired-do-copy
C-M-d dired-tree-down
C-M-n dired-next-subdir
C-M-p dired-prev-subdir
C-M-u dired-tree-up
C-c C-t locate-tags
C-n dired-next-line
C-o dired-display-file
C-p dired-previous-line
C-t . image-dired-display-thumb
C-t C-t image-dired-dired-toggle-marked-thumbs
C-t a image-dired-display-thumbs-append
C-t c image-dired-dired-comment-files
C-t d image-dired-display-thumbs
C-t e image-dired-dired-edit-comment-and-tags
C-t f image-dired-mark-tagged-files
C-t i image-dired-dired-display-image
C-t j image-dired-jump-thumbnail-buffer
C-t r image-dired-delete-tag
C-t t image-dired-tag-files
C-t x image-dired-dired-display-external
C-x C-q dired-toggle-read-only
C-x u dired-undo
C-x v v dired-vc-next-action
D dired-do-delete
DEL dired-unmark-backward
DEL scroll-down-command
E dired-do-open
G dired-do-chgrp
H dired-do-hardlink
I dired-do-info
L dired-do-load
M dired-do-chmod
M-$ dired-hide-all
M-<mouse-2> locate-mouse-view-file
M-DEL dired-unmark-all-files
M-G dired-goto-subdir
M-s a C-M-s dired-do-isearch-regexp
M-s a C-s dired-do-isearch
M-s f C-M-s dired-isearch-filenames-regexp
M-s f C-s dired-isearch-filenames(var)/dired-isearch-filenames(fun)
M-{ dired-prev-marked-file
M-} dired-next-marked-file
N dired-do-man
O dired-do-chown
P dired-do-print
Q dired-do-find-regexp-and-replace
R dired-do-rename
RET dired-find-file
S dired-do-symlink
S-SPC dired-previous-line
S-SPC scroll-down-command
SPC dired-next-line
SPC scroll-up-command
SPC..~ undefined
T dired-do-touch
U dired-unmark-all-files
V locate-find-directory
W browse-url-of-dired-file
X dired-do-shell-command
Y dired-do-relsymlink
Z dired-do-compress
^ dired-up-directory
a dired-find-alternate-file
c dired-do-compress-to
d dired-flag-file-deletion
g revert-buffer
g revert-buffer
h describe-mode
i dired-maybe-insert-subdir
j dired-goto-file
k dired-do-kill-lines
l locate-do-redisplay
m dired-mark
n dired-next-line
o dired-find-file-other-window
p dired-previous-line
q quit-window
s dired-sort-toggle-or-edit
t dired-toggle-marks
u dired-unmark
v dired-view-file
w dired-copy-filename-as-kill
x dired-do-flagged-delete
y dired-show-file-type
~ dired-flag-backup-files
..\x3FFFFF dired-find-file
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/locate.el.gz
;; Define a mode for locate
;; Default directory is set to "/" so that dired commands, which
;; expect to be in a tree, will work properly
(define-derived-mode locate-mode special-mode "Locate"
"Major mode for the `*Locate*' buffer made by \\[locate].
\\<locate-mode-map>\
In that buffer, you can use almost all the usual Dired bindings.
\\[locate-find-directory] visits the directory of the file on the current line.
This function runs `locate-mode-hook' before returning.
Operating on listed files works, but does not always
automatically update the buffer as in ordinary Dired.
This is true both for the main listing and for subdirectories.
Reverting the buffer using \\[revert-buffer] deletes all subdirectories.
Specific `locate-mode' commands, such as \\[locate-find-directory],
do not work in subdirectories.
\\{locate-mode-map}"
(setq default-directory "/"
buffer-read-only t)
(add-to-invisibility-spec '(dired . t))
(dired-alist-add-1 default-directory (point-min-marker))
(setq dired-directory "/")
(setq-local dired-subdir-switches locate-ls-subdir-switches)
(setq dired-switches-alist nil)
;; This should support both Unix and Windoze style names
(setq-local directory-listing-before-filename-regexp
(concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s)
"\\)\\|"
(default-value
'directory-listing-before-filename-regexp)))
(setq-local dired-actual-switches "")
(setq-local dired-permission-flags-regexp
(concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s)
"\\)\\|"
(default-value 'dired-permission-flags-regexp)))
(setq-local revert-buffer-function #'locate-update)
(setq-local page-delimiter "\n\n"))