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

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

bug#7308: [patch] locate under windoze


From: Eduard Wiebe
Subject: bug#7308: [patch] locate under windoze
Date: Sun, 14 Nov 2010 10:15:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eduard Wiebe <usenet@pusto.de>
>> Cc: Chong Yidong <cyd@stupidchicken.com>, 7308@debbugs.gnu.org
>> Date: Sat, 13 Nov 2010 23:33:08 +0100
>> 
>> > I'm okay with the main change, but I don't understand the reason (or
>> > need) for this hunk:
>> >
>> >   @@ -473,9 +483,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 "")
>> 
>> This hunk is essential.  The new value of the regexp avoids the
>> truncation of the drive letter from absolute path of the selected file.
>> 
>> Btw. Under GNU/Linux this change leads to correct position of cursor in
>> *Locate* buffer, too.

> Sorry, I still don't understand: what truncation? 

Under MS-Windows my *Locate* buffer looks like this (* is the point):
----------------------------------------------------------------------
e:*\path\to\file1
e:\path\to\file2
f:\path\to\another\file

-- *Locate*-----------------------------------------------------------

If i choose 'e:\path\to\file1', the function `dired-get-filename' is
called and tries to visit '\path\to\file1' (without the drive letter)
and fails because the path is incomplete.

> what incorrect position? 

Consider the same example on GNU/Linux with following *Locate* buffer:
----------------------------------------------------------------------
/*home/ew/.emacs
/home/ew/.emacs.d

-- *Locate*-----------------------------------------------------------

if i choose '/home/ew/.emacs' the function `dired-get-file' is called and
visits 'home/ew/.emacs', but not fails (albeit more by chance) because
of `default-directory' is '/' and the extracted path is interpreted as a
relative path to `default-directory'.

> Please explain more.

With my patch, the point is always in front of a file path in the
*Locate* buffer and leads to correct file path extraction if i try to
visit selected file path.

I hope that helps and sorry for previous poor explanation.

-- 
Eduard Wiebe





reply via email to

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