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: Emanuel Berg
Subject: Re: Bind two commands to one key to toggle between them for the same local keymap.
Date: Fri, 22 Oct 2021 10:33:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hongyi Zhao wrote:

>>>     ("<tab>" . (lamda () (if (company-search-mode)
>>>                     #'company-search-abort
>>>                     #'company-search-candidates)))
>>>
>>> What's the problem?
>>
>> Several :)
>
> I'm at the end of my rope

Without knowing the situation ...

(require 'company)

(defun company-search-hz ()
  (interactive)
  (if (eq major-mode 'company-search-mode)
      (company-search-abort)
    (company-search-candidates) ))

(define-key company-mode-map "\t" #'company-search-hz)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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