From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048). Date: Tue, 01 Mar 2011 21:00:40 +0200 Message-ID: <83tyfmy8br.fsf@gnu.org> References: <4D6B6AA4.8090008@gmx.at> <4D6BD6EA.4010000@gmx.at> <87mxlg57hs.fsf@stupidchicken.com> <83wrkklzcd.fsf@gnu.org> <87ipw4aq3x.fsf@stupidchicken.com> <8762s32854.fsf@gnu.org> <87ipw3ik43.fsf@stupidchicken.com> <4D6CC0A4.2070904@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1299006679 25314 80.91.229.12 (1 Mar 2011 19:11:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2011 19:11:19 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 01 20:11:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PuUyU-0002Qx-Um for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2011 20:11:11 +0100 Original-Received: from localhost ([127.0.0.1]:33686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuUyT-00069L-MR for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2011 14:11:09 -0500 Original-Received: from [140.186.70.92] (port=60135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuUoF-0001Om-5j for emacs-devel@gnu.org; Tue, 01 Mar 2011 14:00:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuUoD-0007mw-Tn for emacs-devel@gnu.org; Tue, 01 Mar 2011 14:00:35 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuUoD-0007mV-Lp for emacs-devel@gnu.org; Tue, 01 Mar 2011 14:00:33 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LHE00F007D3AE00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 01 Mar 2011 21:00:31 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.183.216]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LHE00EFR7GU0UH0@a-mtaout20.012.net.il>; Tue, 01 Mar 2011 21:00:31 +0200 (IST) In-reply-to: <4D6CC0A4.2070904@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136680 Archived-At: > Date: Tue, 01 Mar 2011 10:47:16 +0100 > From: martin rudalics > Cc: emacs-devel@gnu.org > > >> (insert (propertize > >> " " 'display > >> '(space :align-to (- text 8))) "#123456") > > > > Ah yes, I think this will work. Thanks. > > > > In the general case, the stuff after stretch glyph could have arbitrary > > width, so this wouldn't work; but it's certainly good enough for what > > list-colors-display needs. > > But for one minor detail. `list-colors-print' produces output of the > form > > ghost white ghost white, GhostWhite #f8f8ff > > where the number of color aliases listed in the middle is currently > adjusted according to the actual window width. If the window is wide > enough, more aliases are displayed. So we'd still need to know the > width of the window _before_ filling the buffer in order to emulate the > old behavior faithfully (personally I don't think we should care much). Couldn't you try adding more aliases until the gap between the color name on the left and the first alias in the middle is small enough? You could use current-column to measure the gap. Would that work? > Maybe we could provide a display specificier, say "truncate", so we > could do something like > > (insert (propertize string 'display '(truncate (- text 9)))) > > to assert that any such string never extends past the ninth column > before the end of the text area. But that's not what we want here. We don't want to truncate, we want to insert text that fits without truncation.