emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100248: Fix bug #7308 with `locat


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100248: Fix bug #7308 with `locate' on MS-Windows.
Date: Sat, 27 Nov 2010 11:56:49 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100248
author: Eduard Wiebe <address@hidden>
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-23
timestamp: Sat 2010-11-27 11:56:49 +0200
message:
  Fix bug #7308 with `locate' on MS-Windows.
  
   dired.el (dired-get-filename): Replace backslashes with slashes
   in file names on MS-Windows, needed by `locate'.
   locate.el (locate-default-make-command-line): Don't consider
   drive letter and root directory part of
   `directory-listing-before-filename-regexp'.
   (locate-post-command-hook, locate-post-command-hook): New defcustoms.
modified:
  lisp/ChangeLog
  lisp/dired.el
  lisp/locate.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-11-26 21:33:21 +0000
+++ b/lisp/ChangeLog    2010-11-27 09:56:49 +0000
@@ -1,3 +1,12 @@
+2010-11-27  Eduard Wiebe  <address@hidden>
+
+       * dired.el (dired-get-filename): Replace backslashes with slashes
+       in file names on MS-Windows, needed by `locate'.  (Bug#7308)
+       * locate.el (locate-default-make-command-line): Don't consider
+       drive letter and root directory part of
+       `directory-listing-before-filename-regexp'.  (Bug#7308)
+       (locate-post-command-hook, locate-post-command-hook): New defcustoms.
+
 2010-11-26  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2010-09-27 23:41:00 +0000
+++ b/lisp/dired.el     2010-11-27 09:56:49 +0000
@@ -2012,6 +2012,14 @@
           ;; with quotation marks in their names.
          (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
            (setq file (replace-match "\\\"" nil t file 1)))
+         
+         (when (eq system-type 'windows-nt)
+           (save-match-data
+             (let ((start 0))
+               (while (string-match "\\\\" file start)
+                 (aset file (match-beginning 0) ?/)
+                 (setq start (match-end 0))))))
+
           (setq file (read (concat "\"" file "\"")))
          ;; The above `read' will return a unibyte string if FILE
          ;; contains eight-bit-control/graphic characters.

=== modified file 'lisp/locate.el'
--- a/lisp/locate.el    2010-11-01 06:55:49 +0000
+++ b/lisp/locate.el    2010-11-27 09:56:49 +0000
@@ -145,6 +145,11 @@
   :type 'string
   :group 'locate)
 
+(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 +231,11 @@
   :group 'locate
   :type 'boolean)
 
+(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)
@@ -471,9 +481,9 @@
   (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 "")


reply via email to

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