From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id wJFJI5CdamYaQQEAqHPOHw:P1 (envelope-from ) for ; Thu, 13 Jun 2024 07:19:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id wJFJI5CdamYaQQEAqHPOHw (envelope-from ) for ; Thu, 13 Jun 2024 09:19:44 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fxMuTG5x; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718263184; 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=X3guH/cuoIT7mt9AWUX0GaiTJ7Ic8csfNVK5ezUyXBg=; b=OLfU1P1fSOir2TVJcEKWztRFEGQctPLhtxo6ojgoQm0gWJMD8UXd0RdOFtJDpM2H9yoc7g NlgHpcQokwMYuHwpU9TGt57eQ+WX4WuRu41fVf/hWGBB1gX1ptreQFkREQKSXkuBjGpMYu SYVOwTeBJtcNZwOMz6BA9vDnGY8HEX3uISp3zx0S70x8C8XFqmXsShop59KggYLlpdASNL cDLdMDPufz0xlQNx0tcMVEWQx1wu9A5sTtwF/ZTwZawI0zloBycdWionGQTvpf1NNOOrXd 5jtXE88ze6meeqog/cDymQ0UwJpGNA3+bdQ/rgz/NhicDuKPX3tDx4WS81cedg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fxMuTG5x; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718263184; a=rsa-sha256; cv=none; b=W/rKLLwK9qfQFM27f2w39AnzNxUqcCMYiIln7V7l/o6U+kJDN0q/I+wrXJaP1QZp0q3O5d Zp22NInf2V9ZOnhaZ/dt1r4ez0AvOVfmozBa1LlHA6kxMP6uwld1yuZcUshxYK389cJFCQ 1S1ZCWk/SNG9Dq6lrDF+D3KBDkIHV3igW3K6MdbeA9iz/N/NETuqZYcdEv5MayqUmwMVxo yj/K3lt2MOEkKVKG6vIwhpUTvGK5hw27RDyHFQxCKFhv01NzUPjhY2CwCufZSZA7G8c21c irXL/UxamS2HtwnTHqFpYKJYA5nbbHi+4janM1CdcbbkG2Y3dP0hSrTev2KqJQ== 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 3C8E664E24 for ; Thu, 13 Jun 2024 09:19:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHeje-0007pv-B0; Thu, 13 Jun 2024 03:19:02 -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 1sHejd-0007pf-5N for emacs-orgmode@gnu.org; Thu, 13 Jun 2024 03:19:01 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHejb-0008Ce-7B for emacs-orgmode@gnu.org; Thu, 13 Jun 2024 03:19:00 -0400 Received: by mail-pf1-x442.google.com with SMTP id d2e1a72fcca58-6f6a045d476so563557b3a.1 for ; Thu, 13 Jun 2024 00:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718263137; x=1718867937; 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=X3guH/cuoIT7mt9AWUX0GaiTJ7Ic8csfNVK5ezUyXBg=; b=fxMuTG5xhEkQtgLQBMv4KkxYnHSjJrANBo/kcuhW6ujHvtTUHnQEBMGi+LKXUpHp8M /58cnF3FkmATywAlPduA4u+aCfDyocXqvHToWbQUJwuN8e9S1czLpXBg3iVyCzjeF2cs HS6rq0ZeH4ATy1ULjSNAlMaNa8rfhBd9MuvYZkW8B9/wpwCN9THMvn8TIIzt5fyD6lKE zPHOfBGha0sr9sR/sfrZAuNKgqzpaVF2IlwPno0pgbt9tH8vrfimWa67nDy2MrSkuNLp jl9AkGAQCLKAHF1UF4gDUm2/TZDWEmfJtuNYxb4N202XJp5IYJ6nPqDNPrnS/z00gR8T m9bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718263137; x=1718867937; 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=X3guH/cuoIT7mt9AWUX0GaiTJ7Ic8csfNVK5ezUyXBg=; b=gP6QxM9ddUK3btOBcIBNwC7J2ICuWVfTjtm9fveXd78hZWWs7Ml652HiyZ72hB0dB7 YJWi4h3qYwU7dyJb07uz3+hxKUjiEGQ3E9a+lfdxsiC9EKA19hrrwPMy1gK17G6VVnC3 wbcz9u8FSUws+qyt6kg0GuKKBfueZUVCfE8NU5xskabxyw83hJXfhxMWYY/WfYIKzhtX Q/pXdsfGn4AV/3NiKCY473MZra0uhcEMaQOGxd9/iLRRB741qiePU4tNMu5Q/v8gTAmy mbVc4iZu7Urg3HQgaLLU4HjJ2w2JbpX9Ir6XZw8wPekExgg1MFUYUGVxCfPwDGD0A34c a0zg== X-Gm-Message-State: AOJu0YzpdAy0oM80QlVXSVSE2oh4+3+Pw3QyvqrRuawzvkNRjbcF+TeF 9L7ZSWj2k1Dninv12NSOSN29wUduPAt0IOPT8M78P71m+hS/n1snAHPGTUhW X-Google-Smtp-Source: AGHT+IF5aypy6OuwV3uGPFBEsIOVcaWJg/aR9b/JgPJlQAFdUoKyo2lvVkO5ZmJp2SSA43YPbWAy5Q== X-Received: by 2002:a05:6a00:3cc8:b0:705:972a:53f with SMTP id d2e1a72fcca58-705bce07ba6mr4360503b3a.18.1718263136975; Thu, 13 Jun 2024 00:18:56 -0700 (PDT) Received: from localhost ([103.232.241.147]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc974330sm693253b3a.68.2024.06.13.00.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:18:56 -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: <87zfrp4939.fsf@gmail.com> (Visuwesh's message of "Thu, 13 Jun 2024 12:34:26 +0530") Date: Thu, 13 Jun 2024 12:48:51 +0530 Message-ID: <87ikyd48f8.fsf@gmail.com> References: <87cypbjw50.fsf@gmail.com> <871q5rv1qy.fsf@localhost> <8734q7jfes.fsf@gmail.com> <87wmmu72pu.fsf@localhost> <87zfrp4939.fsf@gmail.com> 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::442; envelope-from=visuweshm@gmail.com; helo=mail-pf1-x442.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.88 X-Spam-Score: -7.88 X-Migadu-Queue-Id: 3C8E664E24 X-Migadu-Scanner: mx13.migadu.com X-TUID: +SslfZypHuPn --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=9C= =E0=AF=82=E0=AE=A9=E0=AF=8D 13, 2024] Visuwesh wrote: > [=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 #+PL= OT >>>> 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? Sorry for the noise, I copied the wrong link in the commit message. Please see attached instead. --=-=-= 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/87cypbjw50.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 --=-=-=--