From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#9084: 24.0.50; displaying man pages splits the window and formats the text forthe full width of the whole frame rather than for the width ofthe window the text is displayed in, which is only 1/2 thewidth of the frame Date: Thu, 21 Jul 2011 06:05:31 -0700 Message-ID: <7D5EAE17DC5C43988CFCCFD9EE4D1B09@us.oracle.com> References: <878vs0d10o.fsf@yun.yagibdah.de><8762n4e5gy.fsf@mail.jurta.org> <4E1FEC9C.2090102@gmx.at><87aacerzv3.fsf@yun.yagibdah.de> <87tyalilpf.fsf@mail.jurta.org><87zkkdouje.fsf@yun.yagibdah.de> <87hb6kcx7z.fsf@mail.jurta.org><87hb6jtqua.fsf@yun.yagibdah.de> <877h7fc7vx.fsf@mail.jurta.org><87livunq27.fsf@yun.yagibdah.de> <874o2hf0bt.fsf@mail.jurta.org> <4E271225.9030704@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311253640 971 80.91.229.12 (21 Jul 2011 13:07:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2011 13:07:20 +0000 (UTC) Cc: 9084@debbugs.gnu.org To: "'martin rudalics'" , "'Juri Linkov'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 21 15:07:13 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qjsy8-0000ke-IF for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2011 15:07:12 +0200 Original-Received: from localhost ([::1]:40401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjsy8-00079I-7f for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2011 09:07:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjsy2-0006fE-Ok for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2011 09:07:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qjsxy-000320-RM for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2011 09:07:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjsxy-00031w-OU for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2011 09:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qjsxy-0007P5-6y; Thu, 21 Jul 2011 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jul 2011 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9084-submit@debbugs.gnu.org id=B9084.131125356528388 (code B ref 9084); Thu, 21 Jul 2011 13:07:02 +0000 Original-Received: (at 9084) by debbugs.gnu.org; 21 Jul 2011 13:06:05 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qjswz-0007NY-Is for submit@debbugs.gnu.org; Thu, 21 Jul 2011 09:06:05 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qjswt-0007NC-Qe for 9084@debbugs.gnu.org; Thu, 21 Jul 2011 09:05:59 -0400 Original-Received: from rtcsinet22.oracle.com (rtcsinet22.oracle.com [66.248.204.30]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p6LD5lEg007696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Jul 2011 13:05:49 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p6LD5jCW010386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Jul 2011 13:05:46 GMT Original-Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p6LD5e3e028433; Thu, 21 Jul 2011 08:05:40 -0500 Original-Received: from dradamslap1 (/10.159.41.128) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Jul 2011 06:05:40 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4E271225.9030704@gmx.at> Thread-Index: AcxHclqs4K5lbc+sSg634htb9dLpogAMufqw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090209.4E28242D.00EF,ss=1,re=0.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 21 Jul 2011 09:07:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:49514 > I don't know a function to fit the width of a window to the > maximum line length of the buffer it shows, but writing such > a function should be easy provided we have a function that > tells us the maximum column within a buffer. FWIW, this is what I do for frame-fitting, in fit-frame.el. One thing to keep in mind, IMO, is to let users skip over "header" lines (in a wide sense that includes, e.g., the intro directory lines in Dired) when calculating the widest line. See function `fit-frame-max-window-size'. http://www.emacswiki.org/emacs/fit-frame.el This is the user option I provide for skipping header lines when calculating width: (defcustom fit-frame-skip-header-lines-alist '((Info-mode . 1) (dired-mode . 2) (compilation-mode . 2)) "*Alist of major-modes and header lines to ignore. When `fit-frame' calculates the width of the current buffer, it can first skip some lines at the buffer beginning, ignoring their widths. For example, Info, Dired, and compilation buffers sometimes have a long header line at the top. You can use this alist to tell `fit-frame' to ignore the width of these header lines. Each item in the alist is of form (MODE . LINES). MODE is a major-mode name. LINES is the number of lines to skip at the beginning of the buffer." :type '(repeat (cons :format "%v" (symbol :tag "Major Mode") (integer :tag "Header Lines to Ignore"))) :group 'fit-frame) Obviously, if we always used real `header-line' lines or some other way to distinguish the lines to skip, then things would be easier and more reliable. Note too that skipping the header lines in Dired is more important when details are hidden (dired-details.el), which typically makes the buffer contents much narrower than the "header" lines. Finally, the code I use just works off of the `frame-char-width' - it does not take into account variable pitch or multiple size fonts in the same buffer or things such as Chinese chars in the buffer.