aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduard Wiebe2010-11-27 11:56:49 +0200
committerEli Zaretskii2010-11-27 11:56:49 +0200
commitd1882ac7c91cbaa51aeea68433f1867e73a431c2 (patch)
tree16483fbbb771b967bca9ebfaa30bf5bde90e4afc
parentda2b5401e8747adb28558684b48328806bf43e1e (diff)
downloademacs-d1882ac7c91cbaa51aeea68433f1867e73a431c2.tar.gz
emacs-d1882ac7c91cbaa51aeea68433f1867e73a431c2.zip
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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/dired.el8
-rw-r--r--lisp/locate.el14
3 files changed, 29 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3ac8fd7a270..e8dda581208 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-11-27 Eduard Wiebe <usenet@pusto.de>
2
3 * dired.el (dired-get-filename): Replace backslashes with slashes
4 in file names on MS-Windows, needed by `locate'. (Bug#7308)
5 * locate.el (locate-default-make-command-line): Don't consider
6 drive letter and root directory part of
7 `directory-listing-before-filename-regexp'. (Bug#7308)
8 (locate-post-command-hook, locate-post-command-hook): New defcustoms.
9
12010-11-26 Stefan Monnier <monnier@iro.umontreal.ca> 102010-11-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 11
3 * emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling 12 * emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling
diff --git a/lisp/dired.el b/lisp/dired.el
index bb0cc223281..b2bd082b1a6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2012,6 +2012,14 @@ Otherwise, an error occurs in these cases."
2012 ;; with quotation marks in their names. 2012 ;; with quotation marks in their names.
2013 (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) 2013 (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
2014 (setq file (replace-match "\\\"" nil t file 1))) 2014 (setq file (replace-match "\\\"" nil t file 1)))
2015
2016 (when (eq system-type 'windows-nt)
2017 (save-match-data
2018 (let ((start 0))
2019 (while (string-match "\\\\" file start)
2020 (aset file (match-beginning 0) ?/)
2021 (setq start (match-end 0))))))
2022
2015 (setq file (read (concat "\"" file "\""))) 2023 (setq file (read (concat "\"" file "\"")))
2016 ;; The above `read' will return a unibyte string if FILE 2024 ;; The above `read' will return a unibyte string if FILE
2017 ;; contains eight-bit-control/graphic characters. 2025 ;; contains eight-bit-control/graphic characters.
diff --git a/lisp/locate.el b/lisp/locate.el
index ce1154c9739..d5caf8615cd 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -145,6 +145,11 @@ the version.)"
145 :type 'string 145 :type 'string
146 :group 'locate) 146 :group 'locate)
147 147
148(defcustom locate-post-command-hook nil
149 "List of hook functions run after `locate' (see `run-hooks')."
150 :type 'hook
151 :group 'locate)
152
148(defvar locate-history-list nil 153(defvar locate-history-list nil
149 "The history list used by the \\[locate] command.") 154 "The history list used by the \\[locate] command.")
150 155
@@ -226,6 +231,11 @@ that is, with a prefix arg, you get the default behavior."
226 :group 'locate 231 :group 'locate
227 :type 'boolean) 232 :type 'boolean)
228 233
234(defcustom locate-mode-hook nil
235 "List of hook functions run by `locate-mode' (see `run-mode-hooks')."
236 :type 'hook
237 :group 'locate)
238
229;; Functions 239;; Functions
230 240
231(defun locate-default-make-command-line (search-string) 241(defun locate-default-make-command-line (search-string)
@@ -471,9 +481,9 @@ do not work in subdirectories.
471 (make-local-variable 'directory-listing-before-filename-regexp) 481 (make-local-variable 'directory-listing-before-filename-regexp)
472 ;; This should support both Unix and Windoze style names 482 ;; This should support both Unix and Windoze style names
473 (setq directory-listing-before-filename-regexp 483 (setq directory-listing-before-filename-regexp
474 (concat "^." 484 (concat "^.\\("
475 (make-string (1- locate-filename-indentation) ?\s) 485 (make-string (1- locate-filename-indentation) ?\s)
476 "\\(/\\|[A-Za-z]:\\)\\|" 486 "\\)\\|"
477 (default-value 'directory-listing-before-filename-regexp))) 487 (default-value 'directory-listing-before-filename-regexp)))
478 (make-local-variable 'dired-actual-switches) 488 (make-local-variable 'dired-actual-switches)
479 (setq dired-actual-switches "") 489 (setq dired-actual-switches "")