From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width Date: Fri, 19 Dec 2014 21:35:41 +0200 Message-ID: <83tx0rsa9e.fsf@gnu.org> References: <87vblbnz2u.fsf@posteo.de> <83k31rwe55.fsf@gnu.org> <87lhm772o2.fsf@posteo.de> <83h9wvwbux.fsf@gnu.org> <87bnn39cpe.fsf@posteo.de> <83a92mwau9.fsf@gnu.org> <874msu9out.fsf@posteo.de> <83vblauoh6.fsf@gnu.org> <87wq5q864m.fsf@posteo.de> <83tx0uum88.fsf@gnu.org> <87a92lmxy3.fsf@posteo.de> <837fxpue6v.fsf@gnu.org> <54945BCB.8030506@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1419017785 19375 80.91.229.3 (19 Dec 2014 19:36:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2014 19:36:25 +0000 (UTC) Cc: 19395@debbugs.gnu.org, malsburg@posteo.de To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 19 20:36:18 2014 Return-path: Envelope-to: geb-bug-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 1Y23LV-0004AP-RP for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Dec 2014 20:36:17 +0100 Original-Received: from localhost ([::1]:60288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y23LU-0006hT-Ud for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Dec 2014 14:36:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y23LM-0006hJ-33 for bug-gnu-emacs@gnu.org; Fri, 19 Dec 2014 14:36:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y23LG-000605-Sz for bug-gnu-emacs@gnu.org; Fri, 19 Dec 2014 14:36:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y23LG-000601-Pc for bug-gnu-emacs@gnu.org; Fri, 19 Dec 2014 14:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y23LG-00064k-EC for bug-gnu-emacs@gnu.org; Fri, 19 Dec 2014 14:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Dec 2014 19:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19395 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19395-submit@debbugs.gnu.org id=B19395.141901774923334 (code B ref 19395); Fri, 19 Dec 2014 19:36:02 +0000 Original-Received: (at 19395) by debbugs.gnu.org; 19 Dec 2014 19:35:49 +0000 Original-Received: from localhost ([127.0.0.1]:51803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y23L2-00064I-MK for submit@debbugs.gnu.org; Fri, 19 Dec 2014 14:35:48 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:40861) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y23Ky-000647-M6 for 19395@debbugs.gnu.org; Fri, 19 Dec 2014 14:35:46 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NGU00E00GKY7K00@mtaout29.012.net.il> for 19395@debbugs.gnu.org; Fri, 19 Dec 2014 21:33:08 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NGU00FPHGZ82X10@mtaout29.012.net.il>; Fri, 19 Dec 2014 21:33:08 +0200 (IST) In-reply-to: <54945BCB.8030506@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97577 Archived-At: > Date: Fri, 19 Dec 2014 18:09:31 +0100 > From: martin rudalics > CC: 19395@debbugs.gnu.org > > > Given the changes I pushed in commit b197822, you will no longer need > > all this complexity. Just > > > > (aref (font-info (face-font 'default)) 11) > > > > (For bullet-proof code, check that this is not zero, and if it is, use > > the 10th member instead; see the docs.) > > Very good. IIUC this means that I could use something like > > (defun window-char-width (&optional window) > "Return default character width for WINDOW. > WINDOW must be a live window and defaults to the selected one." > (setq window (window-normalize-window window t)) > (with-current-buffer (window-buffer window) > (let* ((info (font-info (face-font 'default))) > (width (aref info 11))) > (if (> width 0) > width > (aref info 10))))) > > (defun window-char-height (&optional window) > "Return default character height for WINDOW. > WINDOW must be a live window and defaults to the selected one." > (setq window (window-normalize-window window t)) > (with-current-buffer (window-buffer window) > (aref (font-info (face-font 'default)) 3))) > > in window.el. Yes, that's the idea. > If that is the case, then the doc of `font-info' should > be somehow amended. It currently says > > Return information about a font named NAME on frame FRAME. > > and nowhere mentions which buffer must be current or maybe even which > window must be selected. I don't think the results of font-info depend on that. It's the result of face-font that depend on the buffer and frame, but once you have the font's name, all the rest doesn't matter, since Emacs already have the font data structure set up and stored in memory.