From 40fc483606624e6006bafb968d872be85f03d19d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 27 Mar 1994 22:18:55 +0000 Subject: [PATCH] (mouse-choose-completion): Use choose-completion-string. (mouse-completion-delete-max-match): Moved to simple.el and renamed. --- lisp/mouse.el | 24 +----------------------- 1 file changed, 1 insertion(+), 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." ;; 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))) ;; Font selection. -- 2.39.5