emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Completion details and vertical completion format


From: Gregory Heytings
Subject: Re: Completion details and vertical completion format
Date: Mon, 28 Nov 2022 10:42:38 +0000


Could you please explain what did you expect to see.

Ideally, Emacs switches to `one-column' format automatically when completion candidates have long annotations and keep `vertical' for short or no annotations.

Even with long annotations there can be enough room for two columns, if the font is small enough.

That being said, currently the options completions-detailed and completions-format are incompatible: completions-format vertical has either no effet (with a small enough font), or a wrong effect (the one on your screenshots).


Arash, does the patch below fix your problem? The current code assumes "at least 2 columns", but that's wrong when completion candidates become long enough.

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 6bb0fa3ae9..5faa3c8d4e 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2025,8 +2025,8 @@ completion--insert-strings
           (window (get-buffer-window (current-buffer) 0))
           (wwidth (if window (1- (window-width window)) 79))
           (columns (min
-                    ;; At least 2 columns; at least 2 spaces between columns.
-                    (max 2 (/ wwidth (+ 2 length)))
+                    ;; At least 2 spaces between columns.
+                    (max 1 (/ wwidth (+ 2 length)))
                     ;; Don't allocate more columns than we can fill.
                     ;; Windows can't show less than 3 lines anyway.
                     (max 1 (/ (length strings) 2))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]