From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AM4vKlxk72bLlQAAe85BDQ:P1 (envelope-from ) for ; Sun, 22 Sep 2024 00:27:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id AM4vKlxk72bLlQAAe85BDQ (envelope-from ) for ; Sun, 22 Sep 2024 02:27:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726964828; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=la+L2UCoUewWJFrteWFfDOWnXlIQetn29xqusvuFIB4=; b=bPN1OxS1P6XGAJtlbQB74qVC3cxKJjaBaBvI7YmBRKab/8xxNXqFIdGA4ViVl6D03MBkf0 9yNUoz/+C15U3Y804drzToCjVWcYWUXs3Edc4jbnFS3WIAhPl3HvrzZ9sjv8mei/frD6QF RJMmpv1kiYUJwEdXDMeFsploiQ5VPQIKkhWmxnRvB9MWJNBITOkll/cRq8ey4ee3rKf4wA sOXMlMpDfpUV+g7cMALczpEs5IR8R6o2/+V/U6maTQEnr8KuD5a1AEAMUZBCDqrHt93Rut sf2NQZJd/xuL1oO2xK9f8pJ/+s5wJR4GXPFshJeOoLHL3auLqyl9YmthpoRUkw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726964828; a=rsa-sha256; cv=none; b=W6vIe23LwsUzfbNZaEh1beRXir7ofkC7xN0rozX7dsq5CTOf8+kAEfagmvVwcEWK+J9zny JmutYT0FTsUYt+Bbnv4x2L+5wiJlcYQVErjHIREAoCn+yJ9vkHzv1ycZJ8CVy2dQwgtr7J yWfq6gKIYbuLc1bvyvflEoRWstu5IYkyqlAwMkaahKuMe3oqjeSleYrNoHZSWmmKE90rtK nXy3uLS2Lh+dxLl+bUERBjWMM7piJJQMVGiq4JsrYBMcJP6EpQTOeLLC2d5lnCBhxYDeh6 RihXdLRP6Jo73u8E3onp+B911r+PXVTDI3U1GWQOYPVjGJbf/0RnppwRbWNYuw== 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 2CA737D2D8 for ; Sun, 22 Sep 2024 02:27:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssAQW-0005wg-Jk; Sat, 21 Sep 2024 20:26:12 -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 1ssAQU-0005wR-FH for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 20:26:10 -0400 Received: from smtpout1.mo12.mail-out.ovh.ca ([51.161.45.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssAQS-0000QB-SE for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 20:26:10 -0400 Received: from mxplan1.mail.ovh.ca (unknown [10.111.38.108]) by mo12.mail-out.ovh.ca (Postfix) with ESMTPS id 4XB6Nk5Bf8zHptx for ; Sat, 21 Sep 2024 21:25:58 -0300 (ADT) Received: from morales.pe (54.39.251.56) by DAG2EX2.mxpca1.local (172.16.2.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 21 Sep 2024 20:25:57 -0400 X-OVh-ClientIp: 190.232.101.76 From: Rodrigo Morales To: Subject: [PATCH] fix org-babel-view-src-block-info Date: Sat, 21 Sep 2024 19:25:51 -0500 Message-ID: <87h6a8lek0.fsf@morales.pe> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [54.39.251.56] X-ClientProxiedBy: DAG2EX2.mxpca1.local (172.16.2.12) To DAG2EX2.mxpca1.local (172.16.2.12) X-Ovh-Tracer-GUID: adae1608-8d4a-482c-990f-893a4c47e2b0 X-Ovh-Tracer-Id: 7211670380615603735 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrudeliedgfeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtihesmhdtreertddttdenucfhrhhomheptfhoughrihhgohcuofhorhgrlhgvshcuoehrohgurhhighhoqdhmrghilhhinhhgqdhlihhsthhssehmohhrrghlvghsrdhpvgeqnecuggftrfgrthhtvghrnhepgfelueeiheffkeehffegiefhffevfeetudehhfduuedvkeehgefgffegtefhjeffnecukfhppeduvdejrddtrddtrddupdehgedrfeelrddvhedurdehiedpudeltddrvdefvddruddtuddrjeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehrohgurhhighhoqdhmrghilhhinhhgqdhlihhsthhssehmohhrrghlvghsrdhpvgdpnhgspghrtghpthhtohepuddprhgtphhtthhopegvmhgrtghsqdhorhhgmhhouggvsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohduvddpmhhouggvpehsmhhtphhouhht Received-SPF: pass client-ip=51.161.45.254; envelope-from=rodrigo-mailing-lists@morales.pe; helo=smtpout1.mo12.mail-out.ovh.ca X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Queue-Id: 2CA737D2D8 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -6.51 X-Migadu-Spam-Score: -6.51 X-TUID: kEr5P6RQLl7g --=-=-= Content-Type: text/plain This is one of the first patches that I sent to the Org Mode project. Please let me know if I have done something wrong, so that I don't make the same mistake in the future. --=-=-= Content-Type: text/x-diff; charset="utf-8" Content-Disposition: inline; filename="0001-lisp-ob-core.el-fix-org-babel-view-src-block-info.patch" Content-Transfer-Encoding: quoted-printable >From 4453277ee0d9aa6318008a21c4f3f9b16d29c901 Mon Sep 17 00:00:00 2001 From: Rodrigo Morales Date: Sat, 21 Sep 2024 19:04:55 -0500 Subject: [PATCH] lisp/ob-core.el: fix org-babel-view-src-block-info MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit In the previous version, when the user interactively calls org-babel-view-src-block-info and the point is on a code block, these two warnings are shown in the buffer *Warnings*: =E2=9B=94 Warning (org-element): =E2=80=98org-element-at-point=E2=80=99 can= not be used in non-Org buffer # (help-mode) =E2=9B=94 Warning (org-element): =E2=80=98org-element-at-point=E2=80=99 can= not be used in non-Org buffer # (help-mode) This happened because org-babel-view-src-block-info calls (org-entry-get (point) "header-args" t) while being in the *Help* buffer. org-babel-view-src-block-info should call org-entry-get while being in the Org Mode buffer and then switch to the *Help* buffer once it has all the information that is then displayed in the *Help* buffer. In the introduced changes, we execute (org-entry-get (point) "header-args" t) while being in the Org Mode buffer and we switch to *Help* when we have the necessary information that is then shown in the *Help* buffer. --- lisp/ob-core.el | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c61f2d400..90c52f8b7 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -358,18 +358,27 @@ a window into the `org-babel-get-src-block-info' func= tion." (full (lambda (it) (> (length it) 0))) (printf (lambda (fmt &rest args) (princ (apply #'format fmt args))))) (when info - (with-help-window (help-buffer) - (let ((name (nth 4 info)) - (lang (nth 0 info)) - (switches (nth 3 info)) - (header-args (nth 2 info))) + (let* ((name (nth 4 info)) + (language (nth 0 info)) + (switches (nth 3 info)) + (header-args (nth 2 info)) + (property-header-args + (org-entry-get (point) "header-args" t)) + (property-header-args-language + (org-entry-get (point) (concat "header-args:" language) t))) + (with-help-window (help-buffer) (when name (funcall printf "Name: %s\n" name)) - (when lang (funcall printf "Lang: %s\n" lang)) + (when language (funcall printf "Language: %s\n" language)) + ;; Show header arguments that have been set through + ;; properties (i.e. in property drawers or through + ;; #+PROPERTY) (funcall printf "Properties:\n") - (funcall printf "\t:header-args \t%s\n" (org-entry-get (point) "header-= args" t)) - (funcall printf "\t:header-args:%s \t%s\n" lang (org-entry-get (point) = (concat "header-args:" lang) t)) - + (funcall printf "\t:header-args \t%s\n" property-header-args) + (funcall printf "\t:header-args:%s \t%s\n" language property-header-arg= s-language) + ;; Show switches (when (funcall full switches) (funcall printf "Switches: %s\n" switches= )) + ;; Show default header arguments and header arguments that + ;; have been explicitly set in the current code block. (funcall printf "Header Arguments:\n") (dolist (pair (sort header-args (lambda (a b) (string< (symbol-name (car a)) --=20 2.34.1 --=-=-=--