""
(if-let ((desc (nth 3 (assoc (intern name)
completion-styles-alist))))
- (concat (propertize " " 'display
- `(space :align-to ,(+ max-name 4)))
+ (concat (make-string (- (+ max-name 4)
+ (string-width name))
+ ?\s)
(propertize
;; Only use the first line.
(substring desc 0 (string-search "\n" desc))
(concat minibuffer-completion-base file))))
(list file ""
(if-let ((ann (file-name-completion-annotation full)))
- (propertize
- (concat (propertize " " 'display
- `(space :align-to ,(+ max-file 2)))
- ann)
- 'face 'completions-annotations)
+ (concat (make-string (- (+ max-file 2)
+ (string-width file))
+ ?\s)
+ (propertize ann 'face 'completions-annotations))
""))))
files)))
(doc (ignore-errors (documentation sym))))
(when doc
(concat
- (propertize
- " "
- 'display `(space :align-to ,(+ max 2)))
+ (make-string
+ (- (+ max 2) (string-width cand)) ?\s)
(propertize
(substring doc 0 (string-search "\n" doc))
'face 'completions-annotations)))))))
(mapcar #'get-buffer names)))))))
(mapcar
(lambda (name)
- (let ((buf (get-buffer name)))
+ (let* ((buf (get-buffer name))
+ (mode (capitalize
+ (string-replace
+ "-mode" ""
+ (symbol-name (buffer-local-value 'major-mode buf))))))
(list name
(concat (if (and (buffer-modified-p buf)
(buffer-file-name buf))
(propertize "*" 'face 'completions-annotations) " ")
" ")
(propertize
- (concat (propertize " " 'display `(space :align-to
- ,(+ max-name 4)))
- (capitalize
- (string-replace
- "-mode" ""
- (symbol-name (buffer-local-value 'major-mode buf))))
+ (concat (make-string (- (+ max-name 2)
+ (string-width name))
+ ?\s)
+ mode
(if-let ((file-name (buffer-file-name buf)))
- (concat (propertize " " 'display
- `(space :align-to
- ,(+ max-name max-mode 2)))
- file-name)
+ (concat
+ (make-string (- (+ max-mode 2)
+ (string-width mode))
+ ?\s)
+ file-name)
(when-let ((proc (get-buffer-process buf)))
- (concat (propertize " " 'display
- `(space :align-to
- ,(+ max-name max-mode 2)))
- (format "%s (%s)"
- (process-name proc)
- (process-status proc))))))
+ (concat
+ (make-string (- (+ max-mode 2)
+ (string-width mode))
+ ?\s)
+ (format "%s (%s)"
+ (process-name proc)
+ (process-status proc))))))
'face 'completions-annotations))))
names)))
(let* ((max-name (seq-max (mapcar #'string-width
(or (remove nil command-names)
'("")))))
- (spc-dsp1 (propertize " " 'display
- `(space :align-to ,(+ max-name 2))))
(bindings
(when suggest-key-bindings
(with-selected-window (or (minibuffer-selected-window)
command-names))))
(max-bind (seq-max (mapcar #'string-width
(or (remove nil (mapcar #'cdr bindings))
- '("")))))
- (spc-dsp2 (propertize " " 'display
- `(space :align-to ,(+ max-name max-bind 4)))))
+ '(""))))))
(mapcar
(lambda (command-name)
(let* ((fun (and (stringp command-name) (intern-soft command-name)))
(alias (symbol-function fun))
(doc (condition-case nil (documentation fun) (error nil)))
(doc (and doc (substring doc 0 (string-search "\n" doc))))
- (suffix (cond ((symbolp alias)
+ (suffix (cond
+ ((symbolp alias)
+ (concat
+ (make-string (- (+ max-name max-bind 4)
+ (string-width command-name))
+ ?\s)
+ (propertize
+ (concat
+ "alias for "
+ (substitute-quotes (concat "`"
+ (symbol-name alias)
+ "'")))
+ 'face 'completions-annotations)))
+ (obsolete
+ (if-let ((other (car obsolete))
+ (string
+ (cond
+ ((symbolp other)
+ (concat "deprecated in favor of `"
+ (symbol-name other) "'"))
+ ((stringp other) other))))
+ (concat
+ (make-string (- (+ max-name max-bind 4)
+ (string-width command-name))
+ ?\s)
(propertize
- (concat spc-dsp2 "alias for "
- (substitute-quotes
- (concat "`" (symbol-name alias) "'")))
+ (substitute-quotes string)
'face 'completions-annotations))
- (obsolete
- (if-let ((other (car obsolete))
- (string
- (cond
- ((symbolp other)
- (concat "deprecated in favor of `"
- (symbol-name other) "'"))
- ((stringp other) other))))
- (concat spc-dsp2
- (propertize
- (substitute-quotes string)
- 'face 'completions-annotations))
- ""))
- (binding
- (concat spc-dsp1
- (propertize binding 'face 'help-key-binding)
- (when doc
- (concat spc-dsp2
- (propertize
- doc 'face
- 'completions-annotations)))))
- (doc
- (concat spc-dsp2 (propertize
- doc 'face
- 'completions-annotations)))
- (t ""))))
+ ""))
+ (binding
+ (concat (make-string (- (+ max-name 2)
+ (string-width command-name))
+ ?\s)
+ (propertize binding 'face 'help-key-binding)
+ (when doc
+ (concat
+ (make-string (- (+ max-bind 2)
+ (string-width binding))
+ ?\s)
+ (propertize
+ doc 'face
+ 'completions-annotations)))))
+ (doc
+ (concat (make-string (- (+ max-name max-bind 4)
+ (string-width command-name))
+ ?\s)
+ (propertize
+ doc 'face
+ 'completions-annotations)))
+ (t ""))))
(when extended-command-dim-hyphens
(named-let dim ((hy (string-search "-" command-name)))
(when hy