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: Mon, 25 Oct 2021 19:54:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hongyi Zhao wrote:

> (company-set-selection company--search-old-selection t)
> (setq company-selection-changed company--search-old-changed))

You have to do that manually?

>          :map company-search-map
>          ("<tab>" . (lambda ()
>                     (interactive)
>                     (if company-search-mode (company-search-abort)
>                       (company-search-candidates))))

Yeah, but that looks weird ... the map is like 1/3 a mode.
You have to check for the major-mode now in its own map?

I wrote one major mode ...

There it looks like this only.

(defvar fpscalc-mode-map
  (let ((the-map (make-keymap)))
    (define-key the-map "\t" 'newline-and-indent)
    the-map)
  "`fpscalc-mode' keymap.")

Okay not quite 1/3 ...

https://dataswamp.org/~incal/fps/fpscalc.el

https://dataswamp.org/~incal/fps/fpscalc.png <-- cool B)

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




reply via email to

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