]> git.eshelyaron.com Git - emacs.git/commitdiff
(mouse-choose-completion): Use choose-completion-string.
authorRichard M. Stallman <rms@gnu.org>
Sun, 27 Mar 1994 22:18:55 +0000 (22:18 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 27 Mar 1994 22:18:55 +0000 (22:18 +0000)
(mouse-completion-delete-max-match): Moved to simple.el and renamed.

lisp/mouse.el

index 1fd789a546c272cb80b58e57c62d053b2b589f87..9de9fe535ac0d74ca41a4f27891d3954cd1e8951 100644 (file)
@@ -1205,21 +1205,6 @@ and selects that window."
 \f
 ;; Choose a completion with the mouse.
 
-;; Delete the longest partial match for STRING
-;; that can be found before POINT.
-(defun mouse-delete-max-match (string)
-  (let ((opoint (point))
-       (len (min (length string)
-                 (- (point) (point-min)))))
-    (goto-char (- (point) (length string)))
-    (while (and (> len 0)
-               (let ((tail (buffer-substring (point)
-                                             (+ (point) len))))
-                 (not (string= tail (substring string 0 len)))))
-      (setq len (1- len))
-      (forward-char 1))
-    (delete-char len)))
-
 (defun mouse-choose-completion (event)
   "Click on an alternative in the `*Completions*' buffer to choose it."
   (interactive "e")
@@ -1239,14 +1224,7 @@ and selects that window."
       (select-window (posn-window (event-start event)))
       (bury-buffer)
       (select-window owindow))
-    (set-buffer buffer)
-    (mouse-delete-max-match choice)
-    (insert choice)
-    ;; Update point in the window that BUFFER is showing in.
-    (let ((window (get-buffer-window buffer t)))
-      (set-window-point window (point)))
-    (and (equal buffer (window-buffer (minibuffer-window)))
-        (minibuffer-complete-and-exit))))
+    (choose-completion-string choice buffer)))
 \f
 ;; Font selection.