unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 22.1.90; `locate' and "C:" on Windows
@ 2008-02-13 19:19 Reiner Steib
  2008-02-14  0:54 ` Chong Yidong
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-02-13 19:19 UTC (permalink / raw)
  To: emacs-devel

Hi,

on Windows, with
<ftp://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-22.1.90-bin-i386.zip>,
I have set up a locate db (using cygwin).  In Emacs, after `M-x locate
RET foo RET', I get:

--8<---------------cut here---------------start------------->8---
  /:
 Matches for foo:

    C:/blub/foobar.baz
--8<---------------cut here---------------end--------------->8---

When I put the mouse over the file name, only "/blub/foobar.baz" is
highlighted, i.e. "C:" is missing.  When pressing mouse-1, I got an
error:

| dired-get-file-for-visit: File no longer exists; type `g' to update dired buffer

Binding `directory-listing-before-filename-regexp' in
`locate-set-properties' seems to fix the problem for me:

--8<---------------cut here---------------start------------->8---
--- locate.el	09 Jan 2008 20:35:41 +0100	1.49
+++ locate.el	13 Feb 2008 20:08:36 +0100	
@@ -525,7 +525,8 @@
 
 (defun locate-set-properties ()
   (save-excursion
-    (let ((pos (locate-get-file-positions)))
+    (let ((pos (locate-get-file-positions))
+	  (directory-listing-before-filename-regexp "^ +"))
       (dired-insert-set-properties (elt pos 0) (elt pos 1)))))
 
 (defun locate-insert-header (search-string)
--8<---------------cut here---------------end--------------->8---

I don't use `locate' very often so I can't do much real life testing.
Unless someone else can confirm that this fix is correct, I'd suggest
to install it only in the trunk.  But maybe someone can come up with a
safe fix for Emacs 22?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-09 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13 19:19 22.1.90; `locate' and "C:" on Windows Reiner Steib
2008-02-14  0:54 ` Chong Yidong
2008-02-14  1:51   ` Stefan Monnier
2008-02-14  8:25   ` Jason Rumney
2008-02-14 22:31   ` Reiner Steib
2008-03-09 12:30     ` Reiner Steib

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).