From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: problems with export and :cache Date: Thu, 29 Oct 2015 17:42:55 +0100 Message-ID: <87wpu5occ0.fsf@nicolasgoaziou.fr> References: <87vb9pyf0l.fsf@gmail.com> <871tcdpxeq.fsf@nicolasgoaziou.fr> <87io5pyaeo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrqGG-0006nR-Sk for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 12:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrqGG-0003vD-2I for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 12:41:12 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:42576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrqGF-0003un-Sz for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 12:41:12 -0400 In-Reply-To: <87io5pyaeo.fsf@gmail.com> (Aaron Ecay's message of "Thu, 29 Oct 2015 15:14:23 +0000") 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: Andreas Leha Cc: emacs-orgmode@gnu.org Aaron Ecay writes: > I=E2=80=99d like to remove this function, actually. I hate the org funct= ions > that do X most of the time, but the opposite of X when you pass them > an optional argument (in this case the third arg =E2=80=98other=E2=80=99). > Almost all (a couple dozen in total) of the calls to o-b-get-header > are in the context (mapcar #'cdr (org-babel-get-header params :var)). > I=E2=80=99d like to introduce a function org-babel--get-var-values to cov= er > these cases, and replace the remaining 2 calls in the codebase (which > both extract :column-names) with assq (since :column-names should > appear maximally once, unlike :var). The sole use of the evil 'other > arg is refactored away by my patch. > > Thoughts? Could these 2 use cases be refactored? (mapcar #'cdr (org-babel-get-header params :var)) is not very far (but stlightly different) from (cadr (org-babel-get-header params :colname-names)) when there is a single association in PARAMS. Otherwise, it is up to the user to know that there can be multiple :var keys but only one :column-names. IOW, aren't you after `org-babel-get-header' without the OTHER argument? Regards,