From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0K5eBJCbamZzJgEAe85BDQ:P1 (envelope-from ) for ; Thu, 13 Jun 2024 07:11:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0K5eBJCbamZzJgEAe85BDQ (envelope-from ) for ; Thu, 13 Jun 2024 09:11:12 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=e1gg52mu; dmarc=pass (policy=none) header.from=gmail.com; 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-Seal: i=1; s=key1; d=yhetil.org; t=1718262671; a=rsa-sha256; cv=none; b=fZoo8W+5Wciw9dTK3fSP72XBSIPfJHGeh88v89406w80sllBiXk+L0R5RZlA/TfifBJJ87 op/RMxEyrkNo/tM9paguLuPczH8hgnB+V+ncjUbQ+out5qr6RUtEUDCsqNTxQ+t3eJGgew 3nrpXR5mJNpI+5r4EbwyX2oesVIvHNlN0NlQSU7kK3FU2IDRB04XRDUABKWYK+5f1TvJbg hwp+bjFjFvBQUo113dDrLqY5s2dEsxp8XVHtok0lgp8wfAtE0wnbNrrH3MJDMGzxaufrgS siR8PUy1swBzwjA2BbSvOLSobOHXakEp2NL3hDuDFC2wp5PEG2w3ui9AI1muuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=e1gg52mu; dmarc=pass (policy=none) header.from=gmail.com; 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=1718262671; 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=bW5dwtK97fR4KWZiv8d3QSgsR86Uce6q5Und279tG7c=; b=lBpYyNY6Af8BRpLUsfH2gx8PhoKLwISLWlTckpS5jhoTlup/Sl7jUbdZHvTGVvM9dGfwXn 6CjbfIo2dfxRl6f/bSt8Fu07cKj88Rl4kHkLPqM6v/ARYNX5C96G2HjSixS0bDAQ5IimwM nMvVbDefbgy7I0KcjPRdhUfGZPHWvW/OVUEfUGSM0v+huqKNU9gBlkuSi9c84OKIfONT1J wfrYIOB+mSioaqXEzZI+skwo1uDuPB9Ps6Z7Rqf7SJdn8TxdcGFmi4hnA3bc8njvF+lQUB vvIxQm1HCOt+dPZxUcolWoJdEPzp/5jy5YxYR8/6izA1cIjv8SlZZYJQVidTNw== 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 BAE5866D9A for ; Thu, 13 Jun 2024 09:11:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHebI-0005pA-6F; Thu, 13 Jun 2024 03:10:24 -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 1sHebG-0005nQ-9V for emacs-orgmode@gnu.org; Thu, 13 Jun 2024 03:10:22 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHebE-0006SG-Bi for emacs-orgmode@gnu.org; Thu, 13 Jun 2024 03:10:22 -0400 Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-1f700e4cb92so6604945ad.2 for ; Thu, 13 Jun 2024 00:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718262618; x=1718867418; darn=gnu.org; h=mime-version:user-agent:references:message-id:date:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=bW5dwtK97fR4KWZiv8d3QSgsR86Uce6q5Und279tG7c=; b=e1gg52mu3AyMM/C3xfVR5zkn5/zSPXpwtX27aNucbG5bCyW7CbWubwEUZAk6BsGSEu cufjZovhUKuNWQeHMEKe1Uv7j/cCZganL6jHStdEl+puEHm1D3IMg4Wel4EoyHYF4z9r fMJ6TcxicmpErxM0LBKuolNPDJ6uoXP88wbfN2U1o5VfZgZZtKXgQt8ixRLOTf9Ksase yaGIXu+PLIC+Edxu/9S/J1aXuEhYflRBkUeqAdO6oqeUXYd09l19CfUQhlpnPtj1xtvb flfRBennlX9QLFtIPpsfJSEgLV+FTC5BI1JGvtyC8zpdHfzT7KMiDT6QKlrDPtkx7fXL vRgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718262618; x=1718867418; h=mime-version:user-agent:references:message-id:date:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bW5dwtK97fR4KWZiv8d3QSgsR86Uce6q5Und279tG7c=; b=ugg/nKCVVsUEDqWjVP1aE83wlCSt7VxJ+yiWBp0Y5t98Ru8wesw5BfTm94lo39SOAd AgPAs2P6+uJLhCHtT8UgzPr153XvyO30odNOVbl9NqJovIw8KghmKZHggaIRvsXlV8tq Z3taMDvMVuYxUOZaT4ZT6U0MQ5cJ7qDvenYEygSKK9noVE4CHfX9xV3U676i/gsiinq+ 7COn6byo4AGFMiYlTOQ03FZ9E9I/bGaTVqSAFYivT3jSbDwJeVGLNuF/DqaXFj+ZBVYT lp2zj7fMndFvfIbYqpCOUXiDx8Wm1auntnyq77+z3M3msbPIqaQs14wa309PldiFWJX0 iy2w== X-Gm-Message-State: AOJu0YwSbGJ6Ku5VnGtWJsv7/rdqhqSpJEwLbj395f7Oymv1y1QTENLU 1J9lobE99GA+1Fr/RYH/JWa2NNqCXFYV97IRyEJqb+/0EJ571KC/lWlPLUPT X-Google-Smtp-Source: AGHT+IHnoBgdu+QO6XCMQxAVjEGggVoIoQynd85wNlcruaBO6ylWqKYh/gPLjDDooWVMsRGRtU6agA== X-Received: by 2002:a17:902:b694:b0:1f7:42c6:50a4 with SMTP id d9443c01a7336-1f83b717927mr40935735ad.42.1718262618133; Thu, 13 Jun 2024 00:10:18 -0700 (PDT) Received: from localhost ([103.232.241.147]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855e6fa34sm6327575ad.79.2024.06.13.00.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:10:17 -0700 (PDT) From: Visuwesh To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-plot: Unable to use text xtics with type:2d (+ more) [9.7-pre (N/A @ /home/viz/lib/emacs/straight/build/org/)] In-Reply-To: <87wmmu72pu.fsf@localhost> (Ihor Radchenko's message of "Wed, 12 Jun 2024 12:41:33 +0000") Date: Thu, 13 Jun 2024 12:34:26 +0530 Message-ID: <87zfrp4939.fsf@gmail.com> References: <87cypbjw50.fsf@gmail.com> <871q5rv1qy.fsf@localhost> <8734q7jfes.fsf@gmail.com> <87wmmu72pu.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x641.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: BAE5866D9A X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.88 X-Spam-Score: -7.88 X-TUID: upkmIWvw9Qj6 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=9C=E0=AF=82=E0=AE=A9= =E0=AF=8D 12, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> I do not think that it is right. >>> AFAIU, the idea is that `org-plot/preset-plot-types' provides some >>> default options, but the user can overwrite these defaults in the #+PLOT >>> line. What you propose will disregard the values of >>> >>> :set :line :map :title :file :ind :timeind :timefmt :textind >>> :deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks >>> >>> if they are customized by user in `org-plot/preset-plot-types'. >> >> I don't follow your conclusion since this change will only affect the >> value of :check-ind-type leaving the rest of the settings unaffected. > > My point is that we will eventually need to merge TYPE and PARAMS to > fix another bug - `org-plot/preset-plot-types' options like :set, :line, > etc being ignored. So, instead of patching the way you proposed, we can > merge TYPE and PARAMS into PARAMS, making the existing (plist-get params > :check-ind-type) working. > > In other words, org-plot's handling of parameters is very broken > now. There is more than one bug lurking there, and it may be more > productive to fix things together. > > You solution will, of course, work, but only for this specific bug you > described; not for other. OK, thanks for the explanation. I was unaware of the issue as I didn't read the code closely enough. What about the attached patch? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org-plot-Respect-parameters-given-in-org-plot-preset.patch >From 2a153a5bc015b0e970ecde39fd2edbb515261349 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 13 Jun 2024 12:33:49 +0530 Subject: [PATCH] org-plot: Respect parameters given in `org-plot/preset-plot-types' * lisp/org-plot.el (org-plot/preset-plot-types): Fix docstring and correct the lambda argument order for the 'grid' plot type. (org-plot/gnuplot): Merge the parameters given in `org-plot/preset-plot-types' and the #+PLOT line to ensure the former is respected everywhere. Reported-by: Visuwesh Link: https://orgmode.org/list/87edbu4kdh.fsf@gmail.com --- lisp/org-plot.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index 283d993..6d53830 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -349,7 +349,7 @@ (defcustom org-plot/preset-plot-types (grid :plot-cmd "splot" :plot-pre (lambda (_table _data-file _num-cols params _plot-str) (if (plist-get params :map) "set pm3d map" "set map")) - :data-dump (lambda (table data-file params _num-cols) + :data-dump (lambda (table data-file _num-cols params) (let ((y-labels (org-plot/gnuplot-to-grid-data table data-file params))) (when y-labels (plist-put params :ylabels y-labels)))) @@ -391,8 +391,8 @@ (defcustom org-plot/preset-plot-types - :data-dump - Function to dump the table to a datafile for ease of use. - Accepts lambda function. Default lambda body: - (org-plot/gnuplot-to-data table data-file params) + Accepts lambda function with arguments: + (table data-file num-cols params) - :plot-pre - Gnuplot code to be inserted early into the script, just after term and output have been set. @@ -679,8 +679,8 @@ (defun org-plot/gnuplot (&optional params) tbl)) (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table) (nth 0 table)))) - (type (assoc (plist-get params :plot-type) - org-plot/preset-plot-types)) + (type (cdr (assoc (plist-get params :plot-type) + org-plot/preset-plot-types))) gnuplot-script) (unless type @@ -695,6 +695,7 @@ (defun org-plot/gnuplot (&optional params) (save-excursion (while (and (equal 0 (forward-line -1)) (looking-at "[[:space:]]*#\\+")) (setf params (org-plot/collect-options params)))) + (setq params (org-combine-plists type params)) ;; Dump table to datafile (let ((dump-func (plist-get type :data-dump))) (if dump-func -- 2.43.0 --=-=-=--