From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH 3/3] mark o-b-default-header-args:R as a safe local under proper conditions Date: Tue, 29 Oct 2013 19:54:21 -0600 Message-ID: <87zjprbk03.fsf@gmail.com> References: <1382991543-14273-1-git-send-email-aaronecay@gmail.com> <1382991543-14273-4-git-send-email-aaronecay@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbL0b-0002pJ-UQ for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 21:55:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbL0W-0005q7-MF for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 21:55:45 -0400 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:36500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbL0W-0005q3-FA for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 21:55:40 -0400 Received: by mail-pa0-f53.google.com with SMTP id kx10so212554pab.26 for ; Tue, 29 Oct 2013 18:55:37 -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: Aaron Ecay Cc: emacs-orgmode@gnu.org I think `mapcar' should be replaced with `org-every'. Otherwise wouldn't *every* list value for `org-babel-default-header-args:R' be safe? Additionally, I think this should be done in a way which can be easily repeated across every ob-*.el file. Thanks, Aaron Ecay writes: > * lisp/ob-R.el (org-babel-default-header-args:R): mark as a safe local > variable > --- > lisp/ob-R.el | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/lisp/ob-R.el b/lisp/ob-R.el > index 74d7513..2086622 100644 > --- a/lisp/ob-R.el > +++ b/lisp/ob-R.el > @@ -66,6 +66,22 @@ > "R-specific header arguments.") > > (defvar org-babel-default-header-args:R '()) > +(put 'org-babel-default-header-args:R 'safe-local-variable > + (lambda (value) > + (and (listp value) > + (and (mapcar > + (lambda (pair) > + (and (consp pair) > + (or (org-babel-one-header-arg-safe-p pair) > + (memq (car pair) > + '(:width :height :bg > + :units :pointsize :antialias > + :quality :compression :res > + :type :family :title :fonts > + :version :paper :encoding > + :pagecentre :colormodel > + :useDingbats :horizontal))))) > + value))))) > > (defcustom org-babel-R-command "R --slave --no-save" > "Name of command to use for executing R code." -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D