diff options
| author | Richard M. Stallman | 1994-03-27 22:18:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-27 22:18:55 +0000 |
| commit | 40fc483606624e6006bafb968d872be85f03d19d (patch) | |
| tree | 497caede5a65d27fa5728c57f51ab2db50abcf4b | |
| parent | d25390d0aa414081348ae831d4ed7907e102a929 (diff) | |
| download | emacs-40fc483606624e6006bafb968d872be85f03d19d.tar.gz emacs-40fc483606624e6006bafb968d872be85f03d19d.zip | |
(mouse-choose-completion): Use choose-completion-string.
(mouse-completion-delete-max-match): Moved to simple.el and renamed.
| -rw-r--r-- | lisp/mouse.el | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 1fd789a546c..9de9fe535ac 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1205,21 +1205,6 @@ and selects that window." | |||
| 1205 | 1205 | ||
| 1206 | ;; Choose a completion with the mouse. | 1206 | ;; Choose a completion with the mouse. |
| 1207 | 1207 | ||
| 1208 | ;; Delete the longest partial match for STRING | ||
| 1209 | ;; that can be found before POINT. | ||
| 1210 | (defun mouse-delete-max-match (string) | ||
| 1211 | (let ((opoint (point)) | ||
| 1212 | (len (min (length string) | ||
| 1213 | (- (point) (point-min))))) | ||
| 1214 | (goto-char (- (point) (length string))) | ||
| 1215 | (while (and (> len 0) | ||
| 1216 | (let ((tail (buffer-substring (point) | ||
| 1217 | (+ (point) len)))) | ||
| 1218 | (not (string= tail (substring string 0 len))))) | ||
| 1219 | (setq len (1- len)) | ||
| 1220 | (forward-char 1)) | ||
| 1221 | (delete-char len))) | ||
| 1222 | |||
| 1223 | (defun mouse-choose-completion (event) | 1208 | (defun mouse-choose-completion (event) |
| 1224 | "Click on an alternative in the `*Completions*' buffer to choose it." | 1209 | "Click on an alternative in the `*Completions*' buffer to choose it." |
| 1225 | (interactive "e") | 1210 | (interactive "e") |
| @@ -1239,14 +1224,7 @@ and selects that window." | |||
| 1239 | (select-window (posn-window (event-start event))) | 1224 | (select-window (posn-window (event-start event))) |
| 1240 | (bury-buffer) | 1225 | (bury-buffer) |
| 1241 | (select-window owindow)) | 1226 | (select-window owindow)) |
| 1242 | (set-buffer buffer) | 1227 | (choose-completion-string choice buffer))) |
| 1243 | (mouse-delete-max-match choice) | ||
| 1244 | (insert choice) | ||
| 1245 | ;; Update point in the window that BUFFER is showing in. | ||
| 1246 | (let ((window (get-buffer-window buffer t))) | ||
| 1247 | (set-window-point window (point))) | ||
| 1248 | (and (equal buffer (window-buffer (minibuffer-window))) | ||
| 1249 | (minibuffer-complete-and-exit)))) | ||
| 1250 | 1228 | ||
| 1251 | ;; Font selection. | 1229 | ;; Font selection. |
| 1252 | 1230 | ||