help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: zonk *log-edit-files* for RCS (or when there is only one file)


From: Emanuel Berg
Subject: Re: zonk *log-edit-files* for RCS (or when there is only one file)
Date: Tue, 09 Feb 2021 20:53:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Thien-Thi Nguyen wrote:

>  (defun ttn-log-edit-show-files-maybe ()
>    (unless (null (cdr (log-edit-files)))
>      (log-edit-show-files)))
>
> [...]
>
> It works fine, although i suspect the moment i add it to my
> pile of hacks, someone will check-in a more elegant
> method... :-D

On the contrary, that's so cool! I had to think and think and
think before I realized it is 0 or 1 file -> don't do it, but
2 or more files -> do it.

Only ... isn't `unless' and `null' = `when'?

(unless (null (cdr '()))    1) ; nil
(unless (null (cdr '(1)))   1) ; nil
(unless (null (cdr '(1 2))) 1) ; 1

(when         (cdr '())     1) ; nil
(when         (cdr '(1))    1) ; nil
(when         (cdr '(1 2))  1) ; 1

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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