From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OMGhDwZAa2RKTgEASxT56A (envelope-from ) for ; Mon, 22 May 2023 12:12:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8PyfDgZAa2TceQAAG6o9tA (envelope-from ) for ; Mon, 22 May 2023 12:12:22 +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 9CBF6D2A1 for ; Mon, 22 May 2023 12:12:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q12VZ-0006Nb-Hx; Mon, 22 May 2023 06:11:17 -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 1q12VS-0006NL-3a for emacs-orgmode@gnu.org; Mon, 22 May 2023 06:11:11 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q12VQ-0001fq-Cv for emacs-orgmode@gnu.org; Mon, 22 May 2023 06:11:09 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-54f5fdaa693so2099948eaf.1 for ; Mon, 22 May 2023 03:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684750265; x=1687342265; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=cuaUDEnt4maAK0w0vl4bbq2fIj2lR9nVcOAUcLu8nBQ=; b=YvW57mBIFqSwczz9wql6shp0UicgeBifFyoc/Jpa3AYH8zsp7HWuXcJ63VCthW6alm 0SPHa8RfmdI2N+1GBhqjPMSxiI2RDk8BYVEgIu2c96OyZpmxYQOqVZl9m2Dr/qpD0gOX xVriYaPzJ+Ld5ZxLBYoxxzccXEl/vkyqrZmWv0PebY3rq7EW6LFyxzrtPfcbQawbHmIX PLw1YzbWF3s7PxwbOE84s0aLT556Woo9VhWcbwlEf8FhnQQq2x+PMI/T9H8eUch6nxOd g1+wgNwYwXtkvCSjWb2aR70w06gvo3n9CvfLub8ClkTUriu3+7X3qyS9f9sdg/uoDDxs ZGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684750265; x=1687342265; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cuaUDEnt4maAK0w0vl4bbq2fIj2lR9nVcOAUcLu8nBQ=; b=WZxRjYINDL9kznnqU4IHfVqo0Wun5oyLcsdovisqgpPIaKbPZtqJE6GGIt8cjrcdxh RvwffLBxNPrtq4Fsip8nrYYM1WrLLvW+UmNXYOtExeco3Q5eauugqiHFjjsENlI1YrAd E2Nx8sRfLbgEU1nEyxiGXflpaJUTahUX8gVJhibdDTQIr8q+Iq0JLCZElMhTHSpsHetc hO2aKMwRfdnWNlOn9VFAz6ldekQzIcVYjx0AitFOpkpqd/WrQfL5mQ6pAdMGA2OJgwN7 LxuPT5IPKCgaUFdNf/pKXWOCZn4I+eixBRVQe1jsXPYncNWdS+VcFT4g8JblmMZ4HmMF ReMQ== X-Gm-Message-State: AC+VfDwYRIgP0ekUV4f4QeksOCzUK6f1P5U/o1ErU//wWS+D0FIh5m+T senbzuVmZUCQpR7yNmafi4vb9UwcA9o= X-Google-Smtp-Source: ACHHUZ4JI9aY7hjYwSz9XV4RNdJo8u5JJm9d3PNL9VnbmbVZu8hw61pQLSOSxGTeB/RjqDx/0EatOg== X-Received: by 2002:a05:6808:298d:b0:394:3442:2631 with SMTP id ex13-20020a056808298d00b0039434422631mr5262431oib.9.1684750265329; Mon, 22 May 2023 03:11:05 -0700 (PDT) Received: from storimasta ([2804:14c:5bb1:5200::e9eb]) by smtp.gmail.com with ESMTPSA id r193-20020acaa8ca000000b00397f39bcf4asm1965812oie.36.2023.05.22.03.11.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 03:11:04 -0700 (PDT) From: Bruno Cardoso To: emacs-orgmode@gnu.org Subject: [PATCH] lisp/org.el: allow org-return to call org-open-at-point on citations Date: Mon, 22 May 2023 07:10:57 -0300 Message-ID: <87sfboekwe.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=cardoso.bc@gmail.com; helo=mail-oo1-xc29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684750341; a=rsa-sha256; cv=none; b=HV5v1nVa5ZkOzZyZTgafN7r2toU+oxtuupauWTyjxHz3VWxR/saRKci0erBv3nG24P08y0 VCe9CmgpOW49CcB3abO0ntjBl2lPoOgiXGiwwKqZ+ATST2EZyceusJvIkcc0Ezofa7gxkn qTl/ILijXEpTCGodLRuGU7PDzmwHhMxfMmKnsqERU37P3+TyTyCtOxbj3tc8BC6jEnYBOM s39PV0dzZbjT7702OVlYe4qRkTBJEUMSAnko5v0IfE8y1mbVBIZ/zcQAjVLNhYjNQoKnM+ +juRg/K1/BJdLiYMA48cQNgjbhI4ObKuZIEwbMvRhScBX1tzEUoEfOSXl6MNNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YvW57mBI; 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=1684750341; 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=cuaUDEnt4maAK0w0vl4bbq2fIj2lR9nVcOAUcLu8nBQ=; b=Vyq/JNgj6glRYVLKyNbIh7o93uZun8O0CFvay7QoIRSzPEVJ5y12UDy8wVK4gfnknzI4bQ NZTGgkvheUbn3vuFomEJR1NzrDX0BNyyN7Z0S8f1XI/aB63JlPTpnyRcz2Mr1ZUga8cLF/ 3CQMCojVq+k4pV02wdPGQI9K7DfciPoyEUvLyfVKrV20Wjpd+LxtbeHjBqu6u1DSq3+rQq 9kPV+Ro1WB34eIOtAOrGBo7dE8OHQAF15daVEf3s2gVR+8rOj+MvA1Qz+uhuuX+6kVUyEV 8WHdgQm8rTjottaUsqLAXLz/pIavyaLYNcTCUu0Mhpp0jsGYVLLCN5LmlmIbVQ== X-Migadu-Spam-Score: -5.08 X-Spam-Score: -5.08 X-Migadu-Queue-Id: 9CBF6D2A1 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YvW57mBI; 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" X-TUID: GH2kJbq+fIQ2 --=-=-= Content-Type: text/plain Hello everyone. This patch is a tiny change that allows `org-return' to call `org-open-at-point' when cursor is over org-cite citations. Best, Bruno. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-org.el-allow-org-return-to-call-org-open-at-poi.patch >From 19409cbf70958aa1d7f508cd7151f36a92212341 Mon Sep 17 00:00:00 2001 From: bruno Date: Sun, 21 May 2023 15:53:42 -0300 Subject: [PATCH] lisp/org.el: allow org-return to call org-open-at-point on citations * lisp/org.el (org-return): When `org-return-follows-link' is non-nil and point is over an org-cite citation or citantion reference, call `org-open-at-point'. TINYCHANGE --- lisp/org.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 866af624e..8eab3ed22 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17774,8 +17774,8 @@ When optional INDENT argument is non-nil, call and INTERACTIVE. When `org-return-follows-link' is non-nil and point is on -a timestamp or a link, call `org-open-at-point'. However, it -will not happen if point is in a table or on a \"dead\" +a timestamp, a link or a citation, call `org-open-at-point'. +However, it will not happen if point is in a table or on a \"dead\" object (e.g., within a comment). In these case, you need to use `org-open-at-point' directly." (interactive "i\nP\np") @@ -17795,8 +17795,8 @@ object (e.g., within a comment). In these case, you need to use (insert "\n") (org-table-justify-field-maybe) (call-interactively #'org-table-next-row))) - ;; On a link or a timestamp, call `org-open-at-point' if - ;; `org-return-follows-link' allows it. Tolerate fuzzy + ;; On a link, a timestamp or a citation, call `org-open-at-point' + ;; if `org-return-follows-link' allows it. Tolerate fuzzy ;; locations, e.g., in a comment, as `org-open-at-point'. ((and org-return-follows-link (or (and (eq 'link element-type) @@ -17808,6 +17808,7 @@ object (e.g., within a comment). In these case, you need to use (> (point) origin)))) (org-in-regexp org-ts-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t) + (org-element-lineage context '(citation citation-reference)) (org-in-regexp org-link-any-re nil t))) (call-interactively #'org-open-at-point)) ;; Insert newline in heading, but preserve tags. -- 2.40.1 --=-=-=--