From: Eshel Yaron Date: Mon, 15 Jul 2024 17:38:23 +0000 (+0200) Subject: Remove 'completion-tab-width' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4afb12a6054ace9542109ea29a69e1771dc27acc;p=emacs.git Remove 'completion-tab-width' Manually align annotations in only place this variable is used. --- diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 363e99c20a7..27aad2dd266 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -3174,10 +3174,20 @@ on encoding." (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." @@ -3304,9 +3314,7 @@ as names, not numbers. 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 @@ -3316,7 +3324,8 @@ single characters to be treated as standing for themselves." (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) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1846f4039f3..6ba11312d4d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1534,7 +1534,6 @@ pair of a group title string and a list of group candidate strings." (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.") @@ -2434,11 +2433,6 @@ function as described in the documentation of `completion-metadata'." ;; 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)))) @@ -2471,10 +2465,6 @@ function as described in the documentation of `completion-metadata'." ;; 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) @@ -6485,6 +6475,9 @@ interactions is customizable via `minibuffer-regexp-prompts'." (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 diff --git a/lisp/simple.el b/lisp/simple.el index 38db0450a4d..9eb4c062694 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10134,7 +10134,6 @@ back on `completion-list-insert-choice-function' when nil." (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))