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: Tassilo Horn
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 19:57:04 +0200
User-agent: mu4e 1.11.0; emacs 30.0.50

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

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

That's what I've tried first but it didn't work, i.e., C-x o was still
other-window. I've now tried it again, this time successfully.

I guess I fooled myself during testing, e.g., I've renamed the mode and
map from switchy-window-mode(-map) to switchy-window-minor-mode(-map) at
some point and probably tried remapping with the old name or something
like that.

I'll fix the snippets.

Thanks a lot,
Tassilo



reply via email to

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