commit 245048062f6e18c7dd3fd76b37b000bd4784d9b3
parent 358d063ab47c59125dd66f6857792db04e413648
Author: Wilfred Hughes <me@wilfred.me.uk>
Date: Mon, 18 Dec 2017 21:50:23 +0000
Support newlines in Info node references
See indirect-function for an example
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git 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