[PATCH] emacs: tree/show remove duplicate function

Mark Walters markwalters1009 at gmail.com
Tue Jul 15 00:14:46 PDT 2014


On Tue, 15 Jul 2014, David Bremner <david at tethera.net> wrote:
> Mark Walters <markwalters1009 at gmail.com> writes:
>> +		   (cond ((eq major-mode 'notmuch-show-mode)
>> +			  (notmuch-show-get-message-properties))
>> +			 ((eq major-mode 'notmuch-tree-mode)
>> +			  (notmuch-tree-get-message-properties))))
>
> I see this already existed, but it looks weird to me to have a two test
> cond with no else. Is it intentional to have the code drop through and
> do nothing if neither case matches?  It seems like it might be better to
> signal an error.

I can definitely do that. But as a comparison
notmuch-search-get-result and notmuch-search-find-thread-id "work" in
any buffer in the sense of returning nil but not complaining so perhaps
the current version is more consistent. 

Plausibly a comment and an explicit nil case would be clearer for the other modes.

Best wishes

Mark





More information about the notmuch mailing list