From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: completion buffer - unsuitable column width Date: Mon, 2 Mar 2009 14:13:17 -0500 Message-ID: <9B16B937-9EFC-445F-A169-5F1BDEB17A79@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236021237 9360 80.91.229.12 (2 Mar 2009 19:13:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Mar 2009 19:13:57 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 02 20:15:13 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 1LeDbY-0003BQ-SC for ged-emacs-devel@m.gmane.org; Mon, 02 Mar 2009 20:15:09 +0100 Original-Received: from localhost ([127.0.0.1]:39504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeDaD-0005YX-FM for ged-emacs-devel@m.gmane.org; Mon, 02 Mar 2009 14:13:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeDa8-0005WL-Fq for emacs-devel@gnu.org; Mon, 02 Mar 2009 14:13:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeDa6-0005SR-SL for emacs-devel@gnu.org; Mon, 02 Mar 2009 14:13:40 -0500 Original-Received: from [199.232.76.173] (port=60490 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeDa6-0005SE-O9 for emacs-devel@gnu.org; Mon, 02 Mar 2009 14:13:38 -0500 Original-Received: from mail-gx0-f160.google.com ([209.85.217.160]:41323) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LeDa6-00008Z-Gm for emacs-devel@gnu.org; Mon, 02 Mar 2009 14:13:38 -0500 Original-Received: by gxk4 with SMTP id 4so4803520gxk.18 for ; Mon, 02 Mar 2009 11:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=oMZWNMlWqN3zHMF5CkEfSJvXAvVMV2dsTSmVA8oLo30=; b=H0PWwTuWCtxTq4V6uqMy+mTC7cjUiwMZZkWreqQyqohhqRmLSZRDyAI2B3UNdwzkHk QbkIwPpxeLZje41XZhgs0Q0t5hmj1rTRXhfD6xifvCa1d3rShZcjeqLMl43Sr+jULowX Jbx6oQ+XorTltnmR31sKv/ncnckpKjpYqZ4ho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=YFwn37Ii0aQB0ltq8kUDuZm3hCzVxH+Sgar/YxhTCWi5N5r0dQUFT+Zaj6oN7ULH4y aA17IUH19+tmcH5ZNq7Fm1ltdQQdk0T/9iVHdemNN7VFScP0pERTFT4fMyiNMVCu8gmx GjFA7V88I7Bd78b6SZYz0QYXU6hKZW/IQ4zAU= Original-Received: by 10.100.45.5 with SMTP id s5mr5138443ans.14.1236021217161; Mon, 02 Mar 2009 11:13:37 -0800 (PST) Original-Received: from SCARLETT.PSY.CMU.EDU (SCARLETT.PSY.CMU.EDU [128.2.249.106]) by mx.google.com with ESMTPS id c37sm11307732ana.2.2009.03.02.11.13.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Mar 2009 11:13:20 -0800 (PST) X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:109395 Archived-At: I noticed that the columns in completion buffers are awfully wide for me. They also wrap around when the frame is resized, either while displaying it or after killing it explicitly and bringing up a new completion buffer. Looking at the code, it seems that this is due to an incorrect calculation of the available width in characters: (defun completion--insert-strings (strings) ... (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. I haven't encountered such an issue with 22.