diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-07-11 21:25:52 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-07-11 21:25:52 +0000 |
commit | 9a43a5943dc93b301ef109ce77af00ac42b4bf3f (patch) | |
tree | 20a4721d03aca9e2fc4a6d25783a82dfebb65b8d /lisp/mouse.el | |
parent | 6096f3628616096e895dd4b78ccbd613ff937e6f (diff) | |
download | emacs-9a43a5943dc93b301ef109ce77af00ac42b4bf3f.tar.gz |
(mouse-choose-completion): Use mouse-face properties to find string to use.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index df099cde83f..f7977689634 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1195,18 +1195,12 @@ and selects that window." (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))) |