Manually align annotations in only place this variable is used.
(defun mule--ucs-names-affixation (names)
"Return Unicode character NAMES with completion affixations."
- (mapcar (lambda (name)
- (let ((char (gethash name ucs-names)))
- (list name (concat (if char (list char) " ") "\t") "")))
- names))
+ (let ((max (seq-max (cons 0 (mapcar (lambda (n)
+ (if-let ((c (gethash n ucs-names)))
+ (char-width c)
+ 0))
+ names)))))
+ (mapcar (lambda (name)
+ (let* ((char (gethash name ucs-names))
+ (str (if char (char-to-string char) "")))
+ (list name
+ (concat
+ str
+ (make-string (1+ (- max (string-width str))) ?\s))
+ "")))
+ names)))
(defun mule--ucs-categories-annotation (cat-name)
"Return completion annotation for Unicode category name CAT-NAME."
Optional arg ALLOW-SINGLE non-nil means to additionally allow
single characters to be treated as standing for themselves."
- (let* ((completion-ignore-case t)
- (completion-tab-width 4)
- (sort-fun (when (eq read-char-by-name-sort 'code)
+ (let* ((sort-fun (when (eq read-char-by-name-sort 'code)
#'mule--ucs-names-sort-by-code))
(group-fun (when completions-group #'mule--ucs-names-group))
(input
(cons '(?c "code" "Sort by character code"
mule--ucs-names-sort-by-code
"sorted by character code")
- minibuffer-completions-sort-orders)))
+ minibuffer-completions-sort-orders)
+ completion-ignore-case t))
(completing-read
prompt (completion-table-with-metadata
(ucs-names)
(defvar-local completion-all-sorted-completions nil)
(defvar-local completion-history nil)
-(defvar completion-tab-width nil)
(defvar completion-fail-discreetly nil
"If non-nil, stay quiet when there is no match.")
;; Windows can't show less than 3 lines anyway.
(max 1 (/ (length strings) 2))))
(colwidth (/ wwidth columns)))
- (unless (or tab-stop-list (null completion-tab-width)
- (zerop (mod colwidth completion-tab-width)))
- ;; Align to tab positions for the case
- ;; when the caller uses tabs inside prefix.
- (setq colwidth (- colwidth (mod colwidth completion-tab-width))))
(funcall (intern (format "completion--insert-%s" completions-format))
strings group-fun length wwidth colwidth columns))))
;; already past the goal column, there is still
;; a space displayed.
(set-text-properties (1- (point)) (point)
- ;; We can set tab-width using
- ;; completion-tab-width, but
- ;; the caller can prefer using
- ;; \t to align prefixes.
`(display (space :align-to ,column)))
nil))
(setq first nil)
(defvar enable-recursive-minibuffers nil "Unused obsolete variable.")
(make-obsolete-variable 'enable-recursive-minibuffers nil "31.1")
+(defvar completion-tab-width nil "Unused obsolete variable.")
+(make-obsolete-variable 'completion-tab-width nil "31.1")
+
(defcustom minibuffer-auto-completion-idle-time 0.4
"Number for seconds to wait before auto-completion in the minibuffer."
:type 'float
(define-derived-mode completion-list-mode special-mode "Completions"
"Major mode for buffers showing lists of possible completions."
- (when completion-tab-width (setq tab-width completion-tab-width))
(when completions-highlight-face (cursor-face-highlight-mode 1))
(face-remap-add-relative 'header-line 'completions-heading))