[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] :mkdirp without path specifier
From: |
R. Michael Weylandt |
Subject: |
Re: [O] :mkdirp without path specifier |
Date: |
Sat, 3 May 2014 10:52:27 -0400 |
On Sat, May 3, 2014 at 4:19 AM, Achim Gratz <address@hidden> wrote:
> R. Michael Weylandt writes:
>> ;; Possibly create the parent directories for file.
>> (when (let ((m (funcall get-spec :mkdirp)))
>> (and m (not (string= m "no"))))
>> - (make-directory (file-name-directory file-name)
>> 'parents))
>> + (if (file-name-directory file-name)
>> + (make-directory (file-name-directory file-name)
>> 'parents)))
>
> If the else clause is intentionally missing, some folks prefer to use
> "when" instead of "if" to advertise that fact (see some surrounding code
> for example). In this case the additional "if" should be rolled into
> the condition check of the former "when" anyway (and let-bind the result
> to avoid the duplicate "file-name-directory" call). The conditional is
> actually superfluous since we can short-circuit from the "and".
>
> A patch to that effect has been installed in 063c8b03b7.
>
Thanks for the feedback and applying a fix.