aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2020-09-17 23:35:58 -0700
committerWilfred Hughes <me@wilfred.me.uk>2020-09-17 23:36:56 -0700
commitb0e937fff71dc0a5d34066bfd25310e76f284621 (patch)
tree5492f095ff4268801dcd55641a90f4cfd1728ee9
parentc0662aa07266fe204f4e6d72ccaa6af089400556 (diff)
Fix docstring extraction in Emacs 27
Fixes #248
-rw-r--r--CHANGELOG.md2
-rw-r--r--helpful.el5
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d193500..a2ae57e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ Report the package version when custom variables were added.
Fixed a crash on assigning byte-compiled objects to keybindings.
+Fixed an issue with advice being shown in docstrings on Emacs 27+.
+
# v0.17
Fixed a minor docstring formatting issue when keymap references were
diff --git a/helpful.el b/helpful.el
index 07c7b74..432ac38 100644
--- a/helpful.el
+++ b/helpful.el
@@ -2391,7 +2391,10 @@ state of the current symbol."
"Remove mentions of advice from DOCSTRING."
(let* ((lines (s-lines docstring))
(relevant-lines
- (--drop-while (s-starts-with-p ":around advice:" it) lines)))
+ (--drop-while
+ (or (s-starts-with-p ":around advice:" it)
+ (s-starts-with-p "This function has :around advice:" it))
+ lines)))
(s-trim (s-join "\n" relevant-lines))))
(defun helpful--format-argument (arg)