summaryrefslogtreecommitdiff
path: root/lisp/locate.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-12-31 18:31:13 +0000
committerRichard M. Stallman <rms@gnu.org>1996-12-31 18:31:13 +0000
commit5c6a8dfe15d2c3c013e13527b72006667b6db549 (patch)
treef8f820a675482ccde32c3a926c52824aef4e499f /lisp/locate.el
parent827dc60de5855094b96c2729cd5572d2425757f0 (diff)
downloademacs-5c6a8dfe15d2c3c013e13527b72006667b6db549.tar.gz
(locate-mode): Locally set dired-move-to-filename-regexp,
dired-permission-flags-regexp, and dired-actual-switches. (locate-set-indentation): Function deleted. (locate-insert-header): Don't indent the header line. (locate-indentation-string): Variable deleted. (locate-do-setup): Rewrite the loop that adds indentation.
Diffstat (limited to 'lisp/locate.el')
-rw-r--r--lisp/locate.el44
1 files changed, 12 insertions, 32 deletions
diff --git a/lisp/locate.el b/lisp/locate.el
index ed9c6a7eb6d..9084a1021bb 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -27,22 +27,6 @@
;; the result.
;;
-;; Installation:
-;;
-;; Place the following in your .emacs file:
-;;
-;; ;; redefines dired-get-filename as a switch function
-;;
-;; (require 'advice)
-;; (defadvice dired-get-filename (around check-mode activate)
-;; "Use an alternative function in Locate mode"
-;; (cond ((eq major-mode 'locate-mode)
-;; (setq ad-return-value (locate-get-filename)))
-;; (t
-;; ad-do-it)))
-;;
-;; DOS and WINDOWS Users:
-;;
;;;;; Building a database of files ;;;;;;;;;
;;
;; You can create a simple files database with a port of the Unix find command
@@ -236,11 +220,6 @@
(defconst locate-filename-indentation 4
"The amount of indentation for each file.")
-;; 32 is the ASCII code for SPACE character
-(defconst locate-indentation-string
- (make-string locate-filename-indentation 32)
- "The indentation string for each file.")
-
(defun locate-get-file-positions ()
(save-excursion
(end-of-line)
@@ -285,6 +264,13 @@
mode-name "Locate"
default-directory "/"
dired-subdir-alist (list (cons "/" (point-min-marker))))
+ (make-local-variable 'dired-move-to-filename-regexp)
+ (setq dired-move-to-filename-regexp
+ (make-string locate-filename-indentation ?\ ))
+ (make-local-variable 'dired-actual-switches)
+ (setq dired-actual-switches "")
+ (make-local-variable 'dired-permission-flags-regexp)
+ (setq dired-permission-flags-regexp "^\\( \\)")
(run-hooks 'locate-mode-hook))
(defun locate-do-setup ()
@@ -304,15 +290,10 @@
(locate-insert-header search-string)
- (while (progn
- (locate-set-indentation)
- (locate-set-properties)
- (zerop (forward-line)))))))
-
-(defun locate-set-indentation ()
- (save-excursion
- (beginning-of-line)
- (insert locate-indentation-string)))
+ (while (not (eobp))
+ (insert-char ?\ locate-filename-indentation t)
+ (locate-set-properties)
+ (forward-line 1)))))
(defun locate-set-properties ()
(save-excursion
@@ -355,8 +336,7 @@
locate-regexp-match
(concat locate-regexp-match ": \n"))
- (insert locate-indentation-string
- (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))