changeset 8204:f5c8a4e8c4a5

(mouse-choose-completion): Use mouse-face properties to find string to use.
author Richard M. Stallman <rms@gnu.org>
date Mon, 11 Jul 1994 21:25:52 +0000
parents 7f13bc5470d9
children f9e57f3ecc9d
files lisp/mouse.el
diffstat 1 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Mon Jul 11 21:25:19 1994 +0000
+++ b/lisp/mouse.el	Mon Jul 11 21:25:52 1994 +0000
@@ -1195,18 +1195,12 @@
       (save-excursion
 	(goto-char (posn-point (event-start event)))
 	(let (beg end)
-	  (skip-chars-forward "^ \t\n")
-	  (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))
+	  (if (and (not (eobp)) (get-text-property (point) 'mouse-face))
+	      (setq end (point) beg (1+ (point))))
+	  (if (null beg)
+	      (error "No completion here"))
+	  (setq beg (previous-single-property-change beg 'mouse-face))
+	  (setq end (next-single-property-change end 'mouse-face))
 	  (setq choice (buffer-substring beg end)))))
     (let ((owindow (selected-window)))
       (select-window (posn-window (event-start event)))