unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / Atom feed
* widget-complete and C-g to hide *Completions*
@ 2021-01-13  0:19 Mauro Aranda
  2021-01-13  3:00 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Aranda @ 2021-01-13  0:19 UTC (permalink / raw)
  To: emacs-devel

When in some mode like emacs-lisp-mode, after the *Completions* buffer
pops up, typing C-g will hide it (at least in emacs -Q).

But when using widget-complete, which uses completion-in-region instead
of completion-at-point, that doesn't happen.

Test case would be like this:

(defcustom foo "black" "..."
  :group 'emacs
  :type 'color)

Eval and then M-x customize-option RET foo
Move to the color widget and type C-k to erase the value.
Then write something like "bl" and type C-M-i, to get the *Completions*
buffer, with values "black", "blue", at least, hopefully.
Type C-g: Quitting doesn't hide *Completions*, like in other modes
(e.g., emacs-lisp-mode).

I'd like to know why the use of completion-in-region in widget-complete
doesn't turn on completion-in-region-mode, and what would be the steps
to make that happen, but I got lost quickly in the completion code, so
perhaps someone else can take a look.  Is it required that
completion-in-region-mode-predicate is non-nil? That is not documented,
but the code seems to expect that.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: widget-complete and C-g to hide *Completions*
  2021-01-13  0:19 widget-complete and C-g to hide *Completions* Mauro Aranda
@ 2021-01-13  3:00 ` Stefan Monnier
  2021-01-13 12:17   ` Mauro Aranda
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2021-01-13  3:00 UTC (permalink / raw)
  To: Mauro Aranda; +Cc: emacs-devel

> I'd like to know why the use of completion-in-region in widget-complete
> doesn't turn on completion-in-region-mode, and what would be the steps
> to make that happen, but I got lost quickly in the completion code, so
> perhaps someone else can take a look.  Is it required that
> completion-in-region-mode-predicate is non-nil?

Yes, `completion-in-region-mode` requires
`completion-in-region-mode-predicate` to do its job, so the caller needs
to set that somehow.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: widget-complete and C-g to hide *Completions*
  2021-01-13  3:00 ` Stefan Monnier
@ 2021-01-13 12:17   ` Mauro Aranda
  0 siblings, 0 replies; 3+ messages in thread
From: Mauro Aranda @ 2021-01-13 12:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I'd like to know why the use of completion-in-region in widget-complete
>> doesn't turn on completion-in-region-mode, and what would be the steps
>> to make that happen, but I got lost quickly in the completion code, so
>> perhaps someone else can take a look.  Is it required that
>> completion-in-region-mode-predicate is non-nil?
>
> Yes, `completion-in-region-mode` requires
> `completion-in-region-mode-predicate` to do its job, so the caller needs
> to set that somehow.
>
>
>         Stefan

OK, thanks!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-13 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  0:19 widget-complete and C-g to hide *Completions* Mauro Aranda
2021-01-13  3:00 ` Stefan Monnier
2021-01-13 12:17   ` Mauro Aranda

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git