changeset 6548:2b0355912ba6

(mouse-choose-completion): Use choose-completion-string. (mouse-completion-delete-max-match): Moved to simple.el and renamed.
author Richard M. Stallman <rms@gnu.org>
date Sun, 27 Mar 1994 22:18:55 +0000
parents 610cde67456a
children d66e48956d3e
files lisp/mouse.el
diffstat 1 files changed, 1 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Sun Mar 27 21:24:22 1994 +0000
+++ b/lisp/mouse.el	Sun Mar 27 22:18:55 1994 +0000
@@ -1205,21 +1205,6 @@
 
 ;; 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 @@
       (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)))
 
 ;; Font selection.