emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] externals/switchy-window 682bcec0a6: Release 1.2: no code cha


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13)

>  ;; 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




reply via email to

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