* Any way to trick completion--insert-strings into using only one column??
@ 2016-01-03 14:49 Florian v. Savigny
0 siblings, 0 replies; 2+ messages in thread
From: Florian v. Savigny @ 2016-01-03 14:49 UTC (permalink / raw)
To: help-gnu-emacs
Dear elisp coders,
A Happy New Year to everybody.
The above function seems hardcoded to display at least two columns. Of
course, it so happens that I want it to display only one column in a
specific circumstance (the help buffer appears in a side window and
the completion strings are long, to be precise).
I have looked for ways of making the function believe it should only
display one column by re-defining some variable around it locally, but
this does not seem to be possible; it seems to display two columns
even if the completion strings are 1000 characters long.
Am I missing something here, or is the only way to get this behaviour
to redefine the function? (This could be done in quite a handy way,
e.g. the function could consider the width of the help window and
decide to show only as many columns as will show completely, or the
like.)
Best regards,
Florian
--
Florian von Savigny
Melanchthonstr. 41
33615 Bielefeld
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: Any way to trick completion--insert-strings into using only one column??
[not found] <<87twmu90qc.fsf@bertrandrussell.Speedport_W_723V_1_39_000>
@ 2016-01-03 15:46 ` Drew Adams
0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2016-01-03 15:46 UTC (permalink / raw)
To: Florian v. Savigny, help-gnu-emacs
> The above function seems hardcoded to display at least two columns. Of
> course, it so happens that I want it to display only one column in a
> specific circumstance (the help buffer appears in a side window and
> the completion strings are long, to be precise).
>
> I have looked for ways of making the function believe it should only
> display one column by re-defining some variable around it locally, but
> this does not seem to be possible; it seems to display two columns
> even if the completion strings are 1000 characters long.
>
> Am I missing something here, or is the only way to get this behaviour
> to redefine the function? (This could be done in quite a handy way,
> e.g. the function could consider the width of the help window and
> decide to show only as many columns as will show completely, or the
> like.)
As you have probably seen by looking at the code of
`completion--insert-strings', it hard-codes a minimum of two
columns (unless there are less than 3 candidates). So I'm
afraid that your only option in this regard is to redefine it
(or advise it in such a way that you effectively redefine it).
[Consider filing an enhancement request to not hard-code such
behavior: `M-x report-emacs-bug'.]
FWIW -
If you use Icicles then what you are looking for is done
automatically. And you can also control the behavior,
by configuration or on the fly during completion.
When Icicle minor mode is enabled, the number of *Completions*
columns is adjusted to better fit the set of current candidates.
You can tweak this adjustment using options
`icicle-candidate-width-factor' and
`icicle-inter-candidate-min-spaces.
You can choose anything from (a) closely packing the candidates,
to show more in the same window space, to (b) separating them
widely and aligning them rigorously.
If you also use library Do Re Mi then you can adjust these
options and the candidate display incrementally, on the fly,
using the arrow keys.
You can also just override automatic adjustment using option
`icicle-Completions-max-columns'. For example, binding or
setting it to 1 ensures that only one column is used.
More info:
http://www.emacswiki.org/emacs/Icicles_-_Completions_Display#ChangeCompletionsSpacingOnTheFly
Screenshots, showing some of the *Completions* display
possibilities (scroll down for more):
http://www.emacswiki.org/emacs/Icicles_-_Screenshots#AproposCompletion
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-03 15:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-03 14:49 Any way to trick completion--insert-strings into using only one column?? Florian v. Savigny
[not found] <<87twmu90qc.fsf@bertrandrussell.Speedport_W_723V_1_39_000>
2016-01-03 15:46 ` Drew Adams
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).