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

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

Re: Can't use file name completion in Customize for "Program Files" subd


From: Lennart Borgman
Subject: Re: Can't use file name completion in Customize for "Program Files" subdir
Date: Tue, 04 Oct 2005 01:25:33 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Richard M. Stallman wrote:

   The problem seems to be these lines near the top of
   widget-complete-file

   (beg (save-excursion
                    (skip-chars-backward "^ ")
                    (point)))

   Are there actually situations where files are listed in custom
   variables with space seperators? Or is this code attempting to find
   the beginning of the widget? If the latter, there must be a better way
   to do that.

This change works when I try it.  Does it work for you?

*** wid-edit.el 24 Sep 2005 22:42:50 -0400      1.146
--- wid-edit.el 03 Oct 2005 00:50:32 -0400      
***************
*** 2991,2999 ****
   "Perform completion on file name preceding point."
   (interactive)
   (let* ((end (point))
!        (beg (save-excursion
!               (skip-chars-backward "^ ")
!               (point)))
         (pattern (buffer-substring beg end))
         (name-part (file-name-nondirectory pattern))
         (directory (file-name-directory pattern))
--- 2991,2997 ----
   "Perform completion on file name preceding point."
   (interactive)
   (let* ((end (point))
!        (beg (widget-field-start widget))
         (pattern (buffer-substring beg end))
         (name-part (file-name-nondirectory pattern))
         (directory (file-name-directory pattern))
Yes, it works for me.

There is still another problem with file name completion on MS Windows though. If you start with just an empty field and try widget-complete you get the error "Wrong type argument: stringp, nil". I would instead expect a list of available active drive letters (for example c:/ d:/).

The same thing happens with just for example the letter "C". But with "C:" things starts working.




reply via email to

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