From mboxrd@z Thu Jan 1 00:00:00 1970 From: "R. Michael Weylandt" Subject: Re: :mkdirp without path specifier Date: Sat, 3 May 2014 10:52:27 -0400 Message-ID: References: <14FCE026-6FA3-409F-87F6-B2E9B1452C9E@gmail.com> <87oazfjmuh.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgbJ3-0000LO-Nw for emacs-orgmode@gnu.org; Sat, 03 May 2014 10:52:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgbJ2-0004CI-Pr for emacs-orgmode@gnu.org; Sat, 03 May 2014 10:52:49 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:46620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgbJ2-0004CA-Hy for emacs-orgmode@gnu.org; Sat, 03 May 2014 10:52:48 -0400 Received: by mail-la0-f44.google.com with SMTP id hr17so3686340lab.3 for ; Sat, 03 May 2014 07:52:47 -0700 (PDT) In-Reply-To: <87oazfjmuh.fsf@Rainer.invalid> 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: Achim Gratz Cc: "emacs-orgmode@gnu.org" On Sat, May 3, 2014 at 4:19 AM, Achim Gratz 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.