aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2017-12-18 21:50:23 +0000
committerWilfred Hughes <me@wilfred.me.uk>2017-12-18 21:50:23 +0000
commit245048062f6e18c7dd3fd76b37b000bd4784d9b3 (patch)
tree264f63e5b7a09e24f95d8d7822621064242b4ef3
parent358d063ab47c59125dd66f6857792db04e413648 (diff)
Support newlines in Info node references
See indirect-function for an example
-rw-r--r--helpful.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/helpful.el b/helpful.el
index 21fc021..e4dc582 100644
--- a/helpful.el
+++ b/helpful.el
@@ -436,12 +436,18 @@ blank line afterwards."
"Convert info references in docstrings to buttons."
(replace-regexp-in-string
;; Replace all text of the form `foo'.
- (rx "Info node `" (group (+ (not (in "'")))) "'")
+ (rx "Info node"
+ (group (+ whitespace))
+ "`"
+ (group (+ (not (in "'"))))
+ "'")
(lambda (it)
;; info-node has the form "(cl)Loop Facility".
- (let ((info-node (match-string 1 it)))
+ (let ((space (match-string 1 it))
+ (info-node (match-string 2 it)))
(concat
- "Info node "
+ "Info node"
+ space
(make-text-button
info-node nil
:type 'helpful-info-button