From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [PATCH v2] fix SETUPFILE pathname expansion with subdirectories Date: Sun, 20 Sep 2015 01:07:37 -0400 Message-ID: <87bncxhe5i.fsf@kyleam.com> References: <87lhc2u8ln.fsf@nicolasgoaziou.fr> <1442700472-3845-1-git-send-email-rhansen@bbn.com> <87twqq3u97.fsf@kyleam.com> <55FDEC3B.2080805@bbn.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdWqo-00040Y-Gf for emacs-orgmode@gnu.org; Sun, 20 Sep 2015 01:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdWql-0004fB-4x for emacs-orgmode@gnu.org; Sun, 20 Sep 2015 01:07:46 -0400 Received: from mail-qg0-f42.google.com ([209.85.192.42]:36214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdWql-0004f7-1R for emacs-orgmode@gnu.org; Sun, 20 Sep 2015 01:07:43 -0400 Received: by qgx61 with SMTP id 61so67797758qgx.3 for ; Sat, 19 Sep 2015 22:07:42 -0700 (PDT) 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: Richard Hansen Cc: emacs-orgmode@gnu.org Richard Hansen writes: > Should I use cd-absolute instead of setting default-directory > directly? It does some sanity checks (among other things) that seem > worthwhile. Looking at these checks, I don't think they are useful in this context, and some change the intended behavior. * One check makes sure the directory ends in a slash, but this will already be the case because your changes call file-name-directory. * Another calls expand-file-name, but all these functions already expand the original file name upstream. * Another signals an error if the directory doesn't exist, is not a directory, or isn't accessible. All but one of these functions call org-file-contents with a non-nil NOERROR, so the intent is to message rather than raise an error when a file doesn't exist. (org--setup-collect-keywords is the one function that doesn't use org-file-contents, but it does check that the file is readable before calling insert-file-contents.) -- Kyle