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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5462 in the body.
You can then email your comments to 5462 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5462
; Package
emacs
.
(Sun, 24 Jan 2010 12:40:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eduard Wiebe <ew <at> pusto.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 24 Jan 2010 12:40:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
How about this patch?
[locate.chlog (application/octet-stream, attachment)]
[Message part 3 (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 5 (text/plain, inline)]
--
Booting /vmemacs.el...
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sun, 28 Nov 2010 19:40:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Eduard Wiebe <ew <at> pusto.de>
:
bug acknowledged by developer.
(Sun, 28 Nov 2010 19:40:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 5462-done <at> debbugs.gnu.org (full text, mbox):
> 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 27 Dec 2010 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 175 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.