[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] externals/notmuch-indicator f563869b6a 2/4: Tweak how the key
From: |
Protesilaos Stavrou |
Subject: |
Re: [elpa] externals/notmuch-indicator f563869b6a 2/4: Tweak how the keymap is implemented |
Date: |
Wed, 28 Sep 2022 21:58:25 +0300 |
User-agent: |
Notmuch/0.37 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 28 Sep 2022 14:30:01 -0400
>
>> branch: externals/notmuch-indicator
>> commit f563869b6a5e5e12fd791bc109232ed45064f7a7
>> Author: Protesilaos Stavrou <info@protesilaos.com>
>> Commit: Protesilaos Stavrou <info@protesilaos.com>
>>
>> Tweak how the keymap is implemented
>>
>> This continues the work done by Henrik Kjerringvåg in commit f5c9b2e.
>> Henrik does not require to assign copyright to the Free Software
>> Foundation for that commit, as it is within the ~15 line threshold.
> [... 37 lines elided]
> Hmm... really? The new `define-key` will overwrite the binding added in
> the previous call to `notmuch-indicator--format-label`, so if you have
> several elements in `notmuch-indicator-args`, they'll all use the last
> element's `terms` when you click `mouse-1` on them.
Thanks for pointing it out! I reverted to the previous approach.
> While I'm here:
>
>> + (if (and face label)
>> + (format "%s%s " (propertize label 'face face) count)
>> + (format "%s%s " (or label "") count))
>
> can be rewritten to
>
>
> (format "%s%s "
> (if (and face label) (propertize label 'face face)
> (or label "")
> count)
Done. Thank you!
> Oh, and I see elsewhere that you call `mapconcat` with only 2 args,
> which is a new feature in Emacs-29 whereas the package claims to want to
> support Emacs-27.
Thanks! On a more general note, how can we catch cases like this one?
The compiler did not warn about it and the doc string of mapconcat does
not explain as much. I know there is an entry in the NEWS, but having
to check that manually is not easy.
--
Protesilaos Stavrou
https://protesilaos.com