aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxeals <dev@xeal.me>2020-05-04 23:31:41 +1000
committerxeals <dev@xeal.me>2020-05-04 23:32:34 +1000
commit10943c3593901d6891ecf2350bc7eed4d560e146 (patch)
tree80094b55eed5e1e852e6564c7652257594368ab6
parent3a9ada2b46264e271923b7dbcbc219f2e360bc22 (diff)
Add "natively compiled" info to summary
-rw-r--r--helpful.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/helpful.el b/helpful.el
index 85adc5c..07c7b74 100644
--- a/helpful.el
+++ b/helpful.el
@@ -1805,6 +1805,12 @@ OBJ may be a symbol or a compiled function object."
(and (symbolp sym)
(byte-code-function-p (symbol-function sym))))
+(defun helpful--native-compiled-p (sym)
+ "Return non-nil if function SYM is native-compiled"
+ (and (symbolp sym)
+ (fboundp 'subr-native-elisp-p)
+ (subr-native-elisp-p (symbol-function sym))))
+
(defun helpful--join-and (items)
"Join a list of strings with commas and \"and\"."
(cond
@@ -1860,6 +1866,11 @@ OBJ may be a symbol or a compiled function object."
"compiled"
'helpful-info-button
'info-node "(elisp)Byte Compilation"))
+ (native-compiled-button
+ (helpful--button
+ "natively compiled"
+ 'helpful-describe-button
+ 'symbol 'native-compile))
(buffer-local-button
(helpful--button
"buffer-local"
@@ -1869,12 +1880,15 @@ OBJ may be a symbol or a compiled function object."
(and callable-p buf (helpful--autoloaded-p sym buf)))
(compiled-p
(and callable-p (helpful--compiled-p sym)))
+ (native-compiled-p
+ (and callable-p (helpful--native-compiled-p sym)))
(buttons
(list
(if alias-p alias-button)
(if (and callable-p autoloaded-p) autoload-button)
(if (and callable-p (commandp sym)) interactive-button)
(if compiled-p compiled-button)
+ (if native-compiled-p native-compiled-button)
(if (and (not callable-p) (local-variable-if-set-p sym))
buffer-local-button)))
(description