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: Sat, 20 Dec 2014 18:31:25 +0200 Message-ID: <83388as2oy.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> <87oaqyz85s.fsf@posteo.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1419093144 25230 80.91.229.3 (20 Dec 2014 16:32:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2014 16:32:24 +0000 (UTC) Cc: 19395@debbugs.gnu.org To: Titus von der Malsburg Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 20 17:32:16 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 1Y2Mwx-0003Nf-T1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Dec 2014 17:32:16 +0100 Original-Received: from localhost ([::1]:35063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Mwx-0008L4-44 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Dec 2014 11:32:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Mwp-0008Ku-Ni for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 11:32:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2Mwk-0005wb-Fg for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 11:32:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Mwk-0005wX-Bx for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 11:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y2Mwj-0002QM-Uw for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 11:32: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: Sat, 20 Dec 2014 16:32:01 +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.14190930989277 (code B ref 19395); Sat, 20 Dec 2014 16:32:01 +0000 Original-Received: (at 19395) by debbugs.gnu.org; 20 Dec 2014 16:31:38 +0000 Original-Received: from localhost ([127.0.0.1]:53198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2MwL-0002PZ-VJ for submit@debbugs.gnu.org; Sat, 20 Dec 2014 11:31:38 -0500 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:56742) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2MwI-0002PP-TF for 19395@debbugs.gnu.org; Sat, 20 Dec 2014 11:31:36 -0500 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NGW00A002VU6A00@mtaout27.012.net.il> for 19395@debbugs.gnu.org; Sat, 20 Dec 2014 18:27:37 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NGW0097G320OU10@mtaout27.012.net.il>; Sat, 20 Dec 2014 18:27:37 +0200 (IST) In-reply-to: <87oaqyz85s.fsf@posteo.de> 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:97616 Archived-At: > From: Titus von der Malsburg > Cc: 19395@debbugs.gnu.org > Date: Sat, 20 Dec 2014 15:51:27 +0100 > > > (aref (font-info (face-font 'default)) 11) > > Great, thanks for adding this. Below the updated version of my solution > to the original problem: Looks good to me. A few comments about the doc strings: > (defun window-char-width (&optional window face) > "Return character width for WINDOW. Return average character width for the font of FACE used in WINDOW. > FACE is the face for which character width should be > returned. This is redundant with my proposed change above. > Buffer-local face remappings are applied. If nil, the > default face is used." I would reverse the order: If FACE is nil or omitted, the default face is used. If FACE is remapped (see `face-remapping-alist'), the function returns the information for the remapped face. > (defun window-max-characters-per-line (&optional window face) > "Return the number of characters that can be displayed > on one line. This should be one line, and it is better to mention WINDOW there. > Buffer-local face remappings are applied. "Are applied" is too vague, and might confuse. See my rewording above for one possible solution. > This function is different from `window-body-width' in that it > accounts for fringes Actually, it accounts for the portions of the line reserved for the continuation glyph. Missing fringes are just the trigger to reserve that. > one column is reserved for continuation characters) and for the Please use "glyphs" here, as it could be a string, not a single character. (This is explained in the documentation of standard-display-table.) > For completeness, it probably also makes sense to include the following > function in simple.el, which already has a function > `default-font-height'. I agree. Thanks.