diff lisp/wid-edit.el @ 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 ed770a0a7846
children fb90b962c3cb
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)