diff options
| author | Juri Linkov | 2021-06-17 23:19:30 +0300 |
|---|---|---|
| committer | Juri Linkov | 2021-06-17 23:19:30 +0300 |
| commit | fe1b72d21658cf3acfaae3b092bc53a2fe479f0f (patch) | |
| tree | 572c1bcb5598d1150fb3dba45f77d4395daa71f2 | |
| parent | 45acbe6d622f807ff960e1c2fe92127188f57f68 (diff) | |
| download | emacs-fe1b72d21658cf3acfaae3b092bc53a2fe479f0f.tar.gz emacs-fe1b72d21658cf3acfaae3b092bc53a2fe479f0f.zip | |
* 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
| -rw-r--r-- | lisp/help-fns.el | 38 |
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 | |||
| 130 | "Return symbol class characters for symbol S." | 130 | "Return symbol class characters for symbol S." |
| 131 | (when (stringp s) | 131 | (when (stringp s) |
| 132 | (setq s (intern-soft s))) | 132 | (setq s (intern-soft s))) |
| 133 | (cond ((commandp s) | 133 | (concat |
| 134 | "c") ; command | 134 | (when (fboundp s) |
| 135 | ((eq (car-safe (symbol-function s)) 'macro) | 135 | (concat |
| 136 | "m") ; macro | 136 | (cond |
| 137 | ((fboundp s) | 137 | ((commandp s) "c") |
| 138 | "f") ; function | 138 | ((eq (car-safe (symbol-function s)) 'macro) "m") |
| 139 | ((custom-variable-p s) | 139 | (t "f")) |
| 140 | "u") ; user option | 140 | (and (let ((flist (indirect-function s))) |
| 141 | ((boundp s) | 141 | (advice--p (if (eq 'macro (car-safe flist)) (cdr flist) flist))) |
| 142 | "v") ; variable | 142 | "!") |
| 143 | ((facep s) | 143 | (and (get s 'byte-obsolete-info) "-"))) |
| 144 | "a") ; fAce | 144 | (when (boundp s) |
| 145 | ((and (fboundp 'cl-find-class) | 145 | (concat |
| 146 | (cl-find-class s)) | 146 | (if (custom-variable-p s) "u" "v") |
| 147 | "t") ; CL type | 147 | (and (local-variable-if-set-p s) "'") |
| 148 | (" ") ; something else | 148 | (and (ignore-errors (not (equal (symbol-value s) (default-value s)))) "*") |
| 149 | )) | 149 | (and (get s 'byte-obsolete-variable) "-"))) |
| 150 | (and (facep s) "a") | ||
| 151 | (and (fboundp 'cl-find-class) (cl-find-class s) "t"))) | ||
| 150 | 152 | ||
| 151 | (defun help--symbol-completion-table-affixation (completions) | 153 | (defun help--symbol-completion-table-affixation (completions) |
| 152 | (mapcar (lambda (c) | 154 | (mapcar (lambda (c) |
| @@ -154,7 +156,7 @@ with the current prefix. The files are chosen according to | |||
| 154 | (doc (condition-case nil (documentation s) (error nil))) | 156 | (doc (condition-case nil (documentation s) (error nil))) |
| 155 | (doc (and doc (substring doc 0 (string-match "\n" doc))))) | 157 | (doc (and doc (substring doc 0 (string-match "\n" doc))))) |
| 156 | (list c (propertize | 158 | (list c (propertize |
| 157 | (concat (help--symbol-class s) " ") ; prefix separator | 159 | (format "%-4s" (help--symbol-class s)) |
| 158 | 'face 'completions-annotations) | 160 | 'face 'completions-annotations) |
| 159 | (if doc (propertize (format " -- %s" doc) | 161 | (if doc (propertize (format " -- %s" doc) |
| 160 | 'face 'completions-annotations) | 162 | 'face 'completions-annotations) |