org.el (org-store-link): When a bracket link is found in a headline, use the link description or the link path

* org.el (org-store-link): When a bracket link is found in a
headline, use the link description or the link path.
This commit is contained in:
Bastien Guerry 2013-04-16 16:05:55 +02:00
parent 407a6acf4d
commit 4f89c37cea
1 changed files with 9 additions and 6 deletions

View File

@ -9547,12 +9547,15 @@ active region."
(setq link (or link cpltxt) (setq link (or link cpltxt)
desc (or desc cpltxt)) desc (or desc cpltxt))
(cond ((equal desc "NONE") (setq desc nil)) (cond ((equal desc "NONE") (setq desc nil))
((string-match org-bracket-link-regexp desc) ((string-match org-bracket-link-analytic-regexp desc)
(setq desc (let ((d0 (match-string 3 desc))
(replace-regexp-in-string (p0 (match-string 5 desc)))
org-bracket-link-regexp (setq desc
(concat "\\3" (if (equal (length (match-string 0 desc)) (replace-regexp-in-string
(length desc)) "*" "")) desc)))) org-bracket-link-regexp
(concat (or p0 d0)
(if (equal (length (match-string 0 desc))
(length desc)) "*" "")) desc)))))
;; Return the link ;; Return the link
(if (not (and (or (org-called-interactively-p 'any) (if (not (and (or (org-called-interactively-p 'any)