aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/international/mule-cmds.el15
-rw-r--r--lisp/minibuffer.el13
-rw-r--r--lisp/simple.el2
3 files changed, 19 insertions, 11 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index d361971a1fc..d59f2c0ebfc 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -3084,13 +3084,11 @@ on encoding."
3084 (puthash "BELL (BEL)" ?\a names) 3084 (puthash "BELL (BEL)" ?\a names)
3085 (setq ucs-names names)))) 3085 (setq ucs-names names))))
3086 3086
3087(defun mule--ucs-names-annotation (name) 3087(defun mule--ucs-names-affixation (names)
3088 ;; FIXME: It would be much better to add this annotation before rather than 3088 (mapcar (lambda (name)
3089 ;; after the char name, so the annotations are aligned. 3089 (let ((char (gethash name ucs-names)))
3090 ;; FIXME: The default behavior of displaying annotations in italics 3090 (list name (concat (if char (format "%c" char) " ") "\t") "")))
3091 ;; doesn't work well here. 3091 names))
3092 (let ((char (gethash name ucs-names)))
3093 (when char (format " (%c)" char))))
3094 3092
3095(defun char-from-name (string &optional ignore-case) 3093(defun char-from-name (string &optional ignore-case)
3096 "Return a character as a number from its Unicode name STRING. 3094 "Return a character as a number from its Unicode name STRING.
@@ -3133,13 +3131,14 @@ octal). Treat otherwise-ambiguous strings like \"BED\" (U+1F6CF)
3133as names, not numbers." 3131as names, not numbers."
3134 (let* ((enable-recursive-minibuffers t) 3132 (let* ((enable-recursive-minibuffers t)
3135 (completion-ignore-case t) 3133 (completion-ignore-case t)
3134 (completion-tab-width 4)
3136 (input 3135 (input
3137 (completing-read 3136 (completing-read
3138 prompt 3137 prompt
3139 (lambda (string pred action) 3138 (lambda (string pred action)
3140 (if (eq action 'metadata) 3139 (if (eq action 'metadata)
3141 '(metadata 3140 '(metadata
3142 (annotation-function . mule--ucs-names-annotation) 3141 (affixation-function . mule--ucs-names-affixation)
3143 (category . unicode-name)) 3142 (category . unicode-name))
3144 (complete-with-action action (ucs-names) string pred))))) 3143 (complete-with-action action (ucs-names) string pred)))))
3145 (char 3144 (char
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 87bf3d36fa4..d44d8968221 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1134,6 +1134,7 @@ completion candidates than this number."
1134(defvar-local completion-all-sorted-completions nil) 1134(defvar-local completion-all-sorted-completions nil)
1135(defvar-local completion--all-sorted-completions-location nil) 1135(defvar-local completion--all-sorted-completions-location nil)
1136(defvar completion-cycling nil) ;Function that takes down the cycling map. 1136(defvar completion-cycling nil) ;Function that takes down the cycling map.
1137(defvar completion-tab-width nil)
1137 1138
1138(defvar completion-fail-discreetly nil 1139(defvar completion-fail-discreetly nil
1139 "If non-nil, stay quiet when there is no match.") 1140 "If non-nil, stay quiet when there is no match.")
@@ -1718,6 +1719,11 @@ It also eliminates runs of equal strings."
1718 (row 0) 1719 (row 0)
1719 (first t) 1720 (first t)
1720 (laststring nil)) 1721 (laststring nil))
1722 (unless (or tab-stop-list (null completion-tab-width)
1723 (zerop (mod colwidth completion-tab-width)))
1724 ;; Align to tab positions for the case
1725 ;; when the caller uses tabs inside prefix.
1726 (setq colwidth (- colwidth (mod colwidth completion-tab-width))))
1721 ;; The insertion should be "sensible" no matter what choices were made 1727 ;; The insertion should be "sensible" no matter what choices were made
1722 ;; for the parameters above. 1728 ;; for the parameters above.
1723 (dolist (str strings) 1729 (dolist (str strings)
@@ -1758,9 +1764,10 @@ It also eliminates runs of equal strings."
1758 ;; already past the goal column, there is still 1764 ;; already past the goal column, there is still
1759 ;; a space displayed. 1765 ;; a space displayed.
1760 (set-text-properties (1- (point)) (point) 1766 (set-text-properties (1- (point)) (point)
1761 ;; We can't just set tab-width, because 1767 ;; We can set tab-width using
1762 ;; completion-setup-function will kill 1768 ;; completion-tab-width, but
1763 ;; all local variables :-( 1769 ;; the caller can prefer using
1770 ;; \t to align prefixes.
1764 `(display (space :align-to ,column))) 1771 `(display (space :align-to ,column)))
1765 nil)))) 1772 nil))))
1766 (setq first nil) 1773 (setq first nil)
diff --git a/lisp/simple.el b/lisp/simple.el
index 77888d07f1e..93fda7de8a1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8822,6 +8822,8 @@ Called from `temp-buffer-show-hook'."
8822 insert-fun)) 8822 insert-fun))
8823 (set (make-local-variable 'completion-reference-buffer) mainbuf) 8823 (set (make-local-variable 'completion-reference-buffer) mainbuf)
8824 (if base-dir (setq default-directory base-dir)) 8824 (if base-dir (setq default-directory base-dir))
8825 (when completion-tab-width
8826 (setq tab-width completion-tab-width))
8825 ;; Maybe insert help string. 8827 ;; Maybe insert help string.
8826 (when completion-show-help 8828 (when completion-show-help
8827 (goto-char (point-min)) 8829 (goto-char (point-min))