* lisp/locate.el (locate-mode): Setup invisibility for Dired commands

Also, use lexical-binding.
This commit is contained in:
Stefan Monnier 2019-03-18 14:25:49 -04:00
parent 799eb25797
commit fa80f93ad1

View file

@ -1,4 +1,4 @@
;;; locate.el --- interface to the locate command
;;; locate.el --- interface to the locate command -*- lexical-binding:t -*-
;; Copyright (C) 1996, 1998, 2001-2019 Free Software Foundation, Inc.
@ -261,7 +261,7 @@ that is, with a prefix arg, you get the default behavior."
"Run locate (like this): "
(cons
(concat (car locate-cmd) " "
(mapconcat 'identity (cdr locate-cmd) " "))
(mapconcat #'identity (cdr locate-cmd) " "))
(+ 2 (length (car locate-cmd))))
nil nil 'locate-history-list))
(let* ((default (locate-word-at-point))
@ -313,7 +313,7 @@ then `locate-post-command-hook'."
(and (not arg) locate-prompt-for-command))))
;; Find the Locate buffer
(save-window-excursion
(save-window-excursion ;FIXME: What window-excursion?
(set-buffer (get-buffer-create locate-buffer-name))
(locate-mode)
(let ((inhibit-read-only t)
@ -327,7 +327,7 @@ then `locate-post-command-hook'."
(if run-locate-command
(shell-command search-string locate-buffer-name)
(apply 'call-process locate-cmd nil t nil locate-cmd-args))
(apply #'call-process locate-cmd nil t nil locate-cmd-args))
(and filter
(locate-filter-output filter))
@ -466,8 +466,8 @@ do not work in subdirectories.
;; Avoid clobbering this variable
(make-local-variable 'dired-subdir-alist)
(setq default-directory "/"
buffer-read-only t
selective-display t)
buffer-read-only t)
(add-to-invisibility-spec '(dired . t))
(dired-alist-add-1 default-directory (point-min-marker))
(set (make-local-variable 'dired-directory) "/")
(set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches)
@ -554,7 +554,7 @@ do not work in subdirectories.
locate-regexp-match
(concat locate-regexp-match ":\n"))
(insert (apply 'format locate-format-string (reverse locate-format-args)))
(insert (apply #'format locate-format-string (reverse locate-format-args)))
(save-excursion
(goto-char (point-min))