Mercurial > emacs
changeset 65837:3a0debccbfea
(widget-file-complete): Get the widget start point the right way.
Default directory to `/' if file has none.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 04 Oct 2005 20:31:13 +0000 |
parents | c502b2c18f47 |
children | e7add15f0f59 |
files | lisp/wid-edit.el |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/wid-edit.el Tue Oct 04 20:29:50 2005 +0000 +++ b/lisp/wid-edit.el Tue Oct 04 20:31:13 2005 +0000 @@ -2991,12 +2991,12 @@ "Perform completion on file name preceding point." (interactive) (let* ((end (point)) - (beg (save-excursion - (skip-chars-backward "^ ") - (point))) + (beg (widget-field-start widget)) (pattern (buffer-substring beg end)) (name-part (file-name-nondirectory pattern)) - (directory (file-name-directory pattern)) + ;; I think defaulting to root is right + ;; because these really should be absolute file names. + (directory (or (file-name-directory pattern) "/")) (completion (file-name-completion name-part directory))) (cond ((eq completion t)) ((null completion)