GNU bug report logs - #5462
23.1; [patch] locate.el: defcustomizing *-hooks

Previous Next

Package: emacs;

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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eduard Wiebe <ew <at> pusto.de>
Subject: bug#5462: closed (Re: bug#7308: [patch] locate under windoze)
Date: Sun, 28 Nov 2010 19:40:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#5462: 23.1; [patch] locate.el: defcustomizing *-hooks

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 5462 <at> debbugs.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)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Eduard Wiebe <ew <at> pusto.de>
Cc: 7308-done <at> debbugs.gnu.org, 5462-done <at> debbugs.gnu.org
Subject: Re: bug#7308: [patch] locate under windoze
Date: Sun, 28 Nov 2010 21:46:23 +0200
> 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.

[Message part 3 (message/rfc822, inline)]
From: Eduard Wiebe <ew <at> pusto.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; [patch] locate.el: defcustomizing *-hooks
Date: Sun, 24 Jan 2010 13:38:52 +0100
[Message part 4 (text/plain, inline)]
 Hello,

How about this patch?
[locate.chlog (application/octet-stream, attachment)]
[Message part 6 (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 8 (text/plain, inline)]
-- 
Booting /vmemacs.el...

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.