From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Tassilo Horn <tsdh@gnu.org>
Subject: Re: [elpa] externals/switchy-window 682bcec0a6: Release 1.2: no code changes but don't suggest adding lambdas to hooks
Date: Tue, 11 Apr 2023 12:40:19 -0400 [thread overview]
Message-ID: <jwvedoqpe4p.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20230411150046.C8002C13916@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Tue, 11 Apr 2023 11:00:46 -0400 (EDT)")
> ;; Or as a substitute for `other-window'.
> +(defun my-switchy-window-set-or-unset-key ()
> + (if switchy-window-minor-mode
> + (keymap-global-set "<remap> <other-window>"
> + #'switchy-window)
> + (keymap-global-unset "<remap> <other-window>")))
> +
> (add-hook 'switchy-window-minor-mode-hook
> - (lambda ()
> - (if switchy-window-minor-mode
> - (keymap-global-set "<remap> <other-window>"
> - #'switchy-window)
> - (keymap-global-unset "<remap> <other-window>"))))
> + #'my-switchy-window-set-or-unset-key)
> ```
Why not just
(keymap-set switchy-window-minor-mode-map
"<remap> <other-window>" #'switchy-window)
?
Stefan
next parent reply other threads:[~2023-04-11 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <168122524652.26571.12717876454918406453@vcs2.savannah.gnu.org>
[not found] ` <20230411150046.C8002C13916@vcs2.savannah.gnu.org>
2023-04-11 16:40 ` Stefan Monnier [this message]
2023-04-11 17:57 ` [elpa] externals/switchy-window 682bcec0a6: Release 1.2: no code changes but don't suggest adding lambdas to hooks Tassilo Horn
2023-04-11 18:38 ` Eli Zaretskii
2023-04-11 18:59 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvedoqpe4p.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).