mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-16 21:46:26 +00:00
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 citation reference, call `org-open-at-point'. TINYCHANGE
This commit is contained in:
parent
93492b8619
commit
513534f2a7
|
@ -221,6 +221,11 @@ Running shell blocks with the ~:session~ header freezes Emacs until
|
||||||
execution completes. The new ~:async~ header allows users to continue
|
execution completes. The new ~:async~ header allows users to continue
|
||||||
editing with Emacs while a ~:session~ block executes.
|
editing with Emacs while a ~:session~ block executes.
|
||||||
|
|
||||||
|
*** ~org-return~ now acts on citations at point
|
||||||
|
|
||||||
|
When ~org-return-follows-link~ is non-nil and cursor is over an
|
||||||
|
org-cite citation, ~org-return~ will call ~org-open-at-point~.
|
||||||
|
|
||||||
** Miscellaneous
|
** Miscellaneous
|
||||||
*** =org-crypt.el= now applies initial visibility settings to decrypted entries
|
*** =org-crypt.el= now applies initial visibility settings to decrypted entries
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ implementation is bad."
|
||||||
:type 'hook)
|
:type 'hook)
|
||||||
|
|
||||||
(defcustom org-return-follows-link nil
|
(defcustom org-return-follows-link nil
|
||||||
"Non-nil means on links RET will follow the link.
|
"Non-nil means on links RET will open links, timestamps, and citations.
|
||||||
In tables, the special behavior of RET has precedence."
|
In tables, the special behavior of RET has precedence."
|
||||||
:group 'org-link-follow
|
:group 'org-link-follow
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
|
|
|
@ -17774,8 +17774,8 @@ When optional INDENT argument is non-nil, call
|
||||||
and INTERACTIVE.
|
and INTERACTIVE.
|
||||||
|
|
||||||
When `org-return-follows-link' is non-nil and point is on
|
When `org-return-follows-link' is non-nil and point is on
|
||||||
a timestamp or a link, call `org-open-at-point'. However, it
|
a timestamp, a link or a citation, call `org-open-at-point'.
|
||||||
will not happen if point is in a table or on a \"dead\"
|
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
|
object (e.g., within a comment). In these case, you need to use
|
||||||
`org-open-at-point' directly."
|
`org-open-at-point' directly."
|
||||||
(interactive "i\nP\np")
|
(interactive "i\nP\np")
|
||||||
|
@ -17795,8 +17795,8 @@ object (e.g., within a comment). In these case, you need to use
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(org-table-justify-field-maybe)
|
(org-table-justify-field-maybe)
|
||||||
(call-interactively #'org-table-next-row)))
|
(call-interactively #'org-table-next-row)))
|
||||||
;; On a link or a timestamp, call `org-open-at-point' if
|
;; On a link, a timestamp or a citation, call `org-open-at-point'
|
||||||
;; `org-return-follows-link' allows it. Tolerate fuzzy
|
;; if `org-return-follows-link' allows it. Tolerate fuzzy
|
||||||
;; locations, e.g., in a comment, as `org-open-at-point'.
|
;; locations, e.g., in a comment, as `org-open-at-point'.
|
||||||
((and org-return-follows-link
|
((and org-return-follows-link
|
||||||
(or (and (eq 'link element-type)
|
(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))))
|
(> (point) origin))))
|
||||||
(org-in-regexp org-ts-regexp-both nil t)
|
(org-in-regexp org-ts-regexp-both nil t)
|
||||||
(org-in-regexp org-tsr-regexp-both nil t)
|
(org-in-regexp org-tsr-regexp-both nil t)
|
||||||
|
(org-element-lineage context '(citation citation-reference) 'include-self)
|
||||||
(org-in-regexp org-link-any-re nil t)))
|
(org-in-regexp org-link-any-re nil t)))
|
||||||
(call-interactively #'org-open-at-point))
|
(call-interactively #'org-open-at-point))
|
||||||
;; Insert newline in heading, but preserve tags.
|
;; Insert newline in heading, but preserve tags.
|
||||||
|
|
Loading…
Reference in a new issue