From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0PJoOFS/O2KvtAAAgWs5BA (envelope-from ) for ; Thu, 24 Mar 2022 01:46:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4DPoMFS/O2LsEAEAG6o9tA (envelope-from ) for ; Thu, 24 Mar 2022 01:46:12 +0100 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 32BF82B041 for ; Thu, 24 Mar 2022 01:46:12 +0100 (CET) Received: from localhost ([::1]:51944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXBcA-0000y9-KI for larch@yhetil.org; Wed, 23 Mar 2022 20:46:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXBav-0000xH-0t for emacs-orgmode@gnu.org; Wed, 23 Mar 2022 20:44:53 -0400 Received: from mail-oln040092074083.outbound.protection.outlook.com ([40.92.74.83]:26731 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXBat-0000rF-0X for emacs-orgmode@gnu.org; Wed, 23 Mar 2022 20:44:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYUf6JgLlXgOKVa+V2WXWIL6r9nbeNy0S/peiv6wB62uwEjLwUFlM6Uj4SpWTXXkgs57lVlbcvA9U1VyG0CIknTi3WmP6CNbrI5uJcuUgM4WMkSJcYboka0p8iyKYSwBGW90RMxuqYACwMSUV1su8XwI9TMIkZNNFl7/3LFRu6LbnEOqd3IFqQ3bJH1td/kV5rZqi8RMQ4fCDduRaDkqIM0C+5Vimpw0HHXKO89aBZgX5oOawU8dP9qDxnD7s0pcnGoBTP74OQk7BHKS36z49D2hE2KybWHvdtRO9YPZdy6aUM+Ekg0q2PCIYkBcuBCQqQPnPaioEECVp423f+hXcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qATUkLAEEsdsb3+FJNLcggSxymPDBVHopnhqwzJcUUU=; b=lAjkzLmCcQFTibZcZylcCdFgy+ET26GwPqx7jYHHFHVZXf0uZXPayTFDxmbfg9Wkwa9qVFph3VzzIT7Nhp4w//IJZYg3j5Eje+0/h5BJSvOipgE7FYTilt66JoQCfJHnxmqxeaOYGMYHoCROd9dI633eAqctGRdLV9Ua2mjbDXUoq/lteL3RMpSnCAF+zcHtY0TrecKIHtB+VRzTGQohNs8sremDGX8HW8Zp+b2Q4MG724Zu+3oYEQZGbXUweu3ilR5IptBEyl8vbK/jHEZ/QHHsfdPDdovDcOqIJBZEBO0QHcvNUOXKo0H5+ia0Z0toofPuoRNrC2cV0r5M0M/Q/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qATUkLAEEsdsb3+FJNLcggSxymPDBVHopnhqwzJcUUU=; b=uocLEyXU1M9HSo1+RiEGjinTItm+qSEghfWmPhSaKXbKsxwNEDD6MkJsJLgAqm5GYqm2ugCSzNeiXv4iKL9S9jCXPB8NQfAP8RTFiEGn1LunpLHy2aCJ8Nute1mHriaabaaplZUVFV0X3VFSFqswtHXGDOS8dMLO8vIec0Yi47xD8uthzomvcLUSfk2JiOk+GehRaF4K14FnlL1KDShut6DtjcWC1sl5yhU9S3FLBOpJFXlejbOmptJTAKcbvu5eFHa4tM+By+8oNelEbejUXVWLGuQmagTATffQl7n4yoUbIFswDVcQlOPrJE5WJB2CCYUBoeK7Na1KlwPod4WHHw== Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by DB9PR06MB7338.eurprd06.prod.outlook.com (2603:10a6:10:219::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.18; Thu, 24 Mar 2022 00:25:20 +0000 Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f%8]) with mapi id 15.20.5102.017; Thu, 24 Mar 2022 00:25:19 +0000 User-agent: mu4e 1.6.10; emacs 29.0.50 From: Ignacio Casso To: emacs-orgmode@gnu.org Subject: [BUG] C-c C-o on headline evaluates source code blocks with links inside [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)] Date: Thu, 24 Mar 2022 00:15:35 +0100 Message-ID: Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [fxBE732V72r6KMxLUjOi61HBN/iH4D+Z] X-ClientProxiedBy: MRXP264CA0003.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:15::15) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <878rt019jq.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c69238e-3814-469a-e8fa-08da0d2cc6d0 X-MS-TrafficTypeDiagnostic: DB9PR06MB7338:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8XkoFwLOR63i1BGYnAVIqeh+lEUIkXtFmS7VPYWExjRzp3miBMrt5ahfaEMaKI9zErZCL+wONU6TCX2u/YqHTFJf3hN/NO2Gw8SQfMO2HXkvYOZW+4ovUg+/OW0CU5dnXSX9lra8YFyY4q5EPrXecBAw7MQSh7Xx+RQfAPCc1DHecuQaEc+aZqFK0X/RPd7Ck/C0UJi3ZweHJJXGUC8aZD+QGc0YxQ8QCb6Jqfg3LFnGRo+KTTnWA1km5wSmi3YHRWQ0imUzfpOLnrusextZ/djUOXofMZ408ycgP3euVklEuZ6XRW8pvY6F+OGF8C8vnAGbUqJ6e61o86PVUf8Z48ZnNGgW7Ibz61wTO8uvxTECVAd4cJIDDx6P5Kiiz1bkdjoyAt0K9lvK4pUYC5mHVYE9B4+Go9JJRb1GE2/SnS8xR//POMb62qRh1eccoicwWwfN6nnTFgZtqakpMEdaS8Tj4Y8Ja03LpxgV32Q1fdJBDdRCJKvFBdWs5ljs/X/27kOCb6LR4syImHGSWBEBEXQg0F9lzqIz6jf1GgRqd9+RnzerFDEcbITvoeJqRCJ/l/re9ZPFzV7qCsETpFgD5NaH0NTnJ9czeWgBZeH+KDOEH7/da61sEUo0mMUUg+c X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0qHeJkdoDSpbDZoKbgQLh5yTIGhRr1FjTUpkrD7BgcUozLp5A95AtVCuWNi+?= =?us-ascii?Q?1aqQnzFJ/AmlQtfqdIg97lRrklBWzjR+Z5qIVthKc3UUu9El0d0mdMWB6ZIq?= =?us-ascii?Q?yUcV4M1Pz6yvZ0nQb4tPgB0Zl8HMhiPvNLkbmdbUOV7FIXm/DhzWdnyxHzcp?=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xY6Qq527XFHWIK/d1XmeKcx4Ll/?= =?us-ascii?Q?WZt8vcVL1nZkiqCvpU0WnT7i3dfxhZ0JeHmn40L1K8mSsJ5rQgG4anziU+em?= =?us-ascii?Q?A7+Q5X33xsxN5vmncvfFTfzra//OF2iZvpzmZbKoa/R1sOO86CfaDS689mCQ?= =?us-ascii?Q?/wb5uazxaqDF6n885G8hni32OTwjDCBvOLd5p96FBiKZ2rpZ1SXSS9Oube+u?= =?us-ascii?Q?qSUYKF2zpeXKOI7hWQtD84nJ/B85pjkjFHsmQqNWxtWnVmFQ4F0E0rQ//pbZ?= =?us-ascii?Q?W8EqtxPO4i4aIrV1OgXokm7b8dm4AnK3IuDugCKRin79OaxRvmRXU15vmmSP?= =?us-ascii?Q?1RX0L5C7AXFM0p9I7A04A/bhO8d+t59BhBKPZF/JkBqL6XhaGHW94H1Nxgq8?= =?us-ascii?Q?u3uU9t9mR+/LQaL1lCtZ5en5mW1Fs3jH?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 7c69238e-3814-469a-e8fa-08da0d2cc6d0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 00:25:19.7908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR06MB7338 Received-SPF: pass client-ip=40.92.74.83; envelope-from=ignaciocasso@hotmail.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, GAPPY_SUBJECT=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648082772; 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:dkim-signature; bh=qATUkLAEEsdsb3+FJNLcggSxymPDBVHopnhqwzJcUUU=; b=E6Jmyb1ZO3iRFkUSDEecA0Spm/JZ6hoyptE6CO2FRLH4hZAnwtP9hJXxdMbTn/y4eyJK2y 6QUhDEW+Oj4BbVD5+TJ5Myxm48+flCL/Q8kXzoFAeptbCGmmfw86lNPS/EEqg6vYKrTwj0 uVKN0Nh+lFF95CaS+I0czB/P0Tt7vmjB89AY87ouw4TZ/d9TRnL9gE3A1alrv8jlN97OK5 Qh/mO8wficbVvIhfVAoRMGv/SOqqPr1iVUyWOPi1SsXUaILYWuNKhWbET5EIqINfFolS0Y sHXQKvJJauwwqKdDLdFyEeipBPcnhNC4/Lf2ysuR3118Lf6ViPuTSB7UbFg/KQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1648082772; a=rsa-sha256; cv=pass; b=D4a1TpjQkkhsx6JKwI3JjF/fncw2wCDhisVJShdY+uzGV5l1YgErf2g6bR7ReJRiuQ7rPK W/o5qAGDWpzHUgIowAr2HfkI6lU1JOP2y7Ce2mRWfdWOaATL8VSXZJUEC1yYs22aIWu9fs PoEmaNOnqQS8gITUm3SMfQC7Kk0RO7hiBpBz2obZLRYMIGAI2RUaT1TMBhqXoloGWTqj5D SSODTxhBfgQSvNsDzrMU/LlOz8dOhDZ6wb09RFjvefODLoC/FqssjMlVKz19tTI/R298t6 2OxFrsRLcng0yKhd26kQ4Z3lzD73qETy1G3G95JfLW+Rnku1J/5IF4RdGQQDeg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=uocLEyXU; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Spam-Score: -6.89 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=uocLEyXU; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Queue-Id: 32BF82B041 X-Spam-Score: -6.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: VFzc3CGUQIVZ --=-=-= Content-Type: text/plain Hello, The recent threads about timestamps inside property drawers, which mentioned the issue of timestamps and links being recognized in contexts where they should not, had me experimenting a bit, and I found the following bug (point 3) which was probably introduced by some change regarding those issues: 1) `org-open-at-point' with point in a source code block calls and used to call `org-babel-open-src-block-result'. This is not documented on the docstring, but happens at least since Emacs 27' org built-in version, 9.4.4. 2) `org-open-at-point' with point in a link inside a source code block also calls `org-babel-open-src-block-result' since at least org version 9.4.4. However I think that back when I was using Emacs 26, with org-builtin version 9.1.9 or so, it opened the link. I think that when that was fixed, the bug in 3) was introduced. 3) `org-open-at-point' with point in a headline collects all org links in the body of the entry and offers to select one and open it, or if there was only one it opens it directly. Links are collected using a regular expression, so they match links inside a source code block. For the selected link, `org-open-at-point' moves the point to the link and calls itself recursively. In old versions of org, that means that it opened the link. But in new versions, that means it evaluates the source code block. To reproduce this behavior, just copy the following entry into an org buffer and type C-c C-o with point in the heading. It will evaluate the source code block, instead of just messaging "No Links" as it would do with a source code block without links. * Heading #+begin_src emacs-lisp (message "https://orgmode.org/manual/") #+end_src The following patch should fix it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-fixed-bug.patch Content-Description: patch >From bc5092fdef512280b7d7d3aa04f1ba887360a759 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Thu, 24 Mar 2022 01:15:44 +0100 Subject: [PATCH] fixed bug --- lisp/org/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org/org.el b/lisp/org/org.el index 67c8f1cedf..0fff28af81 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9063,7 +9063,8 @@ org-offer-links-in-entry (org-back-to-heading t) (setq end (save-excursion (outline-next-heading) (point))) (while (re-search-forward org-link-any-re end t) - (push (match-string 0) links)) + (when (eq (org-element-type (org-element-context)) 'link) + (push (match-string 0) links))) (setq links (org-uniquify (reverse links)))) (cond ((null links) -- 2.25.1 --=-=-= Content-Type: text/plain Emacs : GNU Emacs 29.0.50 (build 15, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-03-23 Package: Org mode version 9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/) --=-=-=--