help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind two commands to one key to toggle between them for the same loc


From: Hongyi Zhao
Subject: Re: Bind two commands to one key to toggle between them for the same local keymap.
Date: Tue, 26 Oct 2021 09:44:48 +0800

On Tue, Oct 26, 2021 at 1:57 AM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Michael Heerdegen wrote:
>
> > And it does what you want?
> >
> > If you are done you can factor out the two identical
> > interactive lambdas as a named function (using `defun').
>
> And put (company-search-abort) on its own line ...

  (defun hz-company-search-toggle ()
    (interactive)
    (if company-search-mode
    (company-search-abort)
      (company-search-candidates)))

HZ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]