mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-21 07:49:24 +00:00
org.el: Don't add curly braces to bracket links within internal links
* org.el (org-store-link): When creating a link to a heading with a bracket link, don't escape this link with curly braces as the escaped link is not active anyway; use the description instead. If the headline only consists of a bracket link, add a star to the description so that the user knows this is an internal link. Thanks to Dave Abrahams for triggering this.
This commit is contained in:
parent
12fd14b858
commit
1db82b269a
|
@ -9062,7 +9062,12 @@ part of Org's core."
|
|||
(if (consp link) (setq cpltxt (car link) link (cdr link)))
|
||||
(setq link (or link cpltxt)
|
||||
desc (or desc cpltxt))
|
||||
(if (equal desc "NONE") (setq desc nil))
|
||||
(cond ((equal desc "NONE") (setq desc nil))
|
||||
((string-match org-bracket-link-regexp desc)
|
||||
(setq desc (replace-regexp-in-string
|
||||
org-bracket-link-regexp
|
||||
(concat "\\3" (if (equal (length (match-string 0 desc))
|
||||
(length desc)) "*" "")) desc))))
|
||||
|
||||
(if (and (or (org-called-interactively-p 'any) executing-kbd-macro) link)
|
||||
(progn
|
||||
|
|
Loading…
Reference in a new issue