comparison lisp/mouse.el @ 6003:f9706301b805

(mouse-delete-max-match): Set len properly.
author Richard M. Stallman <rms@gnu.org>
date Fri, 18 Feb 1994 23:51:12 +0000
parents 66aadd6ba5e6
children e7c900a464d3
comparison
equal deleted inserted replaced
6002:7507f44b1e5e 6003:f9706301b805
1173 ;; Choose a completion with the mouse. 1173 ;; Choose a completion with the mouse.
1174 1174
1175 ;; Delete the longest partial match for STRING 1175 ;; Delete the longest partial match for STRING
1176 ;; that can be found before POINT. 1176 ;; that can be found before POINT.
1177 (defun mouse-delete-max-match (string) 1177 (defun mouse-delete-max-match (string)
1178 (let ((len (min (length string) 1178 (let ((opoint (point))
1179 (- (point-max) (point-min))))) 1179 (len (min (length string)
1180 (goto-char (max (point-min) (- (point) (length string)))) 1180 (- (point) (point-min)))))
1181 (goto-char (- (point) (length string)))
1181 (while (and (> len 0) 1182 (while (and (> len 0)
1182 (let ((tail (buffer-substring (point) 1183 (let ((tail (buffer-substring (point)
1183 (+ (point) len)))) 1184 (+ (point) len))))
1184 (not (string= tail (substring string 0 len))))) 1185 (not (string= tail (substring string 0 len)))))
1185 (setq len (1- len)) 1186 (setq len (1- len))