bug#81537: 32.0.50; Fixing icomplete-in-buffer requiring users to advice-add
Sean Whitton <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
Juri Linkov [12/Aug 8:16pm +03] wrote: > So here is a patch that does this: Thanks. > diff --git a/lisp/icomplete.el b/lisp/icomplete.el > index c8da0e9bf9b..0134370a466 100644 > --- a/lisp/icomplete.el > +++ b/lisp/icomplete.el > @@ -154,8 +154,11 @@ icomplete-max-delay-chars > (defcustom icomplete-in-buffer nil > "If non-nil, use Icomplete when completing in buffers other than minibuffer. > This affects commands like `completion-in-region', but not commands > -that use their own completions setup." > - :type 'boolean) > +that use their own completions setup. If the value is `both', > +display both in-buffer completions and the *Completions* buffer." > + :type '(choice (const :tag "Disable" nil) > + (const :tag "Enable" t) > + (const :tag "Enable with popup window" both))) Let's use 'with-completions-popup' instead of 'both'. > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 4da651cc450..675dfd49115 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -1581,8 +1581,15 @@ completion--in-boundaries-p > (end (+ (length string) (cdr boundaries)))) > (>= start pos end))) > > -(defun completion--icomplete-in-buffer-p () > - (eq (bound-and-true-p icomplete--in-region-buffer) (current-buffer))) > +(defvar completion-list-inhibit-functions nil > + "Abnormal hook for inhibiting display of the *Completions* buffer. > +If any of these functions returns non-nil, it inhibits the display > +of *Completions*. This is useful mostly for `icomplete-mode' with > +non-nil `icomplete-in-buffer' to not display both Icomplete in-buffer > +completions and the *Completions* buffer.") I think the last sentence of this docstring should be deleted or made into a code comment instead. -- Sean Whitton