From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: completion buffer - unsuitable column width Date: Mon, 02 Mar 2009 20:33:09 -0500 Message-ID: References: <9B16B937-9EFC-445F-A169-5F1BDEB17A79@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236044001 20979 80.91.229.12 (3 Mar 2009 01:33:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 01:33:21 +0000 (UTC) Cc: Emacs-Devel devel To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 03 02:34:38 2009 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.50) id 1LeJWn-0003sZ-7n for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 02:34:37 +0100 Original-Received: from localhost ([127.0.0.1]:46331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeJVS-0005Bx-4P for ged-emacs-devel@m.gmane.org; Mon, 02 Mar 2009 20:33:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeJVL-0005BL-KA for emacs-devel@gnu.org; Mon, 02 Mar 2009 20:33:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeJVJ-0005B1-Rj for emacs-devel@gnu.org; Mon, 02 Mar 2009 20:33:07 -0500 Original-Received: from [199.232.76.173] (port=38819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeJVJ-0005Ay-Ln for emacs-devel@gnu.org; Mon, 02 Mar 2009 20:33:05 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:57417 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LeJVJ-0000I8-Ab for emacs-devel@gnu.org; Mon, 02 Mar 2009 20:33:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwFAF8XrEnO+KX2/2dsb2JhbACBWdMmhAYGg3k X-IronPort-AV: E=Sophos;i="4.38,292,1233550800"; d="scan'208";a="34612021" Original-Received: from 206-248-165-246.dsl.teksavvy.com (HELO ceviche.home) ([206.248.165.246]) by ironport2-out.teksavvy.com with ESMTP; 02 Mar 2009 20:33:04 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 64F81B41A3; Mon, 2 Mar 2009 20:33:09 -0500 (EST) In-Reply-To: <9B16B937-9EFC-445F-A169-5F1BDEB17A79@gmail.com> (David Reitter's message of "Mon, 2 Mar 2009 14:13:17 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:109397 Archived-At: > (window (get-buffer-window (current-buffer) 0)) > (wwidth (if window (1- (window-width window)) 79)) > ... > In my case, I use face-remapping-alist to assign different faces for the > frame default face and the buffer default face. This causes "window-width" > to return a figure that does not indicate how much text can be fit in one > line in that window. > I don't know how to fix this given that there seems to be no way to > calculate the (average) character width of text with a given face. That's unfortunate, indeed. > I haven't encountered such an issue with 22. The code in Emacs-22, just used a hard-coded 79. Stefan