diff options
-rw-r--r-- | etc/NEWS | 3 | ||||
-rw-r--r-- | lisp/minibuffer.el | 13 | ||||
-rw-r--r-- | lisp/simple.el | 7 |
3 files changed, 17 insertions, 6 deletions
@@ -1346,6 +1346,9 @@ When non-nil, some commands like 'describe-symbol' show more detailed completions with more information in completion prefix and suffix. --- +*** User option 'completions-format' supports a new value 'one-column'. + +--- *** New user option 'bibtex-unify-case-convert'. This new option allows the user to customize how case is converted when unifying entries. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 48bd39587bc..87bf3d36fa4 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1679,9 +1679,11 @@ Return nil if there is no valid completion, else t." "Define the appearance and sorting of completions. If the value is `vertical', display completions sorted vertically in columns in the *Completions* buffer. -If the value is `horizontal', display completions sorted -horizontally in alphabetical order, rather than down the screen." - :type '(choice (const horizontal) (const vertical)) +If the value is `horizontal', display completions sorted in columns +horizontally in alphabetical order, rather than down the screen. +If the value is `one-column', display completions down the screen +in one column." + :type '(choice (const horizontal) (const vertical) (const one-column)) :version "23.2") (defcustom completions-detailed nil @@ -1727,6 +1729,9 @@ It also eliminates runs of equal strings." (apply #'+ (mapcar #'string-width str)) (string-width str)))) (cond + ((eq completions-format 'one-column) + ;; Nothing special + ) ((eq completions-format 'vertical) ;; Vertical format (when (> row rows) @@ -1790,6 +1795,8 @@ It also eliminates runs of equal strings." (font-lock-prepend-text-property beg end 'face 'completions-annotations))))) (cond + ((eq completions-format 'one-column) + (insert "\n")) ((eq completions-format 'vertical) ;; Vertical format (if (> column 0) diff --git a/lisp/simple.el b/lisp/simple.el index 69b4639292a..c9f4f2bb445 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5477,15 +5477,16 @@ With ARG, rotate that many kills forward (or backward, if negative)." (completions (mapcar (lambda (s) (let* ((s (query-replace-descr s)) - (b 0)) + (b 0) + (limit (frame-width))) ;; Add ellipsis on leading whitespace (when (string-match "\\`[[:space:]]+" s) (setq b (match-end 0)) (add-text-properties 0 b `(display ,ellipsis) s)) ;; Add ellipsis at the end of a long string - (when (> (length s) (+ 40 b)) + (when (> (length s) (+ limit b)) (add-text-properties - (min (+ 40 b) (length s)) (length s) + (min (+ limit b) (length s)) (length s) `(display ,ellipsis) s)) s)) read-from-kill-ring-history))) |