From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: :mkdirp without path specifier Date: Sat, 03 May 2014 10:19:34 +0200 Message-ID: <87oazfjmuh.fsf@Rainer.invalid> References: <14FCE026-6FA3-409F-87F6-B2E9B1452C9E@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgVAv-0006fQ-FX for emacs-orgmode@gnu.org; Sat, 03 May 2014 04:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgVAp-0006Xs-2J for emacs-orgmode@gnu.org; Sat, 03 May 2014 04:20:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:50080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgVAo-0006Xk-RC for emacs-orgmode@gnu.org; Sat, 03 May 2014 04:19:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WgVAm-0007Pv-Gd for emacs-orgmode@gnu.org; Sat, 03 May 2014 10:19:52 +0200 Received: from pd9eb121a.dip0.t-ipconnect.de ([217.235.18.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 May 2014 10:19:52 +0200 Received: from Stromeko by pd9eb121a.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 May 2014 10:19:52 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables