summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2020-04-26 10:36:39 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2020-04-26 10:36:39 +0200
commitf3c137a69797b0432db4dd887c547b2d69c4ed4d (patch)
tree7b88200619e2391cca7a4d86263839df05665190
parent0b3a2b3271968e4a697dd34a2828cd2ecdd62a4c (diff)
downloadorg-mode-f3c137a69797b0432db4dd887c547b2d69c4ed4d.tar.gz
ol: Fix info links with backquotes and backslashes
* lisp/ol.el (org-store-link): Remove spurious backslash appearing in some Info buffers. Reported-by: Achilles Yuce <ayuce@posteo.mx> <http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00405.html>
-rw-r--r--lisp/ol.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ol.el b/lisp/ol.el
index 9bdd3ad..32f2e97 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1454,10 +1454,16 @@ non-nil."
(org-link-store-props :type "calendar" :date cd)))
((eq major-mode 'help-mode)
- (setq link (concat "help:" (save-excursion
- (goto-char (point-min))
- (looking-at "^[^ ]+")
- (match-string 0))))
+ (let ((symbol (replace-regexp-in-string
+ ;; Help mode escapes backquotes and backslashes
+ ;; before displaying them. E.g., "`" appears
+ ;; as "\'" for reasons. Work around this.
+ (rx "\\" (group (or "`" "\\"))) "\\1"
+ (save-excursion
+ (goto-char (point-min))
+ (looking-at "^[^ ]+")
+ (match-string 0)))))
+ (setq link (concat "help:" symbol)))
(org-link-store-props :type "help"))
((eq major-mode 'w3-mode)