From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2N57DtAmBGVlXwEAauVa8A:P1 (envelope-from ) for ; Fri, 15 Sep 2023 11:41:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2N57DtAmBGVlXwEAauVa8A (envelope-from ) for ; Fri, 15 Sep 2023 11:41:36 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2B009376E9 for ; Fri, 15 Sep 2023 11:41:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="I9/i5PNQ"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694770895; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IX8tbWJtQOUp9CjsdF98j0sZn4l513oRPMQiYnT0JBI=; b=tazb4KUSDph/Wa++j9lwns9ArfRrf23wmmAmcOX7UbEd0GLNVLSpE9Zer5DNTqd/6rcOdX R33q8fqHbQTLKKQwiHvi1DMk/b6kZpv3+29zHddeh2MQho5bAPRfkwzKiF5sYBDz1l+ndb a9YAwSHohw/tqaUyer8kXZhPOa0Iy2DnoP8zjAF3Zn7ibTFq4+f7rGyvwW1p6W1ZT5hQQw hHWQSWt49R1VoKRGiJM6ADvBbDfJ8S9Z+rCIGzb5ML4flv9lx+f4Bemx8ycyKem8S+ZGCm M/aL8Xu0m2GBJOzLnFygHWRNxZIHbaMusp5SmiTDPbyGIwGZsmvAT6L3StJA0g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694770895; a=rsa-sha256; cv=none; b=RmJukhC6izvXuwk914zPZM4bgrEZptksPsO/PgOKF6Fi1SiD4nq1ThPPcKLqcnNyg+od/0 6aWYwc1cbrDDnCB2nkKfm3aQXaZ3ZyaRhaTDGl+RhpdpORqnYc7qZQkcUUyu/EibD5re9M DDBaxLnVFXaBQ8VFK4yJ0lZt+YgtR6Ppa8f9JHBC9ZUd02VqAzhshV/RivZVMyYOvC+2Sz jdf20MivsBwTUbg/2hAD4sONTQn+fRoR62/oE5mjCh4miz9PipODSRjgnACeiFTGqAtNHb 6yXdlbMXYlFa9HOzOi3IWGtCGfe+xlAiczXhtxUaeUlrvGe8REIifDmwVyiEwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="I9/i5PNQ"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qh5Jf-00011e-O2; Fri, 15 Sep 2023 05:40:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qh5Jd-00010s-Ii for emacs-orgmode@gnu.org; Fri, 15 Sep 2023 05:40:45 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qh5JZ-0000XK-Br for emacs-orgmode@gnu.org; Fri, 15 Sep 2023 05:40:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 87F82240029 for ; Fri, 15 Sep 2023 11:40:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694770838; bh=OQ6M1m9De0eIzzzf7Zg8xDRu7NA2Kb7WGFyrxdFRGOk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=I9/i5PNQzHo85xYULXjm34ARekWiC57kxJfIwzj5HaAoJ562qnz0Al04AyRc/UZ2s s1ZDx/7BL0+dcKkZ2PAKQwwYKa/Wp/ljtvrq8eGh0U1eyanVDqtfNiSXorMSu7QJLu VKV9+VKAHFILL/JeMlvl9Z0agGLg9iWiWhRm1+BbuJnyhLe2cOq8MlsLKnnkUvwaCV qvDKhOwJ06Lx2yptS6dcGDTakJGkVJWyRmq68IFu65jtZCFaG8UEwev4JtJ0lmb3DR eDialgyXFAC+mUVlvUgAxJZIKkGWr8xwhd9EfoE0v3/PU24UWcWX4Fhy1rpVs70zeM XFjbXl1RNUwag== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rn8Ls67Hdz6tvx; Fri, 15 Sep 2023 11:40:37 +0200 (CEST) From: Ihor Radchenko To: Leo Butler Cc: Bastien , Lockywolf , "emacs-orgmode@gnu.org" Subject: Re: [PATCH] ob-maxima.el, etc. (was Re: [MAINTENANCE] On how much we can expose internals into defcustom) In-Reply-To: <87y1hb5cb4.fsf_-_@t14.reltub.ca> References: <874jkemrk2.fsf@laptop.lockywolf.net> <87cyz1ivzw.fsf@t14.reltub.ca> <874jkdhwix.fsf@localhost> <87wmx8h2b0.fsf@t14.reltub.ca> <87il8ovqeg.fsf@localhost> <87cyyvdraz.fsf@t14.reltub.ca> <87ledinrl5.fsf@localhost> <87y1hb5cb4.fsf_-_@t14.reltub.ca> Date: Fri, 15 Sep 2023 09:41:38 +0000 Message-ID: <87jzsrai3x.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.97 X-Spam-Score: -4.97 X-Migadu-Queue-Id: 2B009376E9 X-Migadu-Scanner: mx0.migadu.com X-TUID: 6QHvaw5zS4mr Leo Butler writes: > Attached is a patch that tries to address some of Ihor's concerns. I > have added two header arguments for maxima src blocks: Thanks! > - :graphics-pkg lets the user choose the graphics package to use; > > - :batch lets the user choose which source-code loader Maxima will use. We need to document the new header arguments in ORG-NEWS and in https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html Also, non-standard arguments should be defined in `org-babel-header-args:maxima'. > I have also moved two defaults, that were embedded in the code, to > `defvar' forms. This is fine, although I would prefer to keep these variables private for now. > +(defvar org-babel-maxima-command-arguments > + "--very-quiet" > + "A string containing the command-line arguments used when calling the Maxima executable. See `org-babel-maxima-command', `org-babel-maxima-batch/load' and `org-babel-execute:maxima'.") Here and in the other docstrings, please use a single short sentence in the first line. Also, please use double space between sentences and fill the docstring text to standard fill-column. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html > +(defvar org-babel-maxima-graphic-package-options > + '((plot . "(set_plot_option ('[gnuplot_term, %s]), set_plot_option ('[gnuplot_out_file, %S]))$") > + (draw . "(load(draw), set_draw_defaults(terminal='%s,file_name=%S))$")) > + "An alist, each element of the form (PACKAGE-NAME . FORMAT-STRING). The format string contains the Maxima code to set the graphic file terminal and name. It must contain `%s' to set the terminal and `%S' to set the filename. The default package is `plot'. See `org-babel-maxima-expand'.") According to the docstring, it appears that the order of %s and %S do not matter, which is probably not the case. > + ;; graphic output > + (if graphic-file > + (let ((graphics-pkg (intern (or (cdr (assq :graphics-pkg params)) "plot"))) > + (graphic-format-string (cdr (assq graphics-pkg org-babel-maxima-graphic-package-options))) > + (graphic-terminal (file-name-extension graphic-file)) > + (graphic-file (if (eq graphics-pkg 'plot) graphic-file (file-name-sans-extension graphic-file)))) > + (format graphic-format-string graphic-terminal graphic-file))) What will happen if :graphics-pkg value is not expected? What about unsupported graphics file extensions? And is it always the that terminal name is the same as file extension (I am thinking about Gnuplot's pngcairo terminal)? > - (format "batchload(%S)$" in-file)) > + (format "(linenum:0, %s(%S))$" batch/load in-file)) May you clarify the purpose of "linenum"? > (unless (or (string-match "batch" line) > (string-match "^rat: replaced .*$" line) > (string-match "^;;; Loading #P" line) > + (string-match "^read and interpret" line) > + (string-match "^(%\\([io]-?[0-9]+\\))[ ]+$" line) May you explain why you added these two conditions? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at