aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2019-12-30 13:11:57 +0100
committerWilfred Hughes <me@wilfred.me.uk>2020-01-01 13:46:10 +0000
commit982dd49c9c7e63fa94b56824f50dea4186081f8e (patch)
tree994baa30ea87e0860790473de8bb53dbb412b2b9 /test
parentedddccbebd82dde0a18662a0995bfe930112458c (diff)
Improve link creation from Info manual references
* helpful.el (helpful--propertize-info): Follow Emacs convention for function documentation. Consider lowercase "info" and angular quotation marks in docstrings. Default to the Emacs manual if there's no manual reference (ie. see the `blink-cursor-mode' variable). * test/helpful-unit-test.el (helpful--format-docstring--info): Add new testcases for the now covered cases.
Diffstat (limited to 'test')
-rw-r--r--test/helpful-unit-test.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el
index d296423..0250980 100644
--- a/test/helpful-unit-test.el
+++ b/test/helpful-unit-test.el
@@ -317,6 +317,27 @@ symbol (not a form)."
(should
(string-equal formatted "Info node (elisp)foo \nbar"))
(should
+ (get-text-property paren-position 'button formatted)))
+ ;; Some docstrings use "info" (lowercase).
+ (let* ((formatted (helpful--format-docstring "info node `(elisp)foo'"))
+ (paren-position (s-index-of "(" formatted)))
+ (should
+ (string-equal formatted "info node (elisp)foo"))
+ (should
+ (get-text-property paren-position 'button formatted)))
+ ;; Some docstrings use angular quotation marks.
+ (let* ((formatted (helpful--format-docstring "Info node ‘(elisp)foo’"))
+ (paren-position (s-index-of "(" formatted)))
+ (should
+ (string-equal formatted "Info node (elisp)foo"))
+ (should
+ (get-text-property paren-position 'button formatted)))
+ ;; If there's no manual information, assume it is part of the Emacs manual.
+ (let* ((formatted (helpful--format-docstring "Info node ‘foo’"))
+ (paren-position (s-index-of "(" formatted)))
+ (should
+ (string-equal formatted "Info node (emacs)foo"))
+ (should
(get-text-property paren-position 'button formatted))))
(ert-deftest helpful--format-docstring--url ()