From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: [PATCH] ob-R.el, redundant list Date: Mon, 18 Jun 2012 20:04:54 -1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgrYq-0005aN-K7 for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 02:05:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgrYm-0006Lw-9m for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 02:05:08 -0400 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:35268) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SgrYm-0006FE-0Y for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 02:05:04 -0400 Received: from [24.94.66.191] (port=50257 helo=poto) by box472.bluehost.com with esmtpa (Exim 4.76) (envelope-from ) id 1SgrYe-0003vb-VB for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 00:04:57 -0600 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: Org-mode --=-=-= Content-Type: text/plain Aloha all, I noticed a redundant list of R device header arguments in ob-R.el. The attached patch removes the redundant list, along with two setq's that appeared to be unnecessary. All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ob-R.el-Removed-reduntant-list-of-header-argume.patch Content-Description: Patch to ob-R.el >From 843e173e1135a15a542afa9795de0cd7ed4672e0 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Mon, 18 Jun 2012 19:49:58 -1000 Subject: [PATCH] * lisp/ob-R.el: Removed reduntant list of header arguments --- lisp/ob-R.el | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 0802736..7e8f80e 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -245,27 +245,20 @@ current code buffer." (:pdf . "pdf") (:ps . "postscript") (:postscript . "postscript"))) - (allowed-args '(:width :height :bg :units :pointsize - :antialias :quality :compression :res - :type :family :title :fonts :version - :paper :encoding :pagecentre :colormodel - :useDingbats :horizontal)) (device (and (string-match ".+\\.\\([^.]+\\)" out-file) (match-string 1 out-file))) (extra-args (cdr (assq :R-dev-args params))) filearg args) (setq device (or (and device (cdr (assq (intern (concat ":" device)) devices))) "png")) - (setq filearg - (if (member device '("pdf" "postscript" "svg" "tikz")) "file" "filename")) - (setq args (mapconcat - (lambda (pair) - (if (member (car pair) allowed-args) - (format ",%s=%S" - (substring (symbol-name (car pair)) 1) - (cdr pair)) "")) - params "")) (format "%s(%s=\"%s\"%s%s%s)" - device filearg out-file args + device + (if (member device '("pdf" "postscript" "svg" "tikz")) "file" "filename") + out-file + (mapconcat (lambda (pair) + (format "%s=%S" + (substring (symbol-name (car pair)) 1) + (cdr pair))) + (remove-if-not #'(lambda (pair) (eq (cdr (assoc (car pair) org-babel-header-args:R)) :any)) params) ",") (if extra-args "," "") (or extra-args "")))) (defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'") -- 1.7.5.4 --=-=-= Content-Type: text/plain -- Thomas S. Dye http://www.tsdye.com --=-=-=--