summaryrefslogtreecommitdiff
path: root/helm-lib.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thievol@posteo.net>2020-08-30 17:34:09 +0200
committerGitHub <noreply@github.com>2020-08-30 17:34:09 +0200
commit8642a24584e1ea0fe8d07f2a9ac539976225ec60 (patch)
tree29d760d245b5b9074292d45a773d1235464dabe9 /helm-lib.el
parent0fa80a8b62eba89e0510cac5a5f8009573ce6933 (diff)
parent732ae6f071e20c1f8f52070d0269daab8a69c360 (diff)
Merge pull request #2376 from gcla/native-comp4
Fix issues running emacs built from the native-comp branch (#2375)
Diffstat (limited to 'helm-lib.el')
-rw-r--r--helm-lib.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/helm-lib.el b/helm-lib.el
index f5011d95..b1a25f20 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -363,6 +363,17 @@ available APPEND is ignored."
(setq guess (abbreviate-file-name (expand-file-name guess))))
(read-file-name prompt (file-name-directory guess) nil nil
(file-name-nondirectory guess))))
+
+;; The native-comp branch of emacs "is a modified Emacs capable of compiling
+;; and running Emacs Lisp as native code in form of re-loadable elf files."
+;; (https://akrl.sdf.org/gccemacs.html). The function subr-native-elisp-p is a
+;; native function available only in this branch and evaluates to true if the
+;; argument supplied is a natively compiled lisp function. Use this function
+;; if it's available, otherwise return nil. Helm needs to distinguish compiled
+;; functions from other symbols in a various places.
+(defun helm-subr-native-elisp-p (object)
+ (when (fboundp 'subr-native-elisp-p)
+ (subr-native-elisp-p object)))
;;; Macros helper.
;;
@@ -1116,7 +1127,8 @@ Example:
(defun helm-symbol-name (obj)
(if (or (and (consp obj) (functionp obj))
- (byte-code-function-p obj))
+ (byte-code-function-p obj)
+ (helm-subr-native-elisp-p obj))
"Anonymous"
(symbol-name obj)))