GNU bug report logs -
#5462
23.1; [patch] locate.el: defcustomizing *-hooks
Previous Next
Reported by: Eduard Wiebe <ew <at> pusto.de>
Date: Sun, 24 Jan 2010 12:40:03 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 28 Nov 2010 21:46:23 +0200
with message-id <83hbf19qpc.fsf <at> gnu.org>
and subject line Re: bug#7308: [patch] locate under windoze
has caused the GNU bug report #5462,
regarding 23.1; [patch] locate.el: defcustomizing *-hooks
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
5462: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5462
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hello,
How about this patch?
[locate.chlog (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]
My rational: Hook variables were't documented and uncustomizable. Dired
regexps are to complex for plain locate output, this results in patial
highlighting of file names in *Locate* buffer (e.g. first char is not
highlighted under mouse).
[locate.diff (text/x-patch, inline)]
diff --git a/lisp/locate.el b/lisp/locate.el
index d0021df..f461db4 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -226,6 +226,16 @@ that is, with a prefix arg, you get the default behavior."
:group 'locate
:type 'boolean)
+(defcustom locate-mode-hook nil
+ "Run at the end of `locate-mode'."
+ :group 'locate
+ :type 'hook)
+
+(defcustom locate-post-command-hook nil
+ "Hook run after each locate command is executed."
+ :group 'locate
+ :type 'hook)
+
;; Functions
(defun locate-default-make-command-line (search-string)
@@ -300,8 +310,7 @@ ARG is the interactive prefix arg."
(locate-cmd-args (cdr locate-cmd-list))
(run-locate-command
(or (and arg (not locate-prompt-for-command))
- (and (not arg) locate-prompt-for-command)))
- )
+ (and (not arg) locate-prompt-for-command))))
;; Find the Locate buffer
(save-window-excursion
@@ -310,7 +319,6 @@ ARG is the interactive prefix arg."
(let ((inhibit-read-only t)
(buffer-undo-list t))
(erase-buffer)
-
(setq locate-current-filter filter)
(set (make-local-variable 'locate-local-search) search-string)
(set (make-local-variable 'locate-local-filter) filter)
@@ -320,19 +328,15 @@ ARG is the interactive prefix arg."
(shell-command search-string locate-buffer-name)
(apply 'call-process locate-cmd nil t nil locate-cmd-args))
- (and filter
- (locate-filter-output filter))
-
- (locate-do-setup search-string)
- ))
+ (and filter (locate-filter-output filter))
+ (locate-do-setup search-string)))
+
(and (not (string-equal (buffer-name) locate-buffer-name))
- (switch-to-buffer-other-window locate-buffer-name))
+ (switch-to-buffer-other-window locate-buffer-name))
(run-hooks 'dired-mode-hook)
(dired-next-line 3) ;move to first matching file.
- (run-hooks 'locate-post-command-hook)
- )
- )
+ (run-hooks 'locate-post-command-hook)))
;;;###autoload
(defun locate-with-filter (search-string filter &optional arg)
@@ -464,8 +468,7 @@ do not work in subdirectories.
(setq major-mode 'locate-mode
mode-name "Locate"
default-directory "/"
- buffer-read-only t
- selective-display t)
+ buffer-read-only 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)
@@ -473,18 +476,16 @@ do not work in subdirectories.
(make-local-variable 'directory-listing-before-filename-regexp)
;; This should support both Unix and Windoze style names
(setq directory-listing-before-filename-regexp
- (concat "^."
+ (concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s)
- "\\(/\\|[A-Za-z]:\\)\\|"
- (default-value 'directory-listing-before-filename-regexp)))
+ "\\)"))
(make-local-variable 'dired-actual-switches)
(setq dired-actual-switches "")
(make-local-variable 'dired-permission-flags-regexp)
(setq dired-permission-flags-regexp
(concat "^.\\("
(make-string (1- locate-filename-indentation) ?\s)
- "\\)\\|"
- (default-value 'dired-permission-flags-regexp)))
+ "\\)"))
(make-local-variable 'revert-buffer-function)
(setq revert-buffer-function 'locate-update)
(set (make-local-variable 'page-delimiter) "\n\n")
@@ -523,9 +524,7 @@ do not work in subdirectories.
(let ((locate-format-string " /:\n Matches for %s")
(locate-regexp-match
(concat " *Matches for \\(" (regexp-quote search-string) "\\)"))
- (locate-format-args (list search-string))
- )
-
+ (locate-format-args (list search-string)))
(and locate-fcodes-file
(setq locate-format-string
(concat locate-format-string " in %s")
[Message part 7 (text/plain, inline)]
--
Booting /vmemacs.el...
[Message part 8 (message/rfc822, inline)]
> From: Eduard Wiebe <ew <at> pusto.de>
> Date: Sun, 28 Nov 2010 19:43:11 +0100
>
> Could you close Bug#5462 too, which adress the "same" issue.
Done by this mail.
This bug report was last modified 14 years and 200 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.