changeset 7593:a837cfdcf7c0

(mouse-choose-completion): Include words separated by single spaces in the completion.
author Richard M. Stallman <rms@gnu.org>
date Fri, 20 May 1994 22:27:04 +0000
parents c12c2c0c7d5f
children 23edba0a5c5e
files lisp/mouse.el
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Fri May 20 21:45:19 1994 +0000
+++ b/lisp/mouse.el	Fri May 20 22:27:04 1994 +0000
@@ -1189,10 +1189,20 @@
 	  (setq buffer completion-reference-buffer))
       (save-excursion
 	(goto-char (posn-point (event-start event)))
-	(skip-chars-backward "^ \t\n")
-	(let ((beg (point)))
+	(let (beg end)
 	  (skip-chars-forward "^ \t\n")
-	  (setq choice (buffer-substring beg (point))))))
+	  (while (looking-at " [^ \n\t]")
+	    (forward-char 1)
+	    (skip-chars-forward "^ \t\n"))
+	  (setq end (point))
+	  (skip-chars-backward "^ \t\n")
+	  (while (and (= (preceding-char) ?\ )
+		      (not (and (> (point) (1+ (point-min)))
+				(= (char-after (- (point) 2)) ?\ ))))
+	    (backward-char 1)
+	    (skip-chars-backward "^ \t\n"))
+	  (setq beg (point))
+	  (setq choice (buffer-substring beg end)))))
     (let ((owindow (selected-window)))
       (select-window (posn-window (event-start event)))
       (bury-buffer)