emacs: make minor refinements to prot-minibuffer

This commit is contained in:
Protesilaos 2026-08-15 21:36:35 +03:00
parent 6f85a2eb17
commit 0c4d928bc4
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
2 changed files with 12 additions and 8 deletions

View file

@ -14026,12 +14026,12 @@ Omit the .. directory from FILES."
"Return FILE group name unless TRANSFORM is non-nil."
(cond
(transform file)
((string-suffix-p "/" file) "/")
((string-prefix-p "." file) ".")
((string-suffix-p "/" file) "Directories")
((string-prefix-p "." file) "Dotfiles")
((when-let* ((extension (file-name-extension file :include-dot))
(_ (not (string-blank-p extension))))
extension))
(t "Other")))
(t "Other files")))
(defun prot-minibuffer--set-default-sort (candidates)
"Sort CANDIDATES according to `completions-sort' and return the sorted list."
@ -14176,7 +14176,9 @@ Do it when TRANSFORM is non-nil, else return INPUT-METHOD."
(_ (and binding (not (stringp binding)))))
(format " %s " (propertize description 'face 'help-key-binding))
""))
(doc (if-let* ((doc (condition-case nil (documentation symbol) (error nil)))
(doc (if-let* ((doc (condition-case nil
(documentation symbol)
(error nil)))
(first-line (substring doc 0 (string-search "\n" doc))))
(propertize first-line 'face 'completions-annotations)
"")))

View file

@ -105,12 +105,12 @@ Omit the .. directory from FILES."
"Return FILE group name unless TRANSFORM is non-nil."
(cond
(transform file)
((string-suffix-p "/" file) "/")
((string-prefix-p "." file) ".")
((string-suffix-p "/" file) "Directories")
((string-prefix-p "." file) "Dotfiles")
((when-let* ((extension (file-name-extension file :include-dot))
(_ (not (string-blank-p extension))))
extension))
(t "Other")))
(t "Other files")))
(defun prot-minibuffer--set-default-sort (candidates)
"Sort CANDIDATES according to `completions-sort' and return the sorted list."
@ -255,7 +255,9 @@ Do it when TRANSFORM is non-nil, else return INPUT-METHOD."
(_ (and binding (not (stringp binding)))))
(format " %s " (propertize description 'face 'help-key-binding))
""))
(doc (if-let* ((doc (condition-case nil (documentation symbol) (error nil)))
(doc (if-let* ((doc (condition-case nil
(documentation symbol)
(error nil)))
(first-line (substring doc 0 (string-search "\n" doc))))
(propertize first-line 'face 'completions-annotations)
"")))