unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Arash Esbati <arash@gnu.org>
Cc: Juri Linkov <juri@linkov.net>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Completion details and vertical completion format
Date: Mon, 28 Nov 2022 10:42:38 +0000	[thread overview]
Message-ID: <338f50d421e6a2ea4628@heytings.org> (raw)
In-Reply-To: <338f50d421efa71f81b6@heytings.org>


>>> 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	other threads:[~2022-11-28 10:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  9:28 Completion details and vertical completion format Arash Esbati
2022-11-27 19:29 ` Juri Linkov
2022-11-28  9:55   ` Arash Esbati
2022-11-28 10:09     ` Gregory Heytings
2022-11-28 10:42       ` Gregory Heytings [this message]
2022-11-28 11:05         ` Arash Esbati
2022-11-28 12:19           ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=338f50d421e6a2ea4628@heytings.org \
    --to=gregory@heytings.org \
    --cc=arash@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).