emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#7308: closed ([patch] locate under windoze)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#7308: closed ([patch] locate under windoze)
Date: Sat, 27 Nov 2010 09:53:02 +0000

Your message dated Sat, 27 Nov 2010 11:59:47 +0200
with message-id <address@hidden>
and subject line Re: bug#7308: [patch] locate under windoze
has caused the GNU bug report #7308,
regarding [patch] locate under windoze
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
7308: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7308
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [patch] locate under windoze Date: Sat, 30 Oct 2010 21:50:18 +0200
  Hello,

i want to use `locate' under windoze system.  Unfortunately locate (in
interaction with dired) doesn't work proper in such a case.
The problem is the unquoted backslash in a located file path.
So i fix this issue by following patch. BTW i customized hook variables
and added autoloads.

-- 
Eduard Wiebe
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d7a6399..37f09e7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-23  Eduard Wiebe <address@hidden>
+
+       * dired.el (dired-get-filename): Quote path delimiter under
+       windows-nt and ms-dos systems, needed for `locate' under this
+       systems.
+       * locate.el (locate-default-make-command-line): Simplify
+       `directory-listing-before-filename-regexp'.
+       (locate-post-command-hook, locate-post-command-hook): Customized
+       and add autoload.
+
 2010-10-30  Alan Mackenzie  <address@hidden>
 
        * progmodes/cc-fonts.el (c-font-lock-enum-tail): New function
diff --git a/lisp/dired.el b/lisp/dired.el
index f840b60..d1c2ccb 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2011,6 +2011,10 @@ Otherwise, an error occurs in these cases."
           ;; with quotation marks in their names.
          (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
            (setq file (replace-match "\\\"" nil t file 1)))
+         
+         (when (member system-type '(ms-dos windows-nt))
+           (setq file (replace-regexp-in-string "\\\\" "\\\\\\\\" file)))
+
           (setq file (read (concat "\"" file "\"")))
          ;; The above `read' will return a unibyte string if FILE
          ;; contains eight-bit-control/graphic characters.
diff --git a/lisp/locate.el b/lisp/locate.el
index f1983a3..e07acde 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -145,6 +145,12 @@ the version.)"
   :type 'string
   :group 'locate)
 
+;;;###autoload
+(defcustom locate-post-command-hook nil
+  "List of hook functions run after `locate' (see `run-hooks')."
+  :type  'hook
+  :group 'locate)
+
 (defvar locate-history-list nil
   "The history list used by the \\[locate] command.")
 
@@ -226,6 +232,12 @@ that is, with a prefix arg, you get the default behavior."
   :group 'locate
   :type 'boolean)
 
+;;;###autoload
+(defcustom locate-mode-hook nil
+  "List of hook functions run by `locate-mode' (see `run-mode-hooks')."
+  :type  'hook
+  :group 'locate)
+
 ;; Functions
 
 (defun locate-default-make-command-line (search-string)
@@ -473,9 +485,9 @@ 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 "")

--- End Message ---
--- Begin Message --- Subject: Re: bug#7308: [patch] locate under windoze Date: Sat, 27 Nov 2010 11:59:47 +0200
> From: Eduard Wiebe <address@hidden>
> Cc: Eduard Wiebe <address@hidden>,  address@hidden,  address@hidden
> Date: Sun, 14 Nov 2010 10:15:20 +0100
> 
> I hope that helps and sorry for previous poor explanation.

Thanks, and sorry for the long delay.  I convinced myself that these
changes are correct, and committed them to the Emacs 23 branch.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]