diff lisp/international/quail.el @ 105601:68686d39c93a

Replace completion-base-size by completion-base-position to fix bugs such as (bug#4699). * simple.el (completion-base-position): New var. (completion-base-size): Mark as obsolete. (choose-completion): Make it work for mouse events as well. Pass the new base-position to choose-completion-string. (choose-completion-guess-base-position): New function, extracted from choose-completion-delete-max-match. (choose-completion-delete-max-match): Use it. Make obsolete. (choose-completion-string): Use the new base-position info. (completion-root-regexp): Delete. (completion-setup-function): Preserve completion-base-position. Eliminate obsolete base-size manipulation. * minibuffer.el (display-completion-list): Don't mess with base-size. (minibuffer-completion-help): Set completion-base-position instead. * mouse.el (mouse-choose-completion): Redefine as a mere alias to choose-completion. * textmodes/bibtex.el (bibtex-complete): * emacs-lisp/crm.el (crm--choose-completion-string): Adjust to new calling convention. * complete.el (partial-completion-mode): Use minibufferp to avoid bumping into incompatible change to choose-completion-string-functions. * ido.el (ido-choose-completion-string): Make its calling convention more permissive. * comint.el (comint-dynamic-list-input-ring-select): Remove obsolete base-size manipulation. (comint-dynamic-list-input-ring): Use dotimes and push. * iswitchb.el (iswitchb-completion-help): Remove dead-code call to fundamental-mode. Use `or'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 15 Oct 2009 01:50:17 +0000
parents bfb43cf93581
children 1d1d5d9bd884
line wrap: on
line diff
--- a/lisp/international/quail.el	Wed Oct 14 21:56:37 2009 +0000
+++ b/lisp/international/quail.el	Thu Oct 15 01:50:17 2009 +0000
@@ -2242,13 +2242,15 @@
 
 (defun quail-mouse-choose-completion (event)
   "Click on an alternative in the `*Quail Completions*' buffer to choose it."
-  (interactive "e")
   ;; This function is an exact copy of the mouse.el function
   ;; `mouse-choose-completion' except that we:
-  ;; 1) add two lines from `choose-completion' in simple.el to give
-  ;;    the `mouse-2' click a little more leeway.
   ;; 2) don't bury *Quail Completions* buffer, so comment a section, and
   ;; 3) delete/terminate the current quail selection here.
+  ;; FIXME: Consolidate with `choose-completion'.  The point number
+  ;; 1 has been done, already.  The point number 3 should be fairly
+  ;; easy to move to a choose-completion-string-function.  So all
+  ;; that's left is point number 2.
+  (interactive "e")
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
   (let ((buffer (window-buffer))
@@ -2288,6 +2290,7 @@
 ;; previous implementation.
 (defun quail-choose-completion-string (choice &optional buffer base-size)
   (setq quail-current-str choice)
+  ;; FIXME: We need to pass `base-position' here.
   (choose-completion-string choice buffer))
 
 (defun quail-build-decode-map (map-list key decode-map num