From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: completion buffer - unsuitable column width Date: Tue, 3 Mar 2009 08:46:18 -0800 (PST) Message-ID: <200903031646.n23GkIux004576@rodan.ics.uci.edu> References: <9B16B937-9EFC-445F-A169-5F1BDEB17A79@gmail.com> <92CD418E-2240-448E-A9A6-CBC7C580AFD8@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236098833 18047 80.91.229.12 (3 Mar 2009 16:47:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 16:47:13 +0000 (UTC) Cc: Stefan Monnier , Emacs-Devel devel To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 03 17:48:28 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 1LeXms-0005B1-Ig for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 17:48:10 +0100 Original-Received: from localhost ([127.0.0.1]:45240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeXlX-0002Pc-8q for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 11:46:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeXlR-0002PC-BU for emacs-devel@gnu.org; Tue, 03 Mar 2009 11:46:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeXlN-0002N6-NI for emacs-devel@gnu.org; Tue, 03 Mar 2009 11:46:40 -0500 Original-Received: from [199.232.76.173] (port=42674 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeXlN-0002Ma-97 for emacs-devel@gnu.org; Tue, 03 Mar 2009 11:46:37 -0500 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:61100) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LeXlL-0002WO-B1 for emacs-devel@gnu.org; Tue, 03 Mar 2009 11:46:35 -0500 Original-Received: from rodan.ics.uci.edu (rodan.ics.uci.edu [128.195.6.9]) by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id n23GkJi3004974; Tue, 3 Mar 2009 08:46:20 -0800 (PST) Original-Received: (from dann@localhost) by rodan.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n23GkIux004576; Tue, 3 Mar 2009 08:46:18 -0800 (PST) In-Reply-To: <92CD418E-2240-448E-A9A6-CBC7C580AFD8@gmail.com> (David Reitter's message of "Tue, 3 Mar 2009 08:23:49 -0500") Original-Lines: 44 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n23GkJi3004974 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@rodan.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:109414 Archived-At: David Reitter writes: > On 2 Mar 2009, at 20:33, Stefan Monnier wrote: > > >> 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. > > OK, perhaps we could use something like > > (if (assq 'default face-remapping-alist) 79 (window-width)) > > to cover at least the case that I've encountered. > > A grep over the source, looking for (window-width), reveals other > suspicious uses. > I haven't examined it further, but take simple.el, line-move-visual: > > (cond ((eq (nth 1 posn) 'right-fringe) ; overflow-newline-into- > fringe > (setq temporary-goal-column (- (window-width) 1))) > > `temporary-goal-column' refers to buffer columns; window-width does not. > > Or, abbrev.el: > > (while abbrev-list > (if (> (+ first-column 40) (window-width)) > (progn > > first-column seems to refer to the buffer, again. > > Or, term.el: > `term-window-width' uses (window-width) and I would assume that this > (`term-width') is what is used by processes running in the terminal > (COLUMNS). term.el relies on using a fixed width font. Trying to not do so in a terminal emulator is simply not worth the effort.