summaryrefslogtreecommitdiff
path: root/lisp/wid-edit.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-10-04 20:31:22 +0000
committerRichard M. Stallman <rms@gnu.org>2005-10-04 20:31:22 +0000
commitd315fc0fcb21be42278fc4184a68d5d749e2d537 (patch)
tree33a7fca7ae309ac5f8ceafc1b8448a3e9b9d6d11 /lisp/wid-edit.el
parent69a069faab95e903b33b25397fa72def3146ec36 (diff)
downloademacs-d315fc0fcb21be42278fc4184a68d5d749e2d537.tar.gz
(widget-file-complete): Get the widget start point the right way.
Default directory to `/' if file has none.
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r--lisp/wid-edit.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 55e50b7faec..bcaa1318fdf 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2991,12 +2991,12 @@ It will read a file name from the minibuffer when invoked."
"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)