all messages for Emacs-related lists mirrored at yhetil.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

* Re: 22.1.90; `locate' and "C:" on Windows
  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
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chong Yidong @ 2008-02-14  0:54 UTC (permalink / raw)
  To: emacs-devel

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> 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
>
> Binding `directory-listing-before-filename-regexp' in
> `locate-set-properties' seems to fix the problem for me

I don't think that's the right fix.  You need to fix
dired-insert-set-properties, which is somehow assuming Unix filename
conventions.  I notice that dired-move-to-filename, which is called by
dired-insert-set-properties, has the following comment:

  (defun dired-move-to-filename (&optional raise-error eol)
    "Move to the beginning of the filename on the current line.
  Return the position of the beginning of the filename, or nil if none found."
    ;; This is the UNIX version.
    ...

Could someone who runs Emacs on Windows check to see if this function
needs to be fixed?  Unfortunately, I don't have Windows available, so
I can't work on this.




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

* Re: 22.1.90; `locate' and "C:" on Windows
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2008-02-14  1:51 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

> Could someone who runs Emacs on Windows check to see if this function
> needs to be fixed?  Unfortunately, I don't have Windows available, so
                      ^^
                    XXXXXX


-- Stefan




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

* Re: 22.1.90; `locate' and "C:" on Windows
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Jason Rumney @ 2008-02-14  8:25 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong wrote:
> Unfortunately, I don't have Windows available, so
> I can't work on this.
>   

I don't think there are many here who would consider that unfortunate.





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

* Re: 22.1.90; `locate' and "C:" on Windows
  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
  2 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-02-14 22:31 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

On Thu, Feb 14 2008, Chong Yidong wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> Binding `directory-listing-before-filename-regexp' in
>> `locate-set-properties' seems to fix the problem for me
>
> I don't think that's the right fix.  

You are right.  The file name was highlighted correctly, but mouse-1
or RET still produced an error.

> You need to fix dired-insert-set-properties, which is somehow
> assuming Unix filename conventions.  I notice that
> dired-move-to-filename, which is called by
> dired-insert-set-properties, has the following comment:
>
>   (defun dired-move-to-filename (&optional raise-error eol)
>     "Move to the beginning of the filename on the current line.
>   Return the position of the beginning of the filename, or nil if none found."
>     ;; This is the UNIX version.
>     ...
>
> Could someone who runs Emacs on Windows check to see if this function
> needs to be fixed?  

AFAIKS, it works fine for real dired buffers.  But for *Locate*
buffers, we need a fix.

> Unfortunately, I don't have Windows available, so I can't work on
> this.

You can probably reproduce with (setq locate-command "~/loc.sh")
and...

--8<---------------cut here---------------start------------->8---
$ cat ~/loc.sh
echo C:/blub/foobar.baz
echo C:/abc/foobar.baz
--8<---------------cut here---------------end--------------->8---

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




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

* Re: 22.1.90; `locate' and "C:" on Windows
  2008-02-14 22:31   ` Reiner Steib
@ 2008-03-09 12:30     ` Reiner Steib
  0 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2008-03-09 12:30 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

On Thu, Feb 14 2008, Reiner Steib wrote:

> On Thu, Feb 14 2008, Chong Yidong wrote:
>> You need to fix dired-insert-set-properties, which is somehow
>> assuming Unix filename conventions.  I notice that
>> dired-move-to-filename, which is called by
>> dired-insert-set-properties, has the following comment:
>>
>>   (defun dired-move-to-filename (&optional raise-error eol)
>>     "Move to the beginning of the filename on the current line.
>>   Return the position of the beginning of the filename, or nil if none found."
>>     ;; This is the UNIX version.
>>     ...
>>
>> Could someone who runs Emacs on Windows check to see if this function
>> needs to be fixed?  
>
> AFAIKS, it works fine for real dired buffers.  But for *Locate*
> buffers, we need a fix.
[...]
> You can probably reproduce with (setq locate-command "~/loc.sh")
> and...
>
> --8<---------------cut here---------------start------------->8---
> $ cat ~/loc.sh
> echo C:/blub/foobar.baz
> echo C:/abc/foobar.baz
> --8<---------------cut here---------------end--------------->8---

I'll add it to "WINDOWS SUPPORT BUGS (for 22.3 or later)." in
FOR-RELEASE:

,----
| ** `locate' and drive letter ("C:") on Windows
| For a recipe to reproduce the problem on GNU/Linux, see 
| <http://thread.gmane.org/gmane.emacs.devel/88971/focus=89106>
`----

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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.