summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-06-17 23:19:30 +0300
committerJuri Linkov <juri@linkov.net>2021-06-17 23:19:30 +0300
commitfe1b72d21658cf3acfaae3b092bc53a2fe479f0f (patch)
tree572c1bcb5598d1150fb3dba45f77d4395daa71f2 /lisp/help-fns.el
parent45acbe6d622f807ff960e1c2fe92127188f57f68 (diff)
downloademacs-fe1b72d21658cf3acfaae3b092bc53a2fe479f0f.tar.gz
* lisp/help-fns.el (help--symbol-class): Concat chars for all namespaces.
Since Emacs Lisp is more than Lisp-2, separately output letters for each namespace: functions, variables, faces, classes. Use non-letter characters for additional properties such as advice, obsolete, local. (help--symbol-completion-table-affixation): Use format "%-4s". https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00524.html
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index f9804c705b3..afdb0d17b26 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -130,23 +130,25 @@ with the current prefix. The files are chosen according to
"Return symbol class characters for symbol S."
(when (stringp s)
(setq s (intern-soft s)))
- (cond ((commandp s)
- "c") ; command
- ((eq (car-safe (symbol-function s)) 'macro)
- "m") ; macro
- ((fboundp s)
- "f") ; function
- ((custom-variable-p s)
- "u") ; user option
- ((boundp s)
- "v") ; variable
- ((facep s)
- "a") ; fAce
- ((and (fboundp 'cl-find-class)
- (cl-find-class s))
- "t") ; CL type
- (" ") ; something else
- ))
+ (concat
+ (when (fboundp s)
+ (concat
+ (cond
+ ((commandp s) "c")
+ ((eq (car-safe (symbol-function s)) 'macro) "m")
+ (t "f"))
+ (and (let ((flist (indirect-function s)))
+ (advice--p (if (eq 'macro (car-safe flist)) (cdr flist) flist)))
+ "!")
+ (and (get s 'byte-obsolete-info) "-")))
+ (when (boundp s)
+ (concat
+ (if (custom-variable-p s) "u" "v")
+ (and (local-variable-if-set-p s) "'")
+ (and (ignore-errors (not (equal (symbol-value s) (default-value s)))) "*")
+ (and (get s 'byte-obsolete-variable) "-")))
+ (and (facep s) "a")
+ (and (fboundp 'cl-find-class) (cl-find-class s) "t")))
(defun help--symbol-completion-table-affixation (completions)
(mapcar (lambda (c)
@@ -154,7 +156,7 @@ with the current prefix. The files are chosen according to
(doc (condition-case nil (documentation s) (error nil)))
(doc (and doc (substring doc 0 (string-match "\n" doc)))))
(list c (propertize
- (concat (help--symbol-class s) " ") ; prefix separator
+ (format "%-4s" (help--symbol-class s))
'face 'completions-annotations)
(if doc (propertize (format " -- %s" doc)
'face 'completions-annotations)