From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Any way to trick completion--insert-strings into using only one column?? Date: Sun, 3 Jan 2016 07:46:58 -0800 (PST) Message-ID: References: <<87twmu90qc.fsf@bertrandrussell.Speedport_W_723V_1_39_000>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1451836059 20833 80.91.229.3 (3 Jan 2016 15:47:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 15:47:39 +0000 (UTC) To: "Florian v. Savigny" , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 03 16:47:27 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aFksP-0006en-MY for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2016 16:47:25 +0100 Original-Received: from localhost ([::1]:42056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFksO-0002CH-UO for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2016 10:47:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFks8-00028K-Dw for help-gnu-emacs@gnu.org; Sun, 03 Jan 2016 10:47:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFks5-0006EQ-4u for help-gnu-emacs@gnu.org; Sun, 03 Jan 2016 10:47:08 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:23692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFks4-0006EM-TY for help-gnu-emacs@gnu.org; Sun, 03 Jan 2016 10:47:05 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u03Fl0i0022049 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 15:47:01 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u03Fl0je031079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 15:47:00 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u03Fkx2w006256; Sun, 3 Jan 2016 15:46:59 GMT In-Reply-To: <<87twmu90qc.fsf@bertrandrussell.Speedport_W_723V_1_39_000>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108597 Archived-At: > 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). >=20 > 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. >=20 > 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=20 `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#ChangeCompleti= onsSpacingOnTheFly Screenshots, showing some of the *Completions* display possibilities (scroll down for more): http://www.emacswiki.org/emacs/Icicles_-_Screenshots#AproposCompletion