From unknown Mon Sep 08 16:26:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32536 <32536@debbugs.gnu.org> To: bug#32536 <32536@debbugs.gnu.org> Subject: Status: displayed width of man pages Reply-To: bug#32536 <32536@debbugs.gnu.org> Date: Mon, 08 Sep 2025 23:26:14 +0000 retitle 32536 displayed width of man pages reassign 32536 emacs submitter 32536 hw severity 32536 wishlist tag 32536 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 26 12:42:14 2018 Received: (at submit) by debbugs.gnu.org; 26 Aug 2018 16:42:14 +0000 Received: from localhost ([127.0.0.1]:33246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fty7B-0003l5-Oe for submit@debbugs.gnu.org; Sun, 26 Aug 2018 12:42:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftul5-0006oH-Bd for submit@debbugs.gnu.org; Sun, 26 Aug 2018 09:07:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftuky-0006AO-I4 for submit@debbugs.gnu.org; Sun, 26 Aug 2018 09:07:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43398) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ftuky-00069W-CB for submit@debbugs.gnu.org; Sun, 26 Aug 2018 09:07:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftukw-0007LN-He for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 09:07:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftuku-00065B-Kj for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 09:07:02 -0400 Received: from mo6-p01-ob.smtp.rzone.de ([2a01:238:20a:202:5301::9]:13818) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ftuku-0005zx-6O for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 09:07:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1535288816; s=strato-dkim-0002; d=adminart.net; h=Sender:Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH: From:Subject:Sender; bh=SnO+IZ9YxMDXYz5M6O+L3U2+AAYHrpn6H8CYrnE+/Hg=; b=Pi2OrQlKOTZcCxjBdWw77HnBnJ3w+eUw2QIn+6KshUiuMsG0OvoSf5WfUPeSqdCu/+ lTdDu8aOFgqegWPl/KL0akGymRvp19JZhfFhjNEx2EgztnDvDtdMfdZpNWtCkyOl9xxn s30o6Hu2c8rPb9lEqPfV3D9LeYVWEdyufuaMGLEUWWHLTDFx6taK8KjVbuQQgn/r9w5S xo9sDZAZoB6wre31QnG8+2r//nWWa81A7jg5QEgeLFRxyxf7b3UzUZbjwM4ZhWw8A5JP 7CtSXnwokn4p+A/PfjnYVqPjB0AXp2kO2LZHB+c5PO+d4c5O6rEYBeWUT7eVQyYgFvdP h1hw== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from lee by himinbjorg.adminart.net with local (Exim 4.90_1) (envelope-from ) id 1ftukp-0000Rm-QZ for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 15:06:55 +0200 From: hw To: bug-gnu-emacs@gnu.org Subject: 24.3; Feature Request: change defaults or behaviour Date: Sun, 26 Aug 2018 14:42:48 +0200 Message-ID: <878t4t70zb.fsf@himinbjorg.adminart.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 26 Aug 2018 12:42:12 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) This is not bug report but a change or a feature request: Please change the default behaviour of the (man) function or the default value of Man-width to 75 such that manual pages are formatted to a reasonable width by default. The same goes for other manuals that are being formatted before displayed. Text is best read when it is displayed in about 70--80 characters per line. The size of the window the text is displayed in does not change this. It is reasonable to assume that users rather have manual pages displayed with line lengths that make them easy to read than having them displayed at about 300 characters per line when the window happens to be full screen or 140 when they have two windows side by side. When a user needs wider text, they can still change the default. As a feature request: How about changing the effect of Man-width, or an additional setting: Emacs could usefully format manual pages to fit the window when the window is narrower than the default width of manual pages (unless the window is ridiculously narrow, in which case it could fall back to the default width for manual pages) and format them no wider than the default width of manual pages for windows that are wider. It could also, depending on a(nother) setting(s), dynamically re-format the manual pages to min( (width_of_window <= ridiculously_narrow) ? max_width_of_manual_pages : width_of_window, max_width_of_manual_pages ) when the window is resized and had been less wide than the maximal width for manual pages before. The "max_width_of_manual_pages" could be a range, like 70 to 100, because it may be desirable to use a couple more characters per line when the width of the window allows it, without going crazy. The default for "ridiculously_narrow" might be like 60. Of course, this can all be changed by the user. This feature might be cool for those who like dynamic (re-)formatting; I don't think it's much needed. In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.10) of 2017-09-20 on c1bm.rdu2.centos.org Configured using: `configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk3' '--with-gpm=no' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro '' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8 default enable-multibyte-characters: t Major mode: Org Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t show-paren-mode: t desktop-save-mode: t tags-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t auto-fill-function: org-auto-fill-function transient-mark-mode: t Recent input: O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O B ESC O C ESC O B ESC O C C-x b * G r TAB RET L C-s C-s ESC O D RET ESC < ESC > ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A RET C-x b RET C-x 1 C-x b e d TAB RET C-s d e b C-s C-s C-s C-s C-s C-s C-s C-s C-a C-s g n u C-s C-s C-s C-s C-a ESC x r e p o r TAB RET Recent messages: SUBTREE (NO CHILDREN) FOLDED Mark saved where search started No more unseen articles No more unread articles Mark set [2 times] Mark saved where search started [2 times] Load-path shadows: None found. Features: (shadow emacsbug bookmark shr browse-url gnus-dired pp etags man mule-util network-stream starttls url-http url-gw url-cache url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars linum tabify org-table asm-mode info diff-mode jka-compr gnus-draft debug shell gnus-dup misearch multi-isearch help-mode hi-lock cperl-mode flyspell ispell sort gnus-cite flow-fill mm-archive mail-extr gnus-async gnus-bcklg parse-time qp gnus-ml disp-table utf-7 utf7 rfc2104 tls imap auth-source eieio nndraft nnmh nnfolder nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-cache gnus-demon nntp gnus-diary gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap nndiary gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader wid-edit rst compile conf-mode cc-langs cl cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sh-script smie executable eldoc python rx vc-git org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda org-info org-gnus gnus-util org-docview org-bibtex bibtex org-bbdb org byte-opt warnings bytecomp byte-compile cconv ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs find-func cal-menu calendar cal-loaddefs message sendmail format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader finder-inf package uniquify advice help-fns cl-lib advice-preload server two-column edmacro kmacro time-date paren cus-start cus-load desktop dired fvwm-mode easymenu lsl-mode tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 27 11:53:31 2018 Received: (at control) by debbugs.gnu.org; 27 Aug 2018 15:53:31 +0000 Received: from localhost ([127.0.0.1]:34437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuJpb-00024E-In for submit@debbugs.gnu.org; Mon, 27 Aug 2018 11:53:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuJpa-000240-9G for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fuJpT-0000u0-FV for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:53:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fuJpS-0000tW-RQ for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:53:22 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1fuJpS-0001kS-Lh for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:53:22 -0400 Subject: control message for bug 32536 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 27 Aug 2018 11:53:22 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) retitle 32536 displayed width of man pages From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 27 11:58:30 2018 Received: (at control) by debbugs.gnu.org; 27 Aug 2018 15:58:30 +0000 Received: from localhost ([127.0.0.1]:34441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuJuQ-0002C5-5e for submit@debbugs.gnu.org; Mon, 27 Aug 2018 11:58:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuJuO-0002Br-VD for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:58:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fuJuJ-0004RB-6X for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:58:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fuJuB-0004Gj-Bu for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:58:19 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1fuJuA-0002R7-Ph for control@debbugs.gnu.org; Mon, 27 Aug 2018 11:58:15 -0400 Subject: control message for bug 32536 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 27 Aug 2018 11:58:14 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) merge 9385 32536 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 19:39:38 2018 Received: (at 32536) by debbugs.gnu.org; 30 Aug 2018 23:39:38 +0000 Received: from localhost ([127.0.0.1]:39571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvWXK-0008Jh-G1 for submit@debbugs.gnu.org; Thu, 30 Aug 2018 19:39:38 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:53636 helo=pdx1-sub0-mail-a24.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvWXC-0008JI-Mb for 32536@debbugs.gnu.org; Thu, 30 Aug 2018 19:39:32 -0400 Received: from pdx1-sub0-mail-a24.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a24.g.dreamhost.com (Postfix) with ESMTP id E2FFF7F314; Thu, 30 Aug 2018 16:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=x2CSFUpBCGbBDaVErGkJ7WMMpSM=; b= NmDCM3kcNyVFTV93QfTvb6uJfcyVWDsojGWXaHGZBlBXdN3xF760rLuk8ml4dRnV rg6bgAm2pINjbenaBsckCsv72sZehxVkkjycOqNtDQbD6Cw2A/oDQi8KLo8R89Wk E8txfNzvawdZ9Qk9qgdNqc2d6LcvqNDzxp/aMZ+7VJk= Received: from localhost.linkov.net (m91-129-99-146.cust.tele2.ee [91.129.99.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a24.g.dreamhost.com (Postfix) with ESMTPSA id 457DF7F312; Thu, 30 Aug 2018 16:39:27 -0700 (PDT) From: Juri Linkov To: hw Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> Date: Fri, 31 Aug 2018 02:35:45 +0300 In-Reply-To: <878t4t70zb.fsf@himinbjorg.adminart.net> (hw@adminart.net's message of "Sun, 26 Aug 2018 14:42:48 +0200") Message-ID: <87in3r1l7y.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > As a feature request: > > How about changing the effect of Man-width, or an additional setting: > Emacs could usefully format manual pages to fit the window when the > window is narrower than the default width of manual pages (unless the > window is ridiculously narrow, in which case it could fall back to the > default width for manual pages) and format them no wider than the > default width of manual pages for windows that are wider. Thanks for the feature request. As proposed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9385 this patch implements a new option "Maximum width" as a hard limit that prevents the width to grow over this value: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=man-maximum-width.1.patch diff --git a/lisp/man.el b/lisp/man.el index 1a6eda13b7..fcf9085d20 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -179,6 +179,7 @@ Man-width The value also can be a positive integer for a fixed width." :type '(choice (const :tag "Window width" nil) (const :tag "Frame width" t) + (cons :tag "Maximum width" (const :value max) (integer :value 80)) (integer :tag "Fixed width" :value 65)) :group 'man) @@ -1045,16 +1046,20 @@ Man-start-calling (cond ((and (integerp Man-width) (> Man-width 0)) Man-width) - (Man-width + ((eq Man-width t) (if (window-live-p (get-buffer-window (current-buffer) t)) (with-selected-window (get-buffer-window (current-buffer) t) (frame-width)) (frame-width))) (t - (if (window-live-p (get-buffer-window (current-buffer) t)) - (with-selected-window (get-buffer-window (current-buffer) t) - (window-width)) - (window-width))))))) + (let ((width + (if (window-live-p (get-buffer-window (current-buffer) t)) + (with-selected-window (get-buffer-window (current-buffer) t) + (window-width)) + (window-width)))) + (if (eq (car-safe Man-width) 'max) + (min width (cdr Man-width)) + width))))))) ;; Since man-db 2.4.3-1, man writes plain text with no escape ;; sequences when stdout is not a tty. In 2.5.0, the following ;; env-var was added to allow control of this (see Debian Bug#340673). --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 31 02:55:02 2018 Received: (at 32536) by debbugs.gnu.org; 31 Aug 2018 06:55:02 +0000 Received: from localhost ([127.0.0.1]:39698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvdKg-0006bU-2d for submit@debbugs.gnu.org; Fri, 31 Aug 2018 02:55:02 -0400 Received: from mout.gmx.net ([212.227.17.22]:59453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvdKe-0006as-8a for 32536@debbugs.gnu.org; Fri, 31 Aug 2018 02:55:00 -0400 Received: from [192.168.1.101] ([212.95.5.167]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MC7em-1g4Oks4Afg-008tn8; Fri, 31 Aug 2018 08:54:51 +0200 Message-ID: <5B88E62F.20504@gmx.at> Date: Fri, 31 Aug 2018 08:54:39 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , hw Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> In-Reply-To: <87in3r1l7y.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:hpRNfHrf1V9SMycweLa/dhxjiIbjov5JxXKAz+pCuyTWaH48ZZP 0wYMQ/0ALxa6o2in0pbrYjeTeKWCfXKtyTlYenQihmepUDpkKu3DDHj8vzTnpFT/wUEfyud rDiXlAj5EepjpW7AjolSQ9XLgN1q71oGECwiLKhqlQqZzM2dwAYZdJGTHXpY9414Lxzb2XU 30I+ctlIDgqVbhoxZVg7w== X-UI-Out-Filterresults: notjunk:1;V01:K0:dkBXmbNPMog=:3S0NIb4ntBa5k3Tjmc11Pm iIO+/jBEjyo4cJixUEjxKEHmBdvJHTYyTLQrXJL9TJSpij9dA5cScUKKAtL6KV7Sqt2WZxR55 EaFA6ewpulAylAonGvKskwkMGPB9vfR6OgBroq290REuyqgEJbJzn/Ks2XUPCZkaJhgcLSs+j ok1ucPlRp0Q4h23VleV9OAC2wbmv/8WxK+nJYz1jBxODH+kvpP4sSVKEqk4DdSDpMR7fbPLpk Bb+CgN5p++3+/ZxZOIilyR6OdO1LSYV3pjPdy832L4O7Hkmr/p44ui6wx7L+AnvyLKV+zGb0C Zx3Gwc2skwnj3iOIV3ISYtU6Ph6aG9+b/KMNXYklUmY5dearWPn6TsJN3C45BGNRFAZ2mDVdy Obro7focgL36XaRdu8zk5p6bd6Qrg4m1KQp1gGWchWoUbqxSvwo+DDH1F0qA8iM1+GhzFTqvp pWau6VGbFkmeUnk4kIfOKJMi8gHKuYGUnDYiipoj8Znraom3a2Hu76o+6yXo46R/ehSKpvavp G9BPl+40ZgQlDGXCHF+onkYCpHXA6urjzI+vobTyJdpFAOIXn9gZW19MN46yZ8pNqmcXingva H7KfR48yNqH/hoUWZfRByx9rClmkTgRNQauNpI7MaS3MetGC5BFnBlNAw7rFqx5hqFvcnzh6M hXPGuOwJ8xHv/7BK+aX8zQbpkhE0RVOKvaYYumAibQB/PZyjdWv2dt/Fk+OTGxyXSOM0XA8tu mOSMSaJp05I2L97SZpdCArTeCZI3eQnnfl2BsmMipkw+VYdrJ1ph0CLzc6thZHfPulsc4XjsV dQDPRjY X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > As proposed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9385 > this patch implements a new option "Maximum width" as a hard limit > that prevents the width to grow over this value: While you're there could you please do some idiomatic changes that avoid selecting a window in order to calculate its width: For example, replace (let ((width (if (window-live-p (get-buffer-window (current-buffer) t)) (with-selected-window (get-buffer-window (current-buffer) t) (window-width)) (window-width))))) with something like (window-width (get-buffer-window nil t)) and (if (window-live-p (get-buffer-window (current-buffer) t)) (with-selected-window (get-buffer-window (current-buffer) t) (frame-width)) (frame-width)) with something like (let ((window (get-buffer-window nil t))) (frame-width (and window (window-frame window)))) Probably you also want to add a version tag for 'Man-width'. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 01 18:30:14 2018 Received: (at 32536) by debbugs.gnu.org; 1 Sep 2018 22:30:14 +0000 Received: from localhost ([127.0.0.1]:42198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwEPG-0001b7-9S for submit@debbugs.gnu.org; Sat, 01 Sep 2018 18:30:14 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:51808 helo=pdx1-sub0-mail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwEPE-0001az-1s for 32536@debbugs.gnu.org; Sat, 01 Sep 2018 18:30:12 -0400 Received: from pdx1-sub0-mail-a39.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTP id D10BD7FA75; Sat, 1 Sep 2018 15:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=MZVwZfexo8fWH69tUXp1Mccaiac=; b= TksE4nvqhBRNoviUNtHLRXohdZ816J8uoSZyvuM8n+T/mQwRkeV71N8oimni+HBM 5+3cW+1WuGoUiiCKXlnA2+WGZoICOmyFi8XH4/xcnQ7qCB6NJsNPNiAr5iBzWAOM 7daMtsr8dg3s9YPawMByNpaSOVR5/G6d8xiFOa6byOg= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTPSA id 1F9BF7FA79; Sat, 1 Sep 2018 15:30:08 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> Date: Sun, 02 Sep 2018 01:27:20 +0300 In-Reply-To: <5B88E62F.20504@gmx.at> (martin rudalics's message of "Fri, 31 Aug 2018 08:54:39 +0200") Message-ID: <87d0twam5z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > While you're there could you please do some idiomatic changes that > avoid selecting a window in order to calculate its width: > > For example, replace > > (let ((width > (if (window-live-p (get-buffer-window (current-buffer) t)) > (with-selected-window (get-buffer-window (current-buffer) t) > (window-width)) > (window-width))))) > > with something like > > (window-width (get-buffer-window nil t)) > > and > > (if (window-live-p (get-buffer-window (current-buffer) t)) > (with-selected-window (get-buffer-window (current-buffer) t) > (frame-width)) > (frame-width)) > > with something like > > (let ((window (get-buffer-window nil t))) > (frame-width (and window (window-frame window)))) > > Probably you also want to add a version tag for 'Man-width'. Right, fixed in the next patch where a version tag is added not to `Man-width', but to the new customizable variable `Man-width-max'. This is better since like when man-pages are formatted in their web versions they limit the width using the CSS property `max-width', so like CSS has both `width' and `max-width', man.el will have `Man-width' and `Man-width-max'. Regarding the request for dynamic reformatting, I'm not sure if man pages should be reformatted on resizing windows (I remember seeing a window resize hook, but can't find it now). Such window resize is necessary also for some other modes, for example, when a visited image is saved to the desktop file, it has a wrong size after loading the desktop, because the image size is calculated when the image file is not yet displayed in a window. The image size should be recalculated after displaying the image buffer. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=man-maximum-width.2.patch diff --git a/lisp/man.el b/lisp/man.el index 1a6eda13b7..08a913b119 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -182,6 +182,20 @@ Man-width (integer :tag "Fixed width" :value 65)) :group 'man) +(defcustom Man-width-max nil + "Maximum number of columns allowed for the width of manual pages. +It defines the maximum width for the case when `Man-width' is customized +to a dynamically calculated value depending on the frame/window width. +If the width calculated for `Man-width' is larger than the maximum width, +it will be automatically reduced to the width defined by this variable. +If the calculated width is smaller than the maximum width, the value +of this variable has no effect. +When nil, there is no limit on maximum width." + :type '(choice (const :tag "No limit" nil) + (integer :tag "Max width" :value 80)) + :version "27.1" + :group 'man) + (defcustom Man-frame-parameters nil "Frame parameter list for creating a new frame for a manual page." :type '(repeat (cons :format "%v" @@ -1041,20 +1055,19 @@ Man-start-calling (not (or (getenv "MANWIDTH") (getenv "COLUMNS")))) ;; Since the page buffer is displayed beforehand, ;; we can select its window and get the window/frame width. - (setenv "COLUMNS" (number-to-string - (cond - ((and (integerp Man-width) (> Man-width 0)) - Man-width) - (Man-width - (if (window-live-p (get-buffer-window (current-buffer) t)) - (with-selected-window (get-buffer-window (current-buffer) t) - (frame-width)) - (frame-width))) - (t - (if (window-live-p (get-buffer-window (current-buffer) t)) - (with-selected-window (get-buffer-window (current-buffer) t) - (window-width)) - (window-width))))))) + (let ((width (cond + ((and (integerp Man-width) (> Man-width 0)) + Man-width) + (Man-width + (let ((window (get-buffer-window nil t))) + (frame-width (and window (window-frame window))))) + (t + (window-width (get-buffer-window nil t)))))) + (when (and (integerp Man-width-max) + (> Man-width-max 0) + (> width Man-width-max)) + (setq width (min width Man-width-max))) + (setenv "COLUMNS" (number-to-string width)))) ;; Since man-db 2.4.3-1, man writes plain text with no escape ;; sequences when stdout is not a tty. In 2.5.0, the following ;; env-var was added to allow control of this (see Debian Bug#340673). --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 03:14:30 2018 Received: (at 32536) by debbugs.gnu.org; 2 Sep 2018 07:14:30 +0000 Received: from localhost ([127.0.0.1]:42340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwMac-00063i-F2 for submit@debbugs.gnu.org; Sun, 02 Sep 2018 03:14:30 -0400 Received: from mout.gmx.net ([212.227.15.18]:43775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwMaZ-00063Q-Rs for 32536@debbugs.gnu.org; Sun, 02 Sep 2018 03:14:28 -0400 Received: from [192.168.1.101] ([212.95.5.6]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M3zT0-1fe9BA2tnO-00rWiS; Sun, 02 Sep 2018 09:14:18 +0200 Message-ID: <5B8B8DC8.7020001@gmx.at> Date: Sun, 02 Sep 2018 09:14:16 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> In-Reply-To: <87d0twam5z.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:3Bk9RdSxAVZvzadCBzYJi7cSFGfOl6Ljyg1Fxwh85JVuCB7y6gQ kjLJ2xUDgVU5+cbZ0reNJGzNJRHW+BMcXPlWwrCHMiEdBnJHH/swOKc4EDO3iXUMym5tXdL nvVtQemlAkuSt1bkOoNpk5Yfm13jkq4emBlhK3doutZqXE5g2BTnY714nccY+YLoPxJiUCO 4i4b5Xe/OTf3nHv0eI8wg== X-UI-Out-Filterresults: notjunk:1;V01:K0:OIzgt/mVAzE=:w4s7b4PeqGymwr1rR4bFnW loZJ+RDh9cCGReeDZv/l1GTqRgEX4CbfUr9eaGv/jzhM8YvIPmzY2UXVEXslR7CTNUQpQVQ2j 4yGv+tZ3tdJciR9tf3c5QQeDqk8Pu3Zw4vu5ftuqmsBcCnbAF2rAZSqCxX3IWmSablsIalk3y 2BUgnYdhFln5PkIF8hTO9JJGYJW1srZpppZGY73I6/RM37OZ5OKkIBUVns5QCFCN5SkrcQwpQ t2OKfY3NhE3I+dZu/ci2Jm3IWWMQW+afv0racV6KRJWJjdWiHUt2Bpz+jT96rUiVmVhDKAYVl mZi6V6DKt/R0rl8ZfQajKWLTBXUWd0Dp62w7Cks3nL4ino7h2sX7PwXSFl9VyCZ7uWGi7Incs D2UIZ0LpzU3uGCINXFHAMhuPQmPopHUnk8LKWnoxBbP/POAjOobgfdxnpyT6BEoCepXo2ZXrH vP1yFdf+g1R1w85cVvcuWb8E/AYFe7K4iKD8JcvIW85RbSRB5knuj8psobgU57HJzKtbLmRXA rWX1/+37RFPB6RCRw87xvOh1eczpZkwAAUeTMANcHb7NTVCzEESymK5BDQjJrO3QQ6ZGRSEw4 Yx37zM5bvr/2uFFPQRMKVSOkJNHui4sP54lirhpWC14R+EhLpL8bsQBND9SegtWyLVU//Ny1M Eh4s4MXHGG/V8zTaN9o8w5pPGDwv6GL6AOVedDX746RcS2AlvhvE9OiEnc2SF2/tw5hmgtA48 ZCtb3dKhukozG7wmail1c9/PG/kc3gvwtPpfgl6x0kU+cEchqtXjtDNL2jchOqGA056KPqP1v BJitFge X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Regarding the request for dynamic reformatting, I'm not sure if > man pages should be reformatted on resizing windows (I remember > seeing a window resize hook, but can't find it now). It's called 'window-size-change-functions'. > Such window resize is necessary also for some other modes, Why "Such window resize"? We talk about reformatting buffer contents when a window gets resized for some reason. We do not want to resize the window when reformatting a man page because we know the length of Man lines beforehand. > for example, when a visited image is saved to the desktop file, > it has a wrong size after loading the desktop, because the > image size is calculated when the image file is not yet displayed > in a window. The image size should be recalculated after > displaying the image buffer. This would be probably about fitting a window to the image it displays. But why do we have to display the image first and then recalculate its size? Don't we know the image size in advance? martin From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 10:56:13 2018 Received: (at 32536) by debbugs.gnu.org; 2 Sep 2018 14:56:13 +0000 Received: from localhost ([127.0.0.1]:43146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwTnR-0002Z9-J5 for submit@debbugs.gnu.org; Sun, 02 Sep 2018 10:56:13 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.166]:35959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwTnP-0002Yz-NA for 32536@debbugs.gnu.org; Sun, 02 Sep 2018 10:56:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1535900170; s=strato-dkim-0002; d=adminart.net; h=Sender:References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=6Xt304OZGtrjsm8whxszQPFXu+1v2/i06aCUtCbgLOs=; b=qSPeCBxbFWh0qeI9HipfbTFuLetF+zhWW8anLvad8I9f2vPACNLBR4sKWy/1LKgdqv Gfgkh7IvgMzc7pWKdGa3tY3BhUZIdfWWOTyQTHkSVcls1Inr7gCdxiM/wNM+NpWx8Vt9 iSJRmyd857eglqNgREqZJhBH62gXjvmB9Nuq1kmv6hSOoWnbCVog9Haka+j0It9lJdEg AOdBI8LSs/mgM+QqPq6Pmm97daBAUKxt0AVUyTuG+AAJ3u2TntNh1+87tROhfSOOAM4w VxwaoHRxEkYgEHGvNBEChnrjQY4VI37V0z+XpJBJporN2BDto4bm/qdT43R2INRKfprF +psA== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 43.21 DYNA|AUTH) with ESMTPSA id j020b1u82Eu9FAS (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 2 Sep 2018 16:56:09 +0200 (CEST) Received: from lee by himinbjorg.adminart.net with local (Exim 4.90_1) (envelope-from ) id 1fwTnN-0000Ur-4I; Sun, 02 Sep 2018 16:56:09 +0200 From: hw To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <87d0twam5z.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Sep 2018 01:27:20 +0300") Date: Sun, 02 Sep 2018 16:55:25 +0200 Message-ID: <87pnxwgd9e.fsf@himinbjorg.adminart.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > [...] > Regarding the request for dynamic reformatting, I'm not sure if > man pages should be reformatted on resizing windows (I remember > seeing a window resize hook, but can't find it now). Perhaps if they /can/ be reformatted dynamically, have a variable like `Man-dynamic-reformat-lines-max' so users can prevent the reformatting for instances in which it takes too long. Then a problem is that the number of lines varies with the width of the page, and instead of the number of lines, the size in bytes (kB, MB ...) of the page might be more relevant for reformatting it. Unfortunately, users usually have no idea what the size of a manual page in bytes is, and the pages are even stored compressed. Users would have to try out what size makes sense to dynamically reformat on their particular hardware and may end up simply turning the feature off because they do not resize windows while reading manual pages anyway. Does it take longer to format the same manual page into 2500 lines or into 5000 lines? Would it be possible to do the reformatting in the background, and delayed, like fontifying a buffer? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 18:49:39 2018 Received: (at 32536) by debbugs.gnu.org; 2 Sep 2018 22:49:39 +0000 Received: from localhost ([127.0.0.1]:43440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBb-0003aE-Gn for submit@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:39 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:36860 helo=pdx1-sub0-mail-a9.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBZ-0003a4-M0 for 32536@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:37 -0400 Received: from pdx1-sub0-mail-a9.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTP id 94B937EC62; Sun, 2 Sep 2018 15:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=h4Gk1dzMKoEx4TbuFVPcM+ch8eo=; b= WRS51ui8pBpHBis2k1brnnvZko/V2St1yC6OYUbtMtI4P+52+uHlZRgtJMpYzCA5 kIgB09hnTdbyfMj4Tl0qXR2eU2DdZVIH1GJJVtnZ8+eog0me8+wtdKf4+yIaCK4D GRQNwgApTfhAA/rX5pKb2i/H4pn9cHTjCVkv8H20wh0= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTPSA id EE3627EA4D; Sun, 2 Sep 2018 15:49:34 -0700 (PDT) From: Juri Linkov To: hw Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <87pnxwgd9e.fsf@himinbjorg.adminart.net> Date: Mon, 03 Sep 2018 01:12:58 +0300 In-Reply-To: <87pnxwgd9e.fsf@himinbjorg.adminart.net> (hw@adminart.net's message of "Sun, 02 Sep 2018 16:55:25 +0200") Message-ID: <875zznmtud.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Perhaps if they /can/ be reformatted dynamically, have a variable like > `Man-dynamic-reformat-lines-max' so users can prevent the reformatting > for instances in which it takes too long. Then a problem is that the > number of lines varies with the width of the page, and instead of the > number of lines, the size in bytes (kB, MB ...) of the page might be > more relevant for reformatting it. > > Unfortunately, users usually have no idea what the size of a manual page > in bytes is, and the pages are even stored compressed. Users would have > to try out what size makes sense to dynamically reformat on their > particular hardware and may end up simply turning the feature off > because they do not resize windows while reading manual pages anyway. > > Does it take longer to format the same manual page into 2500 lines or > into 5000 lines? > > Would it be possible to do the reformatting in the background, and > delayed, like fontifying a buffer? Man pages are already formatted asynchronously in the background, so actually reformatting on window resize should be quite responsible even for large manuals (maybe an addition flag is needed to prevent updating when a previous update is in progress). You can try and see how fast it reformats, typing repeatedly the key `u' (Man-update-manpage). From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 18:49:45 2018 Received: (at 32536) by debbugs.gnu.org; 2 Sep 2018 22:49:45 +0000 Received: from localhost ([127.0.0.1]:43443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBg-0003aW-Ow for submit@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:44 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:36870 helo=pdx1-sub0-mail-a9.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBe-0003aO-FY for 32536@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:43 -0400 Received: from pdx1-sub0-mail-a9.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTP id EA19B7EA4D; Sun, 2 Sep 2018 15:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=ugiIAGzMORuBT1w4FlAsYkFxFfA=; b= ZyO5OjUukDE2rNRQdGtVZQjV1ChlCl72Ob05hpZG0khToJBl7CQRO73gC76wSYMk ahdJ7gjvj6h3qwxm3C0/SSG9ila8D4c0bDw8qYR7P6CYUXEWVea6P3EG/qx2tSnk yvNhrn38I4MDPPCqVS7iGUml4LVLKieLT32pJBVsRAw= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTPSA id 17A397E9E0; Sun, 2 Sep 2018 15:49:39 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> Date: Mon, 03 Sep 2018 01:19:19 +0300 In-Reply-To: <5B8B8DC8.7020001@gmx.at> (martin rudalics's message of "Sun, 02 Sep 2018 09:14:16 +0200") Message-ID: <8736urmtjs.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >> Regarding the request for dynamic reformatting, I'm not sure if >> man pages should be reformatted on resizing windows (I remember >> seeing a window resize hook, but can't find it now). > > It's called 'window-size-change-functions'. Thanks, I tried window-size-change-functions, and it works pretty well with the patch attached. But there are a few problems: 1. In Man-mode we have to add hook window-size-change-functions only buffer-locally (using the arg LOCAL of add-hook) rather than globally, because otherwise we can't remove this hook when a Man buffer is not displayed anymore. But the problem is that buffer-local window-size-change-functions is called only when the current buffer is in Man-mode. If it's not, it's not called even when resizing of the current non-Man buffer causes the resize of a Man-mode buffer in an adjacent window. 2. What if the same Man-mode buffer is displayed in two adjacent windows side-by-side? I guess we need to find all windows with the same buffer, compare their widths, and call Man-update-manpage only in the window with minimal width. Also it seems window-size-change-functions is not called twice for every window with Man-mode buffer, this is good. 3. When windows are resized using the mouse, is it possible to call window-size-change-functions only when the mouse button is released? This will increase responsiveness. But the same problem will remain for keyboard resizing with e.g. C-x } } } A debounce-like function could help, but I can't find its Emacs Lisp implementation anywhere. I mean something similar to https://stackoverflow.com/questions/15927371/what-does-debounce-do It's easy to implement using timers, but better to have idiomatic implementation. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=Man-window-size-change.1.patch diff --git a/lisp/man.el b/lisp/man.el index 1a6eda13b7..f737594de7 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1524,7 +1537,17 @@ Man-mode (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) - 'Man-bookmark-make-record)) + 'Man-bookmark-make-record) + (add-hook 'window-size-change-functions 'Man-window-size-change nil t)) + +(defun Man-window-size-change (frame) + (walk-windows (lambda (window) + (when (/= (window-pixel-width-before-size-change window) + (window-pixel-width window)) + (with-current-buffer (window-buffer window) + (when (derived-mode-p 'Man-mode) + (Man-update-manpage))))) + 'nomini frame)) (defun Man-build-section-list () "Build the list of manpage sections." --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 18:49:51 2018 Received: (at 32536) by debbugs.gnu.org; 2 Sep 2018 22:49:51 +0000 Received: from localhost ([127.0.0.1]:43446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBn-0003aw-3G for submit@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:51 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:36884 helo=pdx1-sub0-mail-a9.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBk-0003an-PR for 32536@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:48 -0400 Received: from pdx1-sub0-mail-a9.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTP id 46C0E7EC62; Sun, 2 Sep 2018 15:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=pZGvrXxts+Of/j6WEf5kGdxkI2g=; b= LlARalPYq9FNpqvCaExsLQTU/SkQjS8SVSx1HPE8IYZN+Otx2+3oitqRE+ZLJg1b Lcqta1S7qEocQWm1yx/cyxDvd39gUq3aiuxV74L8JyhZupZEJSoDLnXWlvuNmCHQ VlCwEF1wg/MEX7/o11URzBAeAvgEESB3/u7qzXbbaBw= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTPSA id 3574F7E9E0; Sun, 2 Sep 2018 15:49:45 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> Date: Mon, 03 Sep 2018 01:30:30 +0300 In-Reply-To: <5B8B8DC8.7020001@gmx.at> (martin rudalics's message of "Sun, 02 Sep 2018 09:14:16 +0200") Message-ID: <87d0tvlegp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> for example, when a visited image is saved to the desktop file, >> it has a wrong size after loading the desktop, because the >> image size is calculated when the image file is not yet displayed >> in a window. The image size should be recalculated after >> displaying the image buffer. > > This would be probably about fitting a window to the image it > displays. But why do we have to display the image first and then > recalculate its size? Don't we know the image size in advance? Currently image-mode resizes the displayed image to fit into the window. It can't do this when an image buffer is restored from the desktop file and not yet displayed. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 03 03:31:34 2018 Received: (at 32536) by debbugs.gnu.org; 3 Sep 2018 07:31:34 +0000 Received: from localhost ([127.0.0.1]:43559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwjKg-0008QG-Fx for submit@debbugs.gnu.org; Mon, 03 Sep 2018 03:31:34 -0400 Received: from mout.gmx.net ([212.227.15.18]:55533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwjKe-0008Q3-94 for 32536@debbugs.gnu.org; Mon, 03 Sep 2018 03:31:32 -0400 Received: from [192.168.1.101] ([46.125.250.51]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MXIcX-1gQcWs0mVp-00WHZ8; Mon, 03 Sep 2018 09:31:23 +0200 Message-ID: <5B8CE346.60809@gmx.at> Date: Mon, 03 Sep 2018 09:31:18 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> In-Reply-To: <8736urmtjs.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:5cXNMuJcd7/8ItZOPbWsoyf2epOCpNCxspZJ3d9yM+mhS06F3bg 5Tx9gOGIuVRpaCxzzXvcg3WRbP+L9EYlwQ628VvXBgjJ4He7HCJj8kyOyzUeGAjOuQv/QXw dd/B+PWvfn1twXpG9Gl6MoudH3Hpn6gLP5N5Ls5x6s5YcZbYY7h2g52nX3PIL6p65jvbrqU kHLT2M8kVhQMZ4f4yHfTw== X-UI-Out-Filterresults: notjunk:1;V01:K0:9FDfpT77M3Y=:veSMPWR0YrKS0T5uoa96/w qysnL5XUUd/2mjH6Vexsp4W1YSqKD/GjB/DO1xOu94hSaPcLwxDqSCO/N45Uh+h2dh2RCG9JI /jaMLdDqO3by2RurQWHPQAiG+s2pHEQDc7Lr/ze7AYQg2QLQdWvK9K4VJTp+su2+0PjF3dWMp vs4LP33KyVG1RNOGj0xRH5zvKrRV6U5GdNy5LM9de5M8iuLWjz0LpHd/7fY5eYm92iOB1Lsp2 AhF+mcCk4St3hWA0QPha0yvlzSsL6tN8kEB10mMui6xif0q4IMg5ovCXGbg0GIXLn8ydxZW3T 3rqVt6DA8b1RVCuvEWMilgV8Tfpwomp4h01lDPtd6YdJd5ZVbeETgtcQDYQNFgF5ZXSTVH9ik M3vNi25hAy7R7MAgYKG6xnVOqYOPmO8zy+6NSzGLQ/KVpMtEdZGOxIpZJQhI/2uFRC2b98axN gnkFsGr7hAQ7doGC7EliwAzsh+wBJSBq+yUJFgrqDC10KMmYWfr5+QQLOyOOGJ0BWk8xL0Uyi gFjRUUePM6Y9ABbu+XC9o6dnv0LZPhY/c+SvAWrvlSWxjdbxfmg2kyzRP96Butz7bU9oq3fkb tWepJ6p234FFvkwMhjSVDsxvJFemLBuR6Mb0JDOOoFR6b40aXjUNGEy2tGm8hjbZ1M1STHQN/ 7LPsdhhdhSnbAqkk7xcFiRaOiOvis9hi4MYaXiBzJZIhnO0XEXSkOBzalWQAOFAHb/y1Zu2Hm oqQ3O+cvxWBoGMwLEsIy6drlKPwuuDKBG/yzJ1PAEWVfAn+7SfFi5fs1qu3LTOcut/4MQpXbc Y9HgUo1 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > 1. In Man-mode we have to add hook window-size-change-functions only > buffer-locally (using the arg LOCAL of add-hook) rather than globally, > because otherwise we can't remove this hook when a Man buffer is > not displayed anymore. I can't follow you here. Shouldn't we remove the hook _when_ a Man buffer is not displayed anymore. That is, when 'Man-window-size-change' detects that no Man buffer is displayed anymore, remove it from 'window-size-change-functions' and re-add it as soon as a Man buffer gets displayed again. > But the problem is that buffer-local > window-size-change-functions is called only when the current buffer > is in Man-mode. If it's not, it's not called even when resizing of > the current non-Man buffer causes the resize of a Man-mode buffer > in an adjacent window. > > 2. What if the same Man-mode buffer is displayed in two adjacent windows > side-by-side? I guess we need to find all windows with the same buffer, > compare their widths, and call Man-update-manpage only in the window > with minimal width. Also it seems window-size-change-functions is > not called twice for every window with Man-mode buffer, this is good. I think 'Man-window-size-change' will have to take care of such cases. Also we'll have to look into how 'follow-mode' works when displaying a Man buffer in several side-by-side windows. > 3. When windows are resized using the mouse, is it possible to call > window-size-change-functions only when the mouse button is released? > This will increase responsiveness. But the same problem will remain > for keyboard resizing with e.g. C-x } } } > A debounce-like function could help, but I can't find its Emacs Lisp > implementation anywhere. I mean something similar to > https://stackoverflow.com/questions/15927371/what-does-debounce-do > It's easy to implement using timers, but better to have idiomatic > implementation. I used a timer in 'mouse-autoselect-window'. It might be interesting to come up with a generic function. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 03 03:31:46 2018 Received: (at 32536) by debbugs.gnu.org; 3 Sep 2018 07:31:46 +0000 Received: from localhost ([127.0.0.1]:43562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwjKr-0008Qg-R5 for submit@debbugs.gnu.org; Mon, 03 Sep 2018 03:31:46 -0400 Received: from mout.gmx.net ([212.227.15.15]:57403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwjKo-0008QP-KB for 32536@debbugs.gnu.org; Mon, 03 Sep 2018 03:31:44 -0400 Received: from [192.168.1.101] ([46.125.250.51]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M1msU-1fdHXb062s-00tlUd; Mon, 03 Sep 2018 09:31:33 +0200 Message-ID: <5B8CE350.9010803@gmx.at> Date: Mon, 03 Sep 2018 09:31:28 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <87d0tvlegp.fsf@mail.linkov.net> In-Reply-To: <87d0tvlegp.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:EQE/gAl9cpdMTm4n+idkQ64NhXMyP6AhkKVHXVXDFLrekLjtCeb nH95FoXesRauSIq2C+yEJJAB+hWi1mi8CDayPq2y8UvqsRsNj3uttpP1XpQHa5FPZJzqARu DSyJ1uiXLs6HgJeQsGPLNjBU2127MA1oEDyBfI6lnev8cGNLryvCd5QZb4ed3ih8MRlRh2a pcqHrIPxXkh4C+c5Hulyw== X-UI-Out-Filterresults: notjunk:1;V01:K0:HTXtOblBAEo=:2J5h/zfVzMmY+ZF0vfwPTZ NEsABjXmMgoNPaoi7ScnW0B7LOSojeC6zkD1SI2hKgoX8HopGdJdFtj536OLezRo1aEh0rnCA 0NGD/xuzAHm6Mzda4gX6tJZMJ7HXZP9ZLUdFKj+ccC2UV5UHn9NoiSTfRKU/RXGBENZXyzoXX Lp7PY4BJcuqoNI65J4oB1NySNWq8L6BImFS90b+qyWqmE7h0e92KLB+SdUVSiWMniCm/oy5wp HdEWwfaFOTS9J1vyyuAY7VlFV359LNiEsGPCQc2u/Fi29fBSN/hXPjHQGi4GcYQWgLgeusuFx lOiXOJ8pZmd/VMZEp33vnh1nWyjOhlgJNne9XU7CoZJztzhHrTsKXnRkdakfTjG0RVGxZPmC1 9RB7qd4FJ0uZSNQtXr0wK17BgrBHSLQR4jlCbSKhU4BwPv4Y465u6w54qlCpqYySCzScUtTDf G5Z5+EHSVlnNGnWGFl4EHAQQn/FLr+NgbDYJFXtOxqksSZPn8laYXe78LboQfWgr8xCUnfdDj 1HZEUfc6qlXBU7JlyGkKWfYOSRNrpGyKUAikX+aF5DiFJJsigYe/AgORd7x8G3V+JQYItjawh R0TyqictCtXsKCY+a+en1z5iiu4y1TwyB2o5HQvW/YEOR7bnJZAHKgrwUy430zDYdXqWqi0x7 ceKPWiZvsBRj1eG13EjYXliLPVZgm4Bf7JwSJ4JgslZpWGJgxe3MoblSSABGb5XH+d6Z150r5 0HPgahph9ElbtWS/+OjPtRGPcgt/i8Bj2nruI8imXh7tVioE5PXuX3/2k9XDpaxv1kD2IiX+g lKZuZUw X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > Currently image-mode resizes the displayed image to fit into the window. > It can't do this when an image buffer is restored from the desktop file > and not yet displayed. You mean that after frameset has established a window/buffer association there's no way to inform image-mode about that? martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 03 14:20:56 2018 Received: (at 32536) by debbugs.gnu.org; 3 Sep 2018 18:20:57 +0000 Received: from localhost ([127.0.0.1]:44572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwtT6-0003Hn-N7 for submit@debbugs.gnu.org; Mon, 03 Sep 2018 14:20:56 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwtT4-0003He-MI for 32536@debbugs.gnu.org; Mon, 03 Sep 2018 14:20:54 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2CC2121B4E; Mon, 3 Sep 2018 14:20:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 03 Sep 2018 14:20:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=X2F9H/bQBlp5RQ89/lpY1uNgm+X76M1TLVfhKZP/rXs=; b=YK2FnA/8 4m2bth1bh/pYm/jaH+QwVfBAwguU+qjyFA95DuFyF709XyiWpqFECQmgJ6HzqYN1 mmQUimNx8F1MbYt7n0eJw1YyR8/6ZLsXUC4Y7P69lwUfH/GIYwyRrc31tMqzF0kv M4ua97Vd1dEPZK/kJYav2iAJ0khzNxvacqChzVyLlLsugICCgq9VXaYnIExCDsER ee2+NW8/+oSglZccRuUpLDi1pp/VbXIg5wyQJQKFYERW8xfzwhZCUZKj8UfRiNnZ NFKLPIvcjuT4AsD6WvOS2YCv4dTKXsRu9ziUFp7rbN0VYtPPjkEbtSa+YKOKA4Rk EXNKdmeRfClVzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=X2F9H/bQBlp5RQ89/lpY1uNgm+X76 M1TLVfhKZP/rXs=; b=fIl+kZ7UUxTIlElM1vJaAhmi+r1RBDJg4EW4q6WPbykBx TLCeDKN/X15LQvpAGtmbwyWBsYb0aJhi9LEyAnP3biTrQp11tvQbTi3pNl5ByP6E zvXbNIgu2QuLypPp4cHNomIz0XcDjIxGZAOUaCOynxN+F+RN9LPe3vDRjdnkuqRD Tk9ALECXYaYRgnkHIsibGQ9RoR7M6xwx7LlxolvwCXchdWCw4g8V6X9S4wGEjbrl X2DbJnFI7bUnieULMEC62yBpYmTJn3IUQ6bAiHUyoY/aV7CBlg4O7hg9Yac/PJxS SUgDVitEtzYA47gTeGaJQNToNdj815FF+cKk4osSg== X-ME-Proxy: X-ME-Sender: Received: from fgunbin.playteam.ru (unknown [94.25.218.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 9E8BEE40D1; Mon, 3 Sep 2018 14:20:52 -0400 (EDT) From: Filipp Gunbin To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <87d0twam5z.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Sep 2018 01:27:20 +0300") References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) Date: Mon, 03 Sep 2018 21:20:50 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org, hw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi, On 02/09/2018 01:27 +0300, Juri Linkov wrote: > + (let ((width (cond > + ((and (integerp Man-width) (> Man-width 0)) > + Man-width) > + (Man-width > + (let ((window (get-buffer-window nil t))) > + (frame-width (and window (window-frame window))))) > + (t > + (window-width (get-buffer-window nil t)))))) > + (when (and (integerp Man-width-max) > + (> Man-width-max 0) > + (> width Man-width-max)) ^^^^^^^^^^^^^^^^^^^^^^ this check is not needed, as you call min in the next line > + (setq width (min width Man-width-max))) > + (setenv "COLUMNS" (number-to-string width)))) From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 03 18:45:09 2018 Received: (at 32536) by debbugs.gnu.org; 3 Sep 2018 22:45:09 +0000 Received: from localhost ([127.0.0.1]:44717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwxan-0001UJ-8a for submit@debbugs.gnu.org; Mon, 03 Sep 2018 18:45:09 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:41782 helo=pdx1-sub0-mail-a22.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwxal-0001UB-NP for 32536@debbugs.gnu.org; Mon, 03 Sep 2018 18:45:08 -0400 Received: from pdx1-sub0-mail-a22.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a22.g.dreamhost.com (Postfix) with ESMTP id 7CC8F7F0BB; Mon, 3 Sep 2018 15:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=lP3wSYNibHDs6K+YF6AHjpYA2Ak=; b= MIzaZWr+XlDDlEgPrdI8LlhvslJoBorHDxCXTqLuZaxnzQ4fcB7JUaX6qAGYfNrl CpuZi7ifE0UEP0yfw70TBrhV/u2s98J9hfdbxSSX/Idc0eKWAHvWixSYPTu8+CtX PyAG/hzK08Vf7idmywBxslGl+w0yO0h4ooXQa8HWj8Y= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a22.g.dreamhost.com (Postfix) with ESMTPSA id 4B1727F30A; Mon, 3 Sep 2018 15:45:05 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> Date: Tue, 04 Sep 2018 01:23:16 +0300 In-Reply-To: <5B8CE346.60809@gmx.at> (martin rudalics's message of "Mon, 03 Sep 2018 09:31:18 +0200") Message-ID: <874lf6usob.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 1. In Man-mode we have to add hook window-size-change-functions only >> buffer-locally (using the arg LOCAL of add-hook) rather than globally, >> because otherwise we can't remove this hook when a Man buffer is >> not displayed anymore. > > I can't follow you here. Shouldn't we remove the hook _when_ a Man > buffer is not displayed anymore. That is, when > 'Man-window-size-change' detects that no Man buffer is displayed > anymore, remove it from 'window-size-change-functions' and re-add it > as soon as a Man buffer gets displayed again. How to know the moment when a Man buffer gets displayed again? Is there a corresponding hook for this event? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 03 18:45:12 2018 Received: (at 32536) by debbugs.gnu.org; 3 Sep 2018 22:45:12 +0000 Received: from localhost ([127.0.0.1]:44720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwxaq-0001UZ-Fl for submit@debbugs.gnu.org; Mon, 03 Sep 2018 18:45:12 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:41804 helo=pdx1-sub0-mail-a22.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwxap-0001UR-EW for 32536@debbugs.gnu.org; Mon, 03 Sep 2018 18:45:11 -0400 Received: from pdx1-sub0-mail-a22.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a22.g.dreamhost.com (Postfix) with ESMTP id D9C6A7F322; Mon, 3 Sep 2018 15:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=fydhSf2UDWx//WudTH5gXxS4R8I=; b= frariTHTepmoe8MT7AVddrUFNwjjB63SBO3gKR41/u9MESB7y6mW1b38mLsBJ6xf YQExE5xm/0lZRj7ZpamocAFFhAhoz2muL0f48hD22PysNmP1Bv9ULOnPxdn6Isop ZlkpTUtsKil9PNFZ5Mda/Vdxuew6tFz97oukoXbJc48= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a22.g.dreamhost.com (Postfix) with ESMTPSA id A91627F316; Mon, 3 Sep 2018 15:45:09 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <87d0tvlegp.fsf@mail.linkov.net> <5B8CE350.9010803@gmx.at> Date: Tue, 04 Sep 2018 01:25:51 +0300 In-Reply-To: <5B8CE350.9010803@gmx.at> (martin rudalics's message of "Mon, 03 Sep 2018 09:31:28 +0200") Message-ID: <87ftyqtdzk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Currently image-mode resizes the displayed image to fit into the window. >> It can't do this when an image buffer is restored from the desktop file >> and not yet displayed. > > You mean that after frameset has established a window/buffer > association there's no way to inform image-mode about that? image-mode can fit the image to the window sizes only when the image buffer is displayed in a window. Is there a hook that is called when a buffer is displayed in a window? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 01:46:30 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 05:46:30 +0000 Received: from localhost ([127.0.0.1]:44805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx4AY-00048Z-0o for submit@debbugs.gnu.org; Tue, 04 Sep 2018 01:46:30 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.221]:14817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx4AW-00048Q-4Q for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 01:46:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1536039986; s=strato-dkim-0002; d=adminart.net; h=References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=dZlkPBTBV3TeAmDhwIdbuRawADBG9UjWdd3o0Bkb0AI=; b=WX5fN1PkYRH5yWDbF107nnFqYKT05FzVgCjnx5839My26GOmqVcRKkn3R/RPkR6R9c CWGs4YT+1DUxKdSznxtw54xmmGnR7q7MMIkJTkIRcRUr0+i6x+zaYIkUGZlXe5TKqcVk S6FTpfEpmmnvpLRxwoU38mshySGwokJ66fjGSzTmCmyeft+b+9rPQD/pLtgF95aX5BeT ZLeYRWVWo93eLq/2EHy9STqnzRVhLjA2fHlAzIR61iavExJ3bdB5zleJB/O8j8eS2SSt 3RePeP0IJekM77LSh5q09Yo9jic2T5CVsqtZVlqS+LdxVoVn1KFxrrY/hPv+RKJH815W Bdnw== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 43.21 DYNA|AUTH) with ESMTPSA id j020b1u845kNJr3 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 4 Sep 2018 07:46:23 +0200 (CEST) Received: from toy.adminart.net ([192.168.3.55]) by himinbjorg.adminart.net with esmtp (Exim 4.90_1) (envelope-from ) id 1fx4AR-0001m0-70; Tue, 04 Sep 2018 07:46:23 +0200 From: hw To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <875zznmtud.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 03 Sep 2018 01:12:58 +0300") Date: Tue, 04 Sep 2018 05:34:58 +0200 Message-ID: <87o9deorz1.fsf@toy.adminart.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <87pnxwgd9e.fsf@himinbjorg.adminart.net> <875zznmtud.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> Perhaps if they /can/ be reformatted dynamically, have a variable like >> `Man-dynamic-reformat-lines-max' so users can prevent the reformatting >> for instances in which it takes too long. > [...] >> Would it be possible to do the reformatting in the background, and >> delayed, like fontifying a buffer? > > Man pages are already formatted asynchronously in the background, > so actually reformatting on window resize should be quite responsible > even for large manuals (maybe an addition flag is needed to prevent > updating when a previous update is in progress). and maybe something that prevents multiple update requests piling up while the window is being resized, unless the flag already takes care of that > You can try and see how fast it reformats, typing repeatedly the key `u' > (Man-update-manpage). Ah, hm, ok, that's maybe 0.25 seconds for the man page of fvwm with 9441 lines. It may not be a good test because the width does not change in my case, and I have fast hardware. Is there a reason for not to skip such an update when the length of the lines did not change? I didn't know you could update; this is like perfect because who prefers dynamic updates can use those and who doesn't can use `u' if need be :) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 01:46:33 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 05:46:33 +0000 Received: from localhost ([127.0.0.1]:44809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx4Ab-00048p-9R for submit@debbugs.gnu.org; Tue, 04 Sep 2018 01:46:33 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.25]:22149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx4AZ-00048h-Pa for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 01:46:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1536039991; s=strato-dkim-0002; d=adminart.net; h=References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=5aRmG1MMuw5V4g9JMAIDkmuD4bWkKe/bW4AJN4a/YDo=; b=iySXb2DfNjmApnkc3KKROIjWelBbx2d7k2grA7XhItHnwIZk8LsTtiyknOOkD0pKgG 7Q/wENO7ictFFJKe18XzHsCh8VzljDdpqqWuLmG0k5bjOwIEQUiW5Xhj7/v+x1hz9Xiu w5HczeLUQOBZk38ZB46W0XCGmryVSL47FaqJVhqx5T671jZSQnGApynQstZkgKVmi6n4 uj2TuYeFtFyRz/7R79OKm4LY21LSoV3PncAxy5UhYyRs0shCkCM4wffjybLX0nvXs7cK aXtxB8G32DPYRtWOyOHm8/386x4j952YCEMt2nE7Lm5+PU/73eVIkqDKWByF4EU/QvSf hxuQ== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 43.21 DYNA|AUTH) with ESMTPSA id j020b1u845kTJr5 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 4 Sep 2018 07:46:29 +0200 (CEST) Received: from toy.adminart.net ([192.168.3.55]) by himinbjorg.adminart.net with esmtp (Exim 4.90_1) (envelope-from ) id 1fx4AW-0001m4-Fy; Tue, 04 Sep 2018 07:46:28 +0200 From: hw To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <8736urmtjs.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 03 Sep 2018 01:19:19 +0300") Date: Tue, 04 Sep 2018 07:46:09 +0200 Message-ID: <87k1o1q0v4.fsf@toy.adminart.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>> Regarding the request for dynamic reformatting, I'm not sure if >>> man pages should be reformatted on resizing windows (I remember >>> seeing a window resize hook, but can't find it now). >> >> It's called 'window-size-change-functions'. > > Thanks, I tried window-size-change-functions, and it works pretty well > with the patch attached. But there are a few problems: > > 1. In Man-mode we have to add hook window-size-change-functions only > [...] > > 2. What if the same Man-mode buffer is displayed in two adjacent windows > side-by-side? I guess we need to find all windows with the same buffer, > compare their widths, and call Man-update-manpage only in the window > with minimal width. Also it seems window-size-change-functions is > not called twice for every window with Man-mode buffer, this is good. How about a couple rules to make this simple: A manual page should not be updated when + the size, or a change of the size, of a window displaying it does not require a change of the length of the lines + the desired length of the lines can not be determined. Creating another window to display the same or a different buffer does not require a change of the length of the lines. Using multiple windows of different widths to display the same buffer means that the desired length of the lines can not be determined. When considering the width of each window displaying the same buffer, or any buffer, leads to the same length of the lines, a length has been determined. This may be the desired length of the lines for Man-mode buffers or not. Above rules mean that you can ignore 1.. Just note this in the documentation so it becomes understandable why the buffers in Man-mode are dynamically updated the way they are. When someone has a good idea how to figure out the desired length of lines under all circumstances, they can always make a suggestion. BTW, what is the default for the minimum length of the lines? Is the default for the maximum length the same? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 03:51:48 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 07:51:48 +0000 Received: from localhost ([127.0.0.1]:44970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx67o-0007HA-21 for submit@debbugs.gnu.org; Tue, 04 Sep 2018 03:51:48 -0400 Received: from mout.gmx.net ([212.227.15.18]:35765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx67m-0007Gv-Kd for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 03:51:46 -0400 Received: from [192.168.1.101] ([213.162.73.179]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LpKKr-1fRb801u7B-00fEss; Tue, 04 Sep 2018 09:51:37 +0200 Message-ID: <5B8E3983.8040808@gmx.at> Date: Tue, 04 Sep 2018 09:51:31 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> In-Reply-To: <874lf6usob.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:27d+4uHJoxjDnJXNGUg61nxaMZCiVsK5VTsPHEy3AmsViufdx4L ffHX0YCli+lnz+78Zoc0h9Iv/Wl6HcVkhypoTcgojQJYH++YKqdtG9BQnRP/y6niCcULSUZ kZSIxST5LjlIpvJxWTVTXHs7TiYh+skWK3K48VaaNR1hE5kyG/Qlco4Pm4xkjy7PHKFVCTK x+hbWCzGoAyVDy0Vul6UA== X-UI-Out-Filterresults: notjunk:1;V01:K0:be210SXqfPA=:YeF9v51DUSnhfze48HsNtP YpHFgysueAiuTZj2/QreKKSYVDjr+cwkGKu89UB17lrd9NqJ5TNBA4Z/LOsbW6WRPr483Ehbl 5rBJecGGMflge1pIoyf8dP4WadtrTyh2M56UnlqHUfyRkWKPfOp8J9VReKiidB+YqoH+o+7PF mlX2GmjHs3TB+OSgHSmWq7TZoVNKbIuimCv+T5fJA65hrLorb2QaKUJJeLuQ5v7uJ6ONp0YjM ZvcZz9DqyBubRqyw6HWA1ApF1U8IHOMUDCRodAOLn90g1OwVk+bRq01aBeyVmBosMU9vBsWCa FYT61GZKI8eyxVJSyADAmFD5ataj09j+/P8qPY4GHLBnsllPSwEHw7RIO4JAxv8rutgegmwLC 216ZL90vXp8wVd95iV1M7P87D1Q8JZv8JfGFPQBJ31sGTU5v2p/ts0GFDG1EJ/m3w1BURMTVK GZTDfkiefkeNrpxrdaeVPEjOWqOVRM0yYgJZE2pxU0cvjB5PmZhDae5erzRE9Bp7gLTWEeZUA qVuVobCkdh1Z4XZb+jEVkHTnApX1+tXTYUQjIiVVarerjtk/yX7LJ90G2icNaRjQppR/CO+8V K4YiQ7klWdndSVUuoDswYNYQzTdy4ndyCOCJqB5CXY1MTtRnx9A7xA6T9wuPVwZGRGPc1vZrY eu4LnjLFuNtBHF4zP2z9q46RFlQ1YZGG4mZhC6v2RMzryORTVMSQ1e59Oumz+4ciW4DlhXrmq vcO5yVvFGYegqw9rk7VbnDXoIyHWw7IUMacFCBMjIMJN9yTLUwgeinuEIdxE0hn1hQKtAa/e4 /mvWjZQ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I can't follow you here. Shouldn't we remove the hook _when_ a Man >> buffer is not displayed anymore. That is, when >> 'Man-window-size-change' detects that no Man buffer is displayed >> anymore, remove it from 'window-size-change-functions' and re-add it >> as soon as a Man buffer gets displayed again. > > How to know the moment when a Man buffer gets displayed again? > Is there a corresponding hook for this event? 'window-configuration-change-hook' I presume. Though this raises the question how to remove anything from there when finishing browsing. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 03:51:54 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 07:51:54 +0000 Received: from localhost ([127.0.0.1]:44973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx67u-0007HV-9r for submit@debbugs.gnu.org; Tue, 04 Sep 2018 03:51:54 -0400 Received: from mout.gmx.net ([212.227.15.19]:49969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx67t-0007H9-6d for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 03:51:53 -0400 Received: from [192.168.1.101] ([213.162.73.179]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lk7T8-1fLHT80Cp0-00c5Rv; Tue, 04 Sep 2018 09:51:44 +0200 Message-ID: <5B8E398A.3060700@gmx.at> Date: Tue, 04 Sep 2018 09:51:38 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <87d0tvlegp.fsf@mail.linkov.net> <5B8CE350.9010803@gmx.at> <87ftyqtdzk.fsf@mail.linkov.net> In-Reply-To: <87ftyqtdzk.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:+7JR9nLH/9pFHGYm+2ApziGq7KRvAJD4unFaQmFISB3Z2VUPWO+ A63VHvf78DyndlOxLrSUXF4W3Yz2cRy2t3ueJg2lJO+7s6EHHe/YxdLm9u+WnTbQipZ3KZ5 aDfhfxXBAlu3Qj/UM9FObVqlIfepR2EeVGBsM9bLrXI9DRoqcZD6AiGlpY/NvRTnFmt+eA1 EZSR1MfRkVUIW/pyAYwKA== X-UI-Out-Filterresults: notjunk:1;V01:K0:+BbjWOWby0U=:x1Z+V+EZsSREZT5COctDuI 0L3VNueEv0coH2hOJ16FtbklHZX6h4dsIlaaz07qre1n/QEXqnT0w0YRMWMTPvNnr6nRuM+8Z Xbk9xOaAYsH+d2+gcaHiCrcLhff+2nA/o9PralRLaK3jbUho1C/TzigHnnnOPKahOHHFtmI95 VB46LTP/qqDs2DtwaZTUV3n2kG9UqJS6VppvGrFKpigAPva+I3rCmy8b8J74IpXCCGnd79cD/ lwrbBCMJ7wYJaQ74y9inaGYQ1F2R6szGh11f3NoLwgklsZvxG+onMVO5A0DfqfjM49B+yBN6L SgFHDDzwKy+BxQ7GI8MlU795sME4/g58EDN+79O/ghkpiYV31a2+PG+SZsNzA7A9hMszYetRx GmPCXC5cgLjhHx62llRJrSD1jg2FKSiXK2u0N+QC7kdAqsdZQFueDtExV1jQdgvnEUnbLzI9w oIqDCQIg+MAbzp1DVIE9SGE/++mQSG6M7ruu46i8q50GdmcyFzkgx0+xPAZNgbSCclzc028Bg xXRcYFWgwnltiAq2YcUP23AaH9Ku9RlUFr8Ki6bV3H+UgAh6dXIjj1IKtB99XCOdXpz6kHojC NxWfXuKoMR3JHiFMmNS0FtXcYNKmLR3wIo4q5TbBtx+qCpWxrhcADFiR9j/aQpHv63lLxSw86 g4bTgwqrS/OGwQ2Ort+Nmz8Wdeu35HMzRL37mZE16FCw4F+xeAYWpgq914tKa0UCcDKoU3zIW EHHuqsix41M8Oz3J5lNAiotOuzvQ/U1AnyYHXMzS0j/B3w7iNlBmp7V5jj0pEMux+0O6EAgxf 8cZ404K X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > image-mode can fit the image to the window sizes only when > the image buffer is displayed in a window. Is there a hook > that is called when a buffer is displayed in a window? 'window-configuration-change-hook' traces the case where a different buffer is displayed in a window. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 17:25:19 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 21:25:19 +0000 Received: from localhost ([127.0.0.1]:46056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxIp4-0003qR-Uj for submit@debbugs.gnu.org; Tue, 04 Sep 2018 17:25:19 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:51954 helo=pdx1-sub0-mail-a1.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxIp3-0003qJ-6Q for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 17:25:17 -0400 Received: from pdx1-sub0-mail-a1.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTP id 48F7E7EAE7; Tue, 4 Sep 2018 14:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=I/qRSuqPTYGVxSbrMWsL6A5Reqo=; b= k5XSxKe6pLDtxec6sYmkhctT+ZZbCbbZQh+GG06KqZkOb8yp6JSjxkHlHlbDiQGM Eb5OmdPx2l1Ls3tw/mpdBr7eS+DN528TEaidxe3atQfBmUZO+v+YoIvk5aJ47jeu XgpUtahte917+ObF4xQjmUquckkdNlpR+QqXx5v/Quk= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 29FC97ED83; Tue, 4 Sep 2018 14:25:14 -0700 (PDT) From: Juri Linkov To: hw Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <87k1o1q0v4.fsf@toy.adminart.net> Date: Wed, 05 Sep 2018 00:20:42 +0300 In-Reply-To: <87k1o1q0v4.fsf@toy.adminart.net> (hw@adminart.net's message of "Tue, 04 Sep 2018 07:46:09 +0200") Message-ID: <87a7ox9cyd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > BTW, what is the default for the minimum length of the lines? Is the > default for the maximum length the same? Like the new Man-width-max, we could also add Man-width-min as well. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 17:29:38 2018 Received: (at 32536) by debbugs.gnu.org; 4 Sep 2018 21:29:38 +0000 Received: from localhost ([127.0.0.1]:46068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxItF-0003yL-71 for submit@debbugs.gnu.org; Tue, 04 Sep 2018 17:29:38 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:52558 helo=pdx1-sub0-mail-a1.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxItD-0003yA-3s for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 17:29:36 -0400 Received: from pdx1-sub0-mail-a1.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTP id 5A3FE7ED83; Tue, 4 Sep 2018 14:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=SOlqlPT/AE44hlTYy8CbCDn1Fxg=; b= Vg4Fw7MzgeaAqohRFvijz7neTS0c3zTjFlbwjpZ5O1O4gELQu9gHmCHHESXLpGsE 2V0MeTwj/jaNLYdom8Lt3LyU0PtXMDhS7NgD8BJ1shTlEV7b84zCRKkjdpgzqmPA 0CSkOEIQxUgFoUSbVOjVmFdlnfFosJKbwDklqPb5RTg= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 78A857ED8A; Tue, 4 Sep 2018 14:29:32 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> Date: Wed, 05 Sep 2018 00:27:43 +0300 In-Reply-To: <5B8E3983.8040808@gmx.at> (martin rudalics's message of "Tue, 04 Sep 2018 09:51:31 +0200") Message-ID: <875zzl9cmo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> I can't follow you here. Shouldn't we remove the hook _when_ a Man >>> buffer is not displayed anymore. That is, when >>> 'Man-window-size-change' detects that no Man buffer is displayed >>> anymore, remove it from 'window-size-change-functions' and re-add it >>> as soon as a Man buffer gets displayed again. >> >> How to know the moment when a Man buffer gets displayed again? >> Is there a corresponding hook for this event? > > 'window-configuration-change-hook' I presume. Though this raises the > question how to remove anything from there when finishing browsing. Using window-configuration-change-hook is a hugely cumbersome workaround for deficiencies in window-size-change-functions. I reported this in bug#32637, please see there. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 22:51:24 2018 Received: (at 32536) by debbugs.gnu.org; 5 Sep 2018 02:51:24 +0000 Received: from localhost ([127.0.0.1]:46209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxNud-0007ZP-JI for submit@debbugs.gnu.org; Tue, 04 Sep 2018 22:51:23 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.219]:20097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxNua-0007ZC-Ds for 32536@debbugs.gnu.org; Tue, 04 Sep 2018 22:51:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1536115879; s=strato-dkim-0002; d=adminart.net; h=References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=ZPnKf670ZiF3m9JzKAvy9pgU+XIRmsWQcNqDW06dh5c=; b=sMEUPlt64o/rFbVwJ4ZNEaBPPUywnLvaMPX9MipUvHcKS7QjA2pop8sliF3pdhVe6y q0pFvnI8bpA86t+MLqwVzwPMn+UXpZMcTgpcimwkXrfUFtjJrrU3hnxeFB6D1VQAD+gX 91U6lWclgKNJLDox6KpmCruiv4uQZRnlIlF0+07i7+VdTel5KuBRCGR9m3J76dOHhkRU aVttii9Mg1ja5LgD0rIvmh3YGWPEh/zKB7sGP5x/5pH3tPXFTZmU+GKbQHVI9SA1SB64 Klwfx0RRNoNCRACF5aYo0Uz9Oo7BbvaIf0+b/1AGTvqef2NfTXG7NtA7w7tkEdJRhlbE G89w== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 44.0 DYNA|AUTH) with ESMTPSA id e03b99u852pG1vT (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 5 Sep 2018 04:51:16 +0200 (CEST) Received: from toy.adminart.net ([192.168.3.55]) by himinbjorg.adminart.net with esmtp (Exim 4.90_1) (envelope-from ) id 1fxNuV-0000nR-Fc; Wed, 05 Sep 2018 04:51:15 +0200 From: hw To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <87a7ox9cyd.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 05 Sep 2018 00:20:42 +0300") Date: Wed, 05 Sep 2018 04:50:29 +0200 Message-ID: <87tvn43cjp.fsf@toy.adminart.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <87k1o1q0v4.fsf@toy.adminart.net> <87a7ox9cyd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: >> BTW, what is the default for the minimum length of the lines? Is the >> default for the maximum length the same? > > Like the new Man-width-max, we could also add Man-width-min as well. I thought the line length would be determined depending on Man-width, the new maximum width and the width of the window displaying the buffer. That would make Man-width what specifies the minimum length: If the width of the window suggests using a line length between Man-width and the new maximum length, use the suggested length. Otherwise use Man-width if the window is narrower than that, or the new maximum length if the window is wider than the new maximum length. Renaming Man-width to Man-width-min would make sense then, unless there were a third option: Always use the line length specified by Man-width. If this option would kick in when Man-width-min and Man-width-max are not set, the behaviour would not change for anyone who has set Man-width. The default for all of them would be nil, assuming that Man-width-min and Man-width-max do nothing when they are nil. BTW, how come that describing Man-width says it is not documented as a variable before man-mode has been active at least once, but its value is known (as the value I set it to), and later used? It seems unsave being able to set arbitrary variables and having their values quietly accepted without question by functions that are eventually loaded and which the value of the variable may not have been intended for. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 05 03:47:53 2018 Received: (at 32536) by debbugs.gnu.org; 5 Sep 2018 07:47:53 +0000 Received: from localhost ([127.0.0.1]:46322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxSXZ-0006QI-EB for submit@debbugs.gnu.org; Wed, 05 Sep 2018 03:47:53 -0400 Received: from mout.gmx.net ([212.227.15.19]:49075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxSXY-0006Q3-7q for 32536@debbugs.gnu.org; Wed, 05 Sep 2018 03:47:52 -0400 Received: from [192.168.1.101] ([46.125.250.92]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MDhba-1g6qzx0bRW-00H6sQ; Wed, 05 Sep 2018 09:47:43 +0200 Message-ID: <5B8F8A17.10607@gmx.at> Date: Wed, 05 Sep 2018 09:47:35 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> In-Reply-To: <875zzl9cmo.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:4J1JihyFdhfa3Cz/fBKGN6OtIodc20cVrG57HDz66gJdPD/N8VS vLaLRhPOUh4ZPAEDMCFfVhv/0+KE1Eg4bBELYipGgOkhIS2hLHvmmYZYP/6Wzo1a1eei5a4 uJbnVfeSOByYbweBFATzmI3XwEU/70MUgeyT5vhYvsUf0vGoaUSADr68ySoMfe5Ojn2gjLG iAbFGZcKlZ9luH/vP9yLQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:SXqjHDliTZI=:PpM5OForPCz8pHbUsRsy3v q3oWW3PAWZB7LQlMiclsGZEX2VKYvGf9LjMWN5n/cLBLt3s07VVco2iz5YAEJ5BPR2HOoQvhr O+yjxZWUgCAJN/juAz1dLLhdzWTuui3yTw0e5lKlnGVG3F58mIVW4VH4WM/Xvn1yvQiBmKYil tbqpZ8Htl44GbMKTmq0TSE+nham9lkrIAVYMknffT0kIQoX0eSlI/kr7StRw0Srl3Rx+yB/w1 X7Z7lGWS8kihLHy+kdxKc965aR2Dy4BzqIM75W+z83hFNbMIZc+ZGnzDb/ZBEeSEJpXxmzOpZ irCg0qwoz+vRiCYCy8cUdPrP1HedwpUIcoiG0Ap0KgYFIGqw8r9gPZyihYzOhGL7Nj3OFebKU FIrm0thQeiuYnno+PJVzWOR5txo+4mHPl5RTtgfaxFyphuI3lMQHQ+E8wUUOSgQ7POTrbKyLP QYodUGiPFPkIV4+5fFJ8KfCz6DYfcmet9T1l9OSV+UgVVhPyQ+6Jr3iLVucORdaXtox4Y97vN boB4nx2b2EVpT5LRVc9IwhtjRAl+muu3ev2glSaNxi2IsRYoChzWq5gC0wixNAc0ofavIwyMm TAN7v7f4xSXx/3ncJX+4skWHmdF1X76488pNAwADyIsVSf1lx0IlbmUzpnEeK6TpfJCNk9zFk 0w/V3PkuuiuLt/lQQJuuHRCwHuSWKbAbON85g0e/g7UcEeGKQLm1lv/CtlxKxw7yDZNGWxutk MjsqVDlm7YOND06xQGQ9YZz+hd8KUYwUELQVT+y+1hhe7D8THk/1SViNEpo1VAUEfpTM8q46/ ne3HlbV X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 32536 Cc: hw , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > Using window-configuration-change-hook is a hugely cumbersome workaround > for deficiencies in window-size-change-functions. But you want to track whether a window changes its buffer. How does this relate to 'window-size-change-functions' at all? martin From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 05 18:23:27 2018 Received: (at 32536) by debbugs.gnu.org; 5 Sep 2018 22:23:27 +0000 Received: from localhost ([127.0.0.1]:47478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxgCt-0002Zr-Hq for submit@debbugs.gnu.org; Wed, 05 Sep 2018 18:23:27 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:50010 helo=pdx1-sub0-mail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxgCr-0002Zj-U2 for 32536@debbugs.gnu.org; Wed, 05 Sep 2018 18:23:26 -0400 Received: from pdx1-sub0-mail-a17.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a17.g.dreamhost.com (Postfix) with ESMTP id 1B3CE7FD07; Wed, 5 Sep 2018 15:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=tUOag3VVAxus6CfxMchQweAOvYk=; b= kHThx5QKfu1tv6HG2jhrTHfBM9qjKZTPVccr4z2Fc10Q3dnyeEENREPdqNxwm9cu 2oz3j4+bJZB06lyZR1BRyH2L4+54ws/qhnSdULU/ji5P2vuBxkLaNnauaXCv+J8K BaRY+aStfvZlN3TNG8EFS6ZlWOP/ED+WjCkiC/uyVao= Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a17.g.dreamhost.com (Postfix) with ESMTPSA id 051A87EA49; Wed, 5 Sep 2018 15:23:22 -0700 (PDT) From: Juri Linkov To: hw Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <87k1o1q0v4.fsf@toy.adminart.net> <87a7ox9cyd.fsf@mail.linkov.net> <87tvn43cjp.fsf@toy.adminart.net> Date: Thu, 06 Sep 2018 01:20:12 +0300 In-Reply-To: <87tvn43cjp.fsf@toy.adminart.net> (hw@adminart.net's message of "Wed, 05 Sep 2018 04:50:29 +0200") Message-ID: <874lf3y4bn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> BTW, what is the default for the minimum length of the lines? Is the >>> default for the maximum length the same? >> >> Like the new Man-width-max, we could also add Man-width-min as well. > > I thought the line length would be determined depending on Man-width, > the new maximum width and the width of the window displaying the buffer. > That would make Man-width what specifies the minimum length: > > If the width of the window suggests using a line length between > Man-width and the new maximum length, use the suggested length. > Otherwise use Man-width if the window is narrower than that, or the new > maximum length if the window is wider than the new maximum length. > > Renaming Man-width to Man-width-min would make sense then, unless there > were a third option: Always use the line length specified by > Man-width. If this option would kick in when Man-width-min and > Man-width-max are not set, the behaviour would not change for anyone who > has set Man-width. > > The default for all of them would be nil, assuming that Man-width-min > and Man-width-max do nothing when they are nil. The value nil of Man-width means to dynamically calculate the line length from the width of the window displaying the buffer. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 07 10:42:02 2018 Received: (at 32536) by debbugs.gnu.org; 7 Sep 2018 14:42:02 +0000 Received: from localhost ([127.0.0.1]:49749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fyHxS-00085F-4f for submit@debbugs.gnu.org; Fri, 07 Sep 2018 10:42:02 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.52]:22918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fyHxQ-00084q-FL for 32536@debbugs.gnu.org; Fri, 07 Sep 2018 10:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1536331319; s=strato-dkim-0002; d=adminart.net; h=References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=zripXyIg6hOO+mdnPsFqI1ZjAFckZr3Y+bUUBLtVF1U=; b=ArJZbNvpRvrv1tX6fsRow/vS0EFKqDQAWBc8Lq+FtVG95Wb8iimocpTlqDm3Wcq1K9 pvl9YPPbzc7y+DW9foioWrgq+ZG13c0JjVV3JxTRKXBBCEGxpXTs+eSajJkNAdgXnb2P c9qV4cMzgbMmg5IoTIM70lpGM0pJAqzg7wrW/p1quR6URfL3dtvUtE7S32S8WuObyfRE f07+xVSzgy1yHbHijHRf89rAQllGfTHtbBlHjV+ByY9CcIBQzme+YYI3OUk2qF++JazF VCujUL/l+kn7VUplI6HI8IYC2lPlSovTHeb5Ay+s6//pg1wtwS8aavbCSnWulrTzJW89 36lQ== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 44.0 DYNA|AUTH) with ESMTPSA id e03b99u87EftCgM (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 7 Sep 2018 16:41:55 +0200 (CEST) Received: from toy.adminart.net ([192.168.3.55]) by himinbjorg.adminart.net with esmtp (Exim 4.90_1) (envelope-from ) id 1fyHxL-0000yD-BJ; Fri, 07 Sep 2018 16:41:55 +0200 From: hw To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages In-Reply-To: <874lf3y4bn.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 06 Sep 2018 01:20:12 +0300") Date: Fri, 07 Sep 2018 16:03:46 +0200 Message-ID: <877ejxqu9p.fsf@toy.adminart.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <87k1o1q0v4.fsf@toy.adminart.net> <87a7ox9cyd.fsf@mail.linkov.net> <87tvn43cjp.fsf@toy.adminart.net> <874lf3y4bn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics , 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>> BTW, what is the default for the minimum length of the lines? Is the >>>> default for the maximum length the same? >>> >>> Like the new Man-width-max, we could also add Man-width-min as well. >> >> I thought the line length would be determined depending on Man-width, >> the new maximum width and the width of the window displaying the buffer. >> That would make Man-width what specifies the minimum length: >> >> If the width of the window suggests using a line length between >> Man-width and the new maximum length, use the suggested length. >> Otherwise use Man-width if the window is narrower than that, or the new >> maximum length if the window is wider than the new maximum length. >> >> Renaming Man-width to Man-width-min would make sense then, unless there >> were a third option: Always use the line length specified by >> Man-width. If this option would kick in when Man-width-min and >> Man-width-max are not set, the behaviour would not change for anyone who >> has set Man-width. >> >> The default for all of them would be nil, assuming that Man-width-min >> and Man-width-max do nothing when they are nil. > > The value nil of Man-width means to dynamically calculate the line length > from the width of the window displaying the buffer. Yes, I suggested this because it would not change the current default behaviour. If you want to change the default behaviour, I'd suggest 70 for Man-width-min and 80 for Man-width-max. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 25 16:10:11 2018 Received: (at 32536) by debbugs.gnu.org; 25 Nov 2018 21:10:11 +0000 Received: from localhost ([127.0.0.1]:47656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gR1fP-0008RW-KH for submit@debbugs.gnu.org; Sun, 25 Nov 2018 16:10:11 -0500 Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:19375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gR1fO-0008RM-IF for 32536@debbugs.gnu.org; Sun, 25 Nov 2018 16:10:11 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 73DCD12478F; Sun, 25 Nov 2018 21:10:09 +0000 (UTC) Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.11.179]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2F70C124796; Sun, 25 Nov 2018 21:10:09 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a3.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 25 Nov 2018 21:10:09 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Duck-Inform: 164ab60a3a7637bf_1543180209279_1883506432 X-MC-Loop-Signature: 1543180209279:3945073761 X-MC-Ingress-Time: 1543180209278 Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id 4D3E08105D; Sun, 25 Nov 2018 13:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=uY/wXtzG51WMv8crpuRoTkedsBM=; b= o3NraxfipjTmPEBK+ViMcsLJLhxKXXuecI1hZiT1dKt47i2AatHocoy3FL7wGs13 EnJ5EZMcjPP5Fp5o9ak4JRv0+Od79qPA1mqffl4dr+EcGmt+yMER5Yg+umW3YEAg X05el2HTTK0FwqfGWOILFlPmufrqbC1J3VFlXQeK4tA= Received: from mail.jurta.org (m91-129-107-242.cust.tele2.ee [91.129.107.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTPSA id 0CAED81057; Sun, 25 Nov 2018 13:10:05 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a3 From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> Date: Sun, 25 Nov 2018 22:42:02 +0200 In-Reply-To: <875zzl9cmo.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 05 Sep 2018 00:27:43 +0300") Message-ID: <87zhtwanil.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudduhedgudeglecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrvdegvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddvgedvpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedu X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I reported this in bug#32637, please see there. Thanks to Martin, a request in bug#32637 is now implemented and closed. But still this bug#32536 can't be closed because I found an insolvable problem: 'M-x occur' is impossible to use on automatically resized Man-mode buffers: after running 'M-x occur' in a Man buffer, it splits the wide frame horizontally, that changes the width of the Man buffer, that causes window-size-change-functions to run, that starts a new Man process to reformat the Man buffer according to the new width of the Man buffer. After that, typing RET on all matching lines in the Occur buffer will jump to the beginning of the Man buffer, because reformatting invalidates all markers that point from lines in the Occur buffer to lines in the Man buffer, i.e. typing 'C-u C-x =' on all lines in the Occur buffer displays the same: There are text properties here: occur-target # From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 26 04:32:19 2018 Received: (at 32536) by debbugs.gnu.org; 26 Nov 2018 09:32:19 +0000 Received: from localhost ([127.0.0.1]:47805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRDFb-0001Tx-IR for submit@debbugs.gnu.org; Mon, 26 Nov 2018 04:32:19 -0500 Received: from mout.gmx.net ([212.227.17.21]:53909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRDFa-0001Tl-K5 for 32536@debbugs.gnu.org; Mon, 26 Nov 2018 04:32:19 -0500 Received: from [192.168.1.101] ([46.125.249.31]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LlpJU-1frsQj0G9I-00ZSKn; Mon, 26 Nov 2018 10:32:09 +0100 Message-ID: <5BFBBD95.4040700@gmx.at> Date: Mon, 26 Nov 2018 10:32:05 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> <87zhtwanil.fsf@mail.linkov.net> In-Reply-To: <87zhtwanil.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:iTjZnbtBVtH5fXL1sGYiDZe9RbELiJY96zs8LZP8yXM3vsv+0qh LV0SPahSKg++YoORa4J0lhwtaBkEKyhniuGccpNyaQDKJYr4pPEh4EWC0yj+jatS7oTIXPv QYTX1kTyIeR3oT/5r960xikW6DKteC+sYRg3assXj7zuqefF4OETB8+H0G/5clzoHKow6zR 0/lsySRZRffr2c2ilpbhw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xG5uOKLrYBY=:fis902wtRzZ7XLqEWcccwj 6L8KDJ0+48FYpr9Jd3wFrZyQnc2yZqOcVnk+vOpSucKvWrhj8CJ2RQGzNiWM/BKXY1xC++dlL fUEPHf1plq7E6J/sXjZdAmeLHYGPd9rUxCDeT/JFlV0vsPRPyY3kcSmHEHw/Fn985dJvo5ZvP NU5JYGdXF7XsKfSQU9YU4JV2JObhFkZpd+E2NWyTvMuaKisE1bw1Ot+mMYFmylRspNxtHWINE 0WncE7Ve7gHm15/4o6ViXaiNV5C/HaDyKjWjDkhNsTqOuOvQ/Z1HmAuD9O4SJErU8AVcVKvRb /jSuk2SKWui6BSvUOgKAgfU3zk1rYnffIKLBPPhFv5pm6ascVNrouJHTZp/DbEBX/RpiORH9V 6MJyIkQagghs44lzNakw5wM3zhH9shcoOpMF9uTw2837uiBOvQspwJCns2ALSbJ1ailsD2ksJ 396iDBWhGQC81/+2fCtTGSk44gTpYZuUL2ENN1V2ylmstgX1wzUj20NELDNBqJaa4XfKINAw8 0aNF+WBcG8Yu+Dzq1B9DhuXw7w93kJPalwI3LTrIXs6069hroOTnaDB966aXMiHmPCe5t5B59 19hbC+gKezx4jhTp15ssY8j128sLjH3S83AwoXiL8CCbFsUPGrREnkLnT10nbYjp6AyS15KL/ 15gL6PRw9+Vk8hPWtT5ZOuoZQ5Cs3W6YO2gPZyynvkVU1PCrnV7MLcAwax+u/UQJaJTCdTDYw UaXT5ll+BEUJSdnyJOAgarTHM3bk85B5HiinqN7aVx/qHiNM5BtuRt1hEXVKOLMl5dmBq1nSq YaHGId1SAud3D9oyJ826S5Z6YvDcnKJvwl8ELsMOB7AG50edHcXjfsl/H9YSD5Exe0xFmiRc+ tVbUZtW1XCPmCXOke8zS9FPtrus5SKEyTWnXD8a53cJE3uzijDHPbKjxBGATAE X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I reported this in bug#32637, please see there. > > Thanks to Martin, a request in bug#32637 is now implemented and closed. BTW, I plan to change the behavior of 'window-size-change-functions' as follows. (1) Run the buffer-local hook not only once for each buffer per frame but for each window showing the buffer. (2) Run the buffer-local hook with the window as argument instead of the frame. (3) Run the buffer-local hook for changes of the window's body size too. (4) Run the buffer-local hook also when a window has not shown the buffer the last time this hook was run. This way, a function that should be run whenever a window showing a certain buffer is created/used or changes size is guaranteed to run in each case and no further checks are needed. All changes would be strictly based on 'local-variable-p' (and not on 'buffer-local-value') so any calls from 'window-size-change-functions' in Emacs < 27.1 would remain unaffected. WDYT? > But still this bug#32536 can't be closed because I found an insolvable > problem: 'M-x occur' is impossible to use on automatically resized > Man-mode buffers: after running 'M-x occur' in a Man buffer, it splits > the wide frame horizontally, that changes the width of the Man buffer, > that causes window-size-change-functions to run, that starts a new > Man process to reformat the Man buffer according to the new width of the > Man buffer. After that, typing RET on all matching lines in the Occur buffer > will jump to the beginning of the Man buffer, because reformatting invalidates > all markers that point from lines in the Occur buffer to lines in the > Man buffer, i.e. typing 'C-u C-x =' on all lines in the Occur buffer > displays the same: > > There are text properties here: > occur-target # So essentially you would have to rerun occur whenever the Man buffer is reformatted. Otherwise, I see only one way to handle this. Before reformatting, store the context of each marker (in a bookmark-like or diff-like fashion) and restore the markers from that context. The matching done in the restore step would have to identify and ignore "soft" changes of whitespace. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 26 19:39:02 2018 Received: (at 32536) by debbugs.gnu.org; 27 Nov 2018 00:39:02 +0000 Received: from localhost ([127.0.0.1]:50251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRRP3-0000OD-TX for submit@debbugs.gnu.org; Mon, 26 Nov 2018 19:39:02 -0500 Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:24969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRRP2-0000O1-Nl for 32536@debbugs.gnu.org; Mon, 26 Nov 2018 19:39:01 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 49AD0283388; Tue, 27 Nov 2018 00:38:59 +0000 (UTC) Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id F0942282B38; Tue, 27 Nov 2018 00:38:58 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a3.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Tue, 27 Nov 2018 00:38:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Whispering-Grain: 5be6a8830cc7e8b4_1543279139118_1566061630 X-MC-Loop-Signature: 1543279139118:3092798892 X-MC-Ingress-Time: 1543279139117 Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id BD8F0807EE; Mon, 26 Nov 2018 16:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=zEqaj48LPCoLwIlSrLqO+X5NgiY=; b= hQchKvJ6iOZr0A90Vg+9ci1ZNf0yq8WdyWw0ZBR1XKfClLuq3pV/uSUH2T3N9UkO WxkEG1S2Wcj18Ol+c5AHuT2yegzLz2sLYLNpbvVA35IVC0jy1EhvbX6gAxhlN6Xv 5Wpezxjce/dsfI4yY8jyZ9tiTF2UUjGGAsJMWKD6OII= Received: from mail.jurta.org (m91-129-107-242.cust.tele2.ee [91.129.107.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTPSA id 3A39B807E8; Mon, 26 Nov 2018 16:38:56 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a3 From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> <87zhtwanil.fsf@mail.linkov.net> <5BFBBD95.4040700@gmx.at> Date: Tue, 27 Nov 2018 02:01:08 +0200 In-Reply-To: <5BFBBD95.4040700@gmx.at> (martin rudalics's message of "Mon, 26 Nov 2018 10:32:05 +0100") Message-ID: <875zwjgypr.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedruddukedgvdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdegvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgephe X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > BTW, I plan to change the behavior of 'window-size-change-functions' > as follows. > > (1) Run the buffer-local hook not only once for each buffer per frame > but for each window showing the buffer. Good, so buffer-local hooks won't need to use walk-windows. > (2) Run the buffer-local hook with the window as argument instead of > the frame. Good. When needed, it's easy to get the frame from the window argument. > (3) Run the buffer-local hook for changes of the window's body size > too. What might cause these changes? > (4) Run the buffer-local hook also when a window has not shown the > buffer the last time this hook was run. Good, so initial buffer display will be automatically handled as well. > All changes would be strictly based on 'local-variable-p' (and not on > 'buffer-local-value') so any calls from 'window-size-change-functions' > in Emacs < 27.1 would remain unaffected. WDYT? This makes better sense. >> There are text properties here: >> occur-target # > > So essentially you would have to rerun occur whenever the Man buffer > is reformatted. It's too ad-hoc to find all Occur buffers created from the Man buffer, and revert all of them. > Otherwise, I see only one way to handle this. Before reformatting, > store the context of each marker (in a bookmark-like or diff-like > fashion) and restore the markers from that context. The matching done > in the restore step would have to identify and ignore "soft" changes > of whitespace. This means additionally to finding all affected Occur buffers like above, instead of reverting them, perform much more complex processing of their markers. It seems a more practical solution is to limit the width of Man buffers to at least 80 columns by default, so splitting such windows will not resize their number of columns, so they won't be reverted and reformatted. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 27 03:08:19 2018 Received: (at 32536) by debbugs.gnu.org; 27 Nov 2018 08:08:19 +0000 Received: from localhost ([127.0.0.1]:50390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRYPq-0007GT-No for submit@debbugs.gnu.org; Tue, 27 Nov 2018 03:08:18 -0500 Received: from mout.gmx.net ([212.227.15.19]:55175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRYPp-0007GE-9f for 32536@debbugs.gnu.org; Tue, 27 Nov 2018 03:08:17 -0500 Received: from [192.168.1.101] ([46.125.249.61]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MQiB3-1fy1Qg3rZt-00U4rz; Tue, 27 Nov 2018 09:08:08 +0100 Message-ID: <5BFCFB62.4030507@gmx.at> Date: Tue, 27 Nov 2018 09:08:02 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> <87zhtwanil.fsf@mail.linkov.net> <5BFBBD95.4040700@gmx.at> <875zwjgypr.fsf@mail.linkov.net> In-Reply-To: <875zwjgypr.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:BhOQLj1vvzRU0P7Qk95Qf/dHh49mKUJUGWVLpyc0tIYi11XyL8l Nj0xNoaOgDgkJyJk0Py3wEOXYkRb3ybV9pHnb++rIQJRhJbTZAtNjHsYhS+uEha0tiCQmNR vBxeqmTLxKmIkcR4uPD2W93+lFwRbCR+MLUPpQyetFqWa4QQN4QUlMGo0klwbziKXwNL+Uc VNKrXXOfkp0ThDghCwMqw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VO0bpMCy968=:kPd7ILgLuHWSjUDjHSqM61 K0Sb8po6zuEpo78JfQMSOW5jILdjNrc8mJGGDw2/QJlGrEPneev7F+6Edeu3OP8IAiokgLeEK PI9r55s+lRMnQ8zARRGIitl87CEbr+b7+JLLXWob9rewqr+Qk/z8uWO6xlw6j0alSMG1Z/d1S RiFcTFLdrSA0SxaePzKXsicuo4qaO1a628PogtSY1Yiy4ot2CsT+v7OSX+XO3OGibto7p71jv WgeqY66gFiKIN1fsH0h2qoCsJ5Hj7pKBdkqltNy10mZFkO3lOfIn+rrWW7/J3CuhySWEv7L05 dnQAiz3i+4bq9km/WO77i7SWBrocZtIfO/0SOiUFNLmus3abYFTNbMELmyxP2t6IlDWL99au1 fjJC1DZv7950U6vAHIQ7CrWAAvfBwuXK1/RNgvzVCd8Nupr6dZQEvHqmMdFzx7CfqTZILA6um /HOSJ7OfDIm9oHmQ7g5lJcoC5AtAn147JrVuwHg01mdr2Eov15ZbEXgqXv0FJQox9XLEb74py Ct4GSR0FYjbqM6bpkRqc/UaYEFZHUnS3qZ7WAKhDKKI+NfHAn3STbpQ2+21zD2IpyVBdW3Fj6 O+H+4RLuMly7I+j56r9wan41TNnMMnB3jIpr51T4HGjjSjGHNpgqbLiUzKf8n/DBLCg2A8/eB c9/hk2kwo8vZXq8g93qlSWd9OLSJKerXQBcO6/W///QBsHetScw4KI0NXePtoMQSoEJLdsQ3q 9UvkGM1CcXtYnYh7MaYhYpfd7DAs6NdnXug9NlI/3Wq20JKPuE7Bc8CdHX7O+T+w4QtP4Jslh 1xlR2SbfhNXci8prMegG1xdkydYYnaUdohvexXlS/lVFNSVsHlaCg99ptCEMJo2mO0li9WMJ2 Xj6gT5aZdj07yGFjDiuwbsLDw739jBQzfYNdtNc/STcKn8JKxF6cyOGVe0pKtu X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) >> (3) Run the buffer-local hook for changes of the window's body size >> too. > > What might cause these changes? Adding/removing fringes, dividers, scroll bars, mode or header lines to/from a window. Usually, applications do not care for the total size of a window - they want to know the size of the text area only. > (4) Run the buffer-local hook also when a window has not shown the >> buffer the last time this hook was run. > > Good, so initial buffer display will be automatically handled as well. It should also include the following idiosyncrasy: Suppose a user saves away a window in a configuration in some register, kills it and revives the window from that register a few hours later. How should running size change functions handle that case? The window has neither changed buffer nor size since the last time it was shown. I currently just run the buffer-local hook (since the window was not there the last time the functions were run) but without further notice. If someone thinks that the application should get notified in some sense about this fact, then please tell me how. >> So essentially you would have to rerun occur whenever the Man buffer >> is reformatted. > > It's too ad-hoc to find all Occur buffers created from the Man buffer, > and revert all of them. Is it reverting Man buffers only that causes problems? I suppose (auto-)reversal is a wide-spread disease. >> Otherwise, I see only one way to handle this. Before reformatting, >> store the context of each marker (in a bookmark-like or diff-like >> fashion) and restore the markers from that context. The matching done >> in the restore step would have to identify and ignore "soft" changes >> of whitespace. > > This means additionally to finding all affected Occur buffers like above, > instead of reverting them, perform much more complex processing of > their markers. > > It seems a more practical solution is to limit the width of Man buffers > to at least 80 columns by default, so splitting such windows will not > resize their number of columns, so they won't be reverted and reformatted. Why is it that we care so much about Man buffers and live with the fact that, for example, our *info* buffers have rigid width? martin From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 27 19:45:40 2018 Received: (at 32536) by debbugs.gnu.org; 28 Nov 2018 00:45:40 +0000 Received: from localhost ([127.0.0.1]:52641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRnz2-0002mp-1E for submit@debbugs.gnu.org; Tue, 27 Nov 2018 19:45:40 -0500 Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:49765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRnz0-0002mg-5e for 32536@debbugs.gnu.org; Tue, 27 Nov 2018 19:45:38 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 55B841233A8; Wed, 28 Nov 2018 00:45:35 +0000 (UTC) Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.11.179]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EBF111230EC; Wed, 28 Nov 2018 00:45:34 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a3.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 28 Nov 2018 00:45:35 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Ruddy-Desert: 7a3650ec57b34a13_1543365935139_3252757009 X-MC-Loop-Signature: 1543365935139:710268549 X-MC-Ingress-Time: 1543365935139 Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id B3DF880921; Tue, 27 Nov 2018 16:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=xmRhS082PzJxBu+7oGtWJczAl50=; b= zfaN3avGEorsyfS5RCBnsYK0shl/9xMF/1H/21NiD6my8qaJW2p+3QiYQ8XJkDF/ +R/KjD0q+3SIMX5a6jRI8KScSczxIWF+xEA2bvAmw7TPuKjACuhZhXUMsV1PGYgU bwf6FQgETk9fSfwEC2m542pQbwjxxth5qrwX6AMD1BQ= Received: from mail.jurta.org (m91-129-107-242.cust.tele2.ee [91.129.107.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTPSA id 3565F8091F; Tue, 27 Nov 2018 16:45:32 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a3 From: Juri Linkov To: martin rudalics Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87in3r1l7y.fsf@mail.linkov.net> <5B88E62F.20504@gmx.at> <87d0twam5z.fsf@mail.linkov.net> <5B8B8DC8.7020001@gmx.at> <8736urmtjs.fsf@mail.linkov.net> <5B8CE346.60809@gmx.at> <874lf6usob.fsf@mail.linkov.net> <5B8E3983.8040808@gmx.at> <875zzl9cmo.fsf@mail.linkov.net> <87zhtwanil.fsf@mail.linkov.net> <5BFBBD95.4040700@gmx.at> <875zwjgypr.fsf@mail.linkov.net> <5BFCFB62.4030507@gmx.at> Date: Wed, 28 Nov 2018 01:58:05 +0200 In-Reply-To: <5BFCFB62.4030507@gmx.at> (martin rudalics's message of "Tue, 27 Nov 2018 09:08:02 +0100") Message-ID: <874lc2gk07.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedruddvtddgvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdegvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgepfe X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > It should also include the following idiosyncrasy: Suppose a user > saves away a window in a configuration in some register, kills it and > revives the window from that register a few hours later. How should > running size change functions handle that case? The window has > neither changed buffer nor size since the last time it was shown. I > currently just run the buffer-local hook (since the window was not > there the last time the functions were run) but without further > notice. If someone thinks that the application should get notified in > some sense about this fact, then please tell me how. Hard to tell, we need to see its consequences in practice. >>> So essentially you would have to rerun occur whenever the Man buffer >>> is reformatted. >> >> It's too ad-hoc to find all Occur buffers created from the Man buffer, >> and revert all of them. > > Is it reverting Man buffers only that causes problems? This problem is not only in Man buffers, but also in Occur buffers. Maybe Occur should save points in addition to markers, so if after the original buffer is reverted, and marker-position value becomes 1, then use remembered point's value as a number, not invalidated marker. This is called "graceful degradation". Currently this is what is used in 'Man-update-manpage'. You can see how it saves 'old-pos' from (point), not from (point-marker). > Why is it that we care so much about Man buffers and live with the > fact that, for example, our *info* buffers have rigid width? *Info* buffers are complied, but dynamically generated Man buffers give us flexibility. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 26 18:50:02 2018 Received: (at 32536) by debbugs.gnu.org; 26 Dec 2018 23:50:02 +0000 Received: from localhost ([127.0.0.1]:38046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcIw2-0006Wq-Qh for submit@debbugs.gnu.org; Wed, 26 Dec 2018 18:50:02 -0500 Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:3286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcIvx-0006Wc-S9 for 32536@debbugs.gnu.org; Wed, 26 Dec 2018 18:49:57 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C25AC502B72; Wed, 26 Dec 2018 23:49:52 +0000 (UTC) Received: from pdx1-sub0-mail-a49.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7A7FD502B86; Wed, 26 Dec 2018 23:49:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a49.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 26 Dec 2018 23:49:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Spill-Society: 0d04635d2a0da57b_1545868192642_2907715850 X-MC-Loop-Signature: 1545868192641:2609012569 X-MC-Ingress-Time: 1545868192641 Received: from pdx1-sub0-mail-a49.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTP id 3C80F7FC75; Wed, 26 Dec 2018 15:49:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=z07nY/PZvpx4UuJ9kapqKpE7PxI=; b= Xe7/g6IG9lyaBj1k81/8VLmR7Ye5UKrPxHdzgwT6kdSrCrytJY/YWndZXOhJj4Xp fCNyt9FUDXrz9Cv1XyFyuk2d2d2CqWhK8mRHXX82UHLqy5+kspwDlszL2VJxZB4T xeC9teaZ8ab9wa58HkKnBks+MZsevUTJHqkQnWzxFXM= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTPSA id 6373D7FC6E; Wed, 26 Dec 2018 15:49:49 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a49 From: Juri Linkov To: 32536@debbugs.gnu.org Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> Date: Thu, 27 Dec 2018 01:36:05 +0200 In-Reply-To: <878t4t70zb.fsf@himinbjorg.adminart.net> (hw@adminart.net's message of "Sun, 26 Aug 2018 14:42:48 +0200") Message-ID: <87imzfj1he.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtddugddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfedvheefieesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: martin rudalics X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Thanks Martin this is easy now to implement using new hooks. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=Man-width.el.patch diff --git a/lisp/man.el b/lisp/man.el index defe992074..211d56f9dd 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -182,6 +182,34 @@ Man-width (integer :tag "Fixed width" :value 65)) :group 'man) +(defcustom Man-width-min 40 + "Minimum number of columns allowed for the width of manual pages. +It defines the minimum width for the case when `Man-width' is customized +to a dynamically calculated value depending on the frame/window width. +If the width calculated for `Man-width' is smaller than the minimum width, +it will be automatically enlarged to the width defined by this variable. +If the calculated width is smaller than the minimum width, the value +of this variable has no effect. +When nil, there is no limit on minimum width." + :type '(choice (const :tag "No limit" nil) + (integer :tag "Min width" :value 40)) + :version "27.1" + :group 'man) + +(defcustom Man-width-max 80 + "Maximum number of columns allowed for the width of manual pages. +It defines the maximum width for the case when `Man-width' is customized +to a dynamically calculated value depending on the frame/window width. +If the width calculated for `Man-width' is larger than the maximum width, +it will be automatically reduced to the width defined by this variable. +If the calculated width is smaller than the maximum width, the value +of this variable has no effect. +When nil, there is no limit on maximum width." + :type '(choice (const :tag "No limit" nil) + (integer :tag "Max width" :value 80)) + :version "27.1" + :group 'man) + (defcustom Man-frame-parameters nil "Frame parameter list for creating a new frame for a manual page." :type '(repeat (cons :format "%v" @@ -1005,6 +1033,25 @@ man-follow (error "No item under point") (man man-args))) +(defvar Man-columns nil) + +(defun Man-columns () + (let ((width (cond + ((and (integerp Man-width) (> Man-width 0)) + Man-width) + (Man-width + (let ((window (get-buffer-window nil t))) + (frame-width (and window (window-frame window))))) + (t + (window-width (get-buffer-window nil t)))))) + (when (and (integerp Man-width-max) + (> Man-width-max 0)) + (setq width (min width Man-width-max))) + (when (and (integerp Man-width-min) + (> Man-width-min 0)) + (setq width (max width Man-width-min))) + width)) + (defmacro Man-start-calling (&rest body) "Start the man command in `body' after setting up the environment" `(let ((process-environment (copy-sequence process-environment)) @@ -1041,20 +1088,8 @@ Man-start-calling (not (or (getenv "MANWIDTH") (getenv "COLUMNS")))) ;; Since the page buffer is displayed beforehand, ;; we can select its window and get the window/frame width. - (setenv "COLUMNS" (number-to-string - (cond - ((and (integerp Man-width) (> Man-width 0)) - Man-width) - (Man-width - (if (window-live-p (get-buffer-window (current-buffer) t)) - (with-selected-window (get-buffer-window (current-buffer) t) - (frame-width)) - (frame-width))) - (t - (if (window-live-p (get-buffer-window (current-buffer) t)) - (with-selected-window (get-buffer-window (current-buffer) t) - (window-width)) - (window-width))))))) + (setq-local Man-columns (Man-columns)) + (setenv "COLUMNS" (number-to-string Man-columns))) ;; Since man-db 2.4.3-1, man writes plain text with no escape ;; sequences when stdout is not a tty. In 2.5.0, the following ;; env-var was added to allow control of this (see Debian Bug#340673). @@ -1525,7 +1560,19 @@ Man-mode (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) - 'Man-bookmark-make-record)) + 'Man-bookmark-make-record) + (add-hook 'window-size-change-functions (debounce #'Man-window-change 1) nil t) + (add-hook 'window-state-change-functions (debounce #'Man-window-change 1) nil t) + (add-hook 'window-selection-change-functions (debounce #'Man-window-change 1) nil t)) + +(defun Man-window-change (window) + (when (window-live-p window) + (with-selected-window window + (when (and (derived-mode-p 'Man-mode) + (not (eq Man-columns (Man-columns)))) + (let ((proc (get-buffer-process (current-buffer)))) + (unless (and proc (not (eq (process-status proc) 'exit))) + (Man-update-manpage))))))) (defun Man-build-section-list () "Build the list of manpage sections." --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 10:46:35 2018 Received: (at 32536) by debbugs.gnu.org; 27 Dec 2018 15:46:35 +0000 Received: from localhost ([127.0.0.1]:39459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcXrn-0003dD-2l for submit@debbugs.gnu.org; Thu, 27 Dec 2018 10:46:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcXrl-0003cy-0c for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 10:46:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcXrc-0007DH-0c for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 10:46:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcXrb-0007Cw-Pt; Thu, 27 Dec 2018 10:46:23 -0500 Received: from [176.228.60.248] (port=2571 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gcXra-0002UG-Sf; Thu, 27 Dec 2018 10:46:23 -0500 Date: Thu, 27 Dec 2018 17:46:22 +0200 Message-Id: <83muor6khd.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87imzfj1he.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 27 Dec 2018 01:36:05 +0200) Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87imzfj1he.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Juri Linkov > Date: Thu, 27 Dec 2018 01:36:05 +0200 > > Thanks Martin this is easy now to implement using new hooks. Thanks for working on this. > +(defcustom Man-width-min 40 > + "Minimum number of columns allowed for the width of manual pages. > +It defines the minimum width for the case when `Man-width' is customized > +to a dynamically calculated value depending on the frame/window width. > +If the width calculated for `Man-width' is smaller than the minimum width, > +it will be automatically enlarged to the width defined by this variable. > +If the calculated width is smaller than the minimum width, the value > +of this variable has no effect. > +When nil, there is no limit on minimum width." > + :type '(choice (const :tag "No limit" nil) > + (integer :tag "Min width" :value 40)) > + :version "27.1" > + :group 'man) > + > +(defcustom Man-width-max 80 > + "Maximum number of columns allowed for the width of manual pages. > +It defines the maximum width for the case when `Man-width' is customized > +to a dynamically calculated value depending on the frame/window width. > +If the width calculated for `Man-width' is larger than the maximum width, > +it will be automatically reduced to the width defined by this variable. > +If the calculated width is smaller than the maximum width, the value > +of this variable has no effect. > +When nil, there is no limit on maximum width." I suspect some typo(s) in these doc strings, perhaps due to copy/pasta, because the penultimate sentence of each of them makes no sense to me, certainly when taken together with the other doc string. If I'm wrong, and there's no error here, please explain what you meant. > +(defun Man-columns () > + (let ((width (cond > + ((and (integerp Man-width) (> Man-width 0)) > + Man-width) > + (Man-width > + (let ((window (get-buffer-window nil t))) > + (frame-width (and window (window-frame window))))) > + (t > + (window-width (get-buffer-window nil t)))))) > + (when (and (integerp Man-width-max) > + (> Man-width-max 0)) > + (setq width (min width Man-width-max))) > + (when (and (integerp Man-width-min) > + (> Man-width-min 0)) > + (setq width (max width Man-width-min))) > + width)) Careful here: both window-width (why not use its official name, btw?) and frame-width are insensitive to the size of the font used to display the man page: they both measure in "canonical" column units. Maybe this is not a significant problem (and I realize the old code also worked like that), but perhaps the doc strings of the two new options should mention this fact, lest the user will be surprised. > + (setenv "COLUMNS" (number-to-string Man-columns))) Here, for example, the 'man' program will interpret COLUMNS at face value, and will produce lines of that many characters; but if the size of thefont used to display the man page is significantly different from the frame's default font, those lines might be wider or narrower than the window/frame. Finally, I think this warrants a NEWS entry and perhaps also an update for the manual. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 16:24:21 2018 Received: (at 32536) by debbugs.gnu.org; 27 Dec 2018 21:24:21 +0000 Received: from localhost ([127.0.0.1]:39574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8f-0005ep-2E for submit@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:21 -0500 Received: from cichlid.maple.relay.mailchannels.net ([23.83.214.36]:29481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8c-0005ee-Je for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:20 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 59B855E3324; Thu, 27 Dec 2018 21:24:17 +0000 (UTC) Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 186AF5E36BE; Thu, 27 Dec 2018 21:24:17 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 21:24:17 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Slimy-Zesty: 46fb69236290c352_1545945857237_2329731907 X-MC-Loop-Signature: 1545945857237:3536680676 X-MC-Ingress-Time: 1545945857236 Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id B6C267FD0D; Thu, 27 Dec 2018 13:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=DHXeFEwysx15A3AjyiNjdEMnSH8=; b= j0sbYtwXzo7d4qIhPkkO06SVlUjwlDQ1XGsFAkRRP752dzfwEELKA5m/Z6tjnF3J ldguzdDdkscLkkR8yuJW+Ah9GKtB6Dbe/zhpVDP30SLbu65DCWiZb1SVKKkrfq8/ 7tRpwCmU8i77RRAOm5On/BcNOB5hR54rPbtZFTzs1mY= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 562D17FCFE; Thu, 27 Dec 2018 13:24:14 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87imzfj1he.fsf@mail.linkov.net> <83muor6khd.fsf@gnu.org> Date: Thu, 27 Dec 2018 22:54:44 +0200 In-Reply-To: <83muor6khd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 17:46:22 +0200") Message-ID: <87o9964rmz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> +(defcustom Man-width-min 40 >> [...] >> +If the calculated width is smaller than the minimum width, the value >> +of this variable has no effect. >> [...] >> +(defcustom Man-width-max 80 >> [...] >> +If the calculated width is smaller than the maximum width, the value >> +of this variable has no effect. > > I suspect some typo(s) in these doc strings, perhaps due to > copy/pasta, because the penultimate sentence of each of them makes no > sense to me, certainly when taken together with the other doc string. > If I'm wrong, and there's no error here, please explain what you > meant. Yes, one of them is wrong. The doc string of Man-width-min should be changed to: If the calculated width is larger than the minimum width, the value of this variable has no effect. >> +(defun Man-columns () >> + (let ((width (cond >> + ((and (integerp Man-width) (> Man-width 0)) >> + Man-width) >> + (Man-width >> + (let ((window (get-buffer-window nil t))) >> + (frame-width (and window (window-frame window))))) >> + (t >> + (window-width (get-buffer-window nil t)))))) >> + (when (and (integerp Man-width-max) >> + (> Man-width-max 0)) >> + (setq width (min width Man-width-max))) >> + (when (and (integerp Man-width-min) >> + (> Man-width-min 0)) >> + (setq width (max width Man-width-min))) >> + width)) > > Careful here: both window-width (why not use its official name, btw?) Sorry, I don't understand what is the official name? > and frame-width are insensitive to the size of the font used to > display the man page: they both measure in "canonical" column units. > Maybe this is not a significant problem (and I realize the old code > also worked like that), but perhaps the doc strings of the two new > options should mention this fact, lest the user will be surprised. > >> + (setenv "COLUMNS" (number-to-string Man-columns))) > > Here, for example, the 'man' program will interpret COLUMNS at face > value, and will produce lines of that many characters; but if the size > of thefont used to display the man page is significantly different > from the frame's default font, those lines might be wider or narrower > than the window/frame. It seems this calculation works only for monospace fonts. > Finally, I think this warrants a NEWS entry and perhaps also an update > for the manual. Will do after the final patch. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 23:51:01 2018 Received: (at 32536) by debbugs.gnu.org; 28 Dec 2018 04:51:01 +0000 Received: from localhost ([127.0.0.1]:39660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gck6v-0001Y2-BK for submit@debbugs.gnu.org; Thu, 27 Dec 2018 23:51:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gck6t-0001Xq-UZ for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 23:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gck6l-0005aa-Gt for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 23:50:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gck6l-0005a4-Cj; Thu, 27 Dec 2018 23:50:51 -0500 Received: from [176.228.60.248] (port=3455 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gck6l-0003We-0O; Thu, 27 Dec 2018 23:50:51 -0500 Date: Fri, 28 Dec 2018 06:50:51 +0200 Message-Id: <83a7kq6yqc.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87o9964rmz.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 27 Dec 2018 22:54:44 +0200) Subject: Re: bug#32536: displayed width of man pages References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87imzfj1he.fsf@mail.linkov.net> <83muor6khd.fsf@gnu.org> <87o9964rmz.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32536 Cc: 32536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Juri Linkov > Cc: 32536@debbugs.gnu.org > Date: Thu, 27 Dec 2018 22:54:44 +0200 > > >> +(defcustom Man-width-min 40 > >> [...] > >> +If the calculated width is smaller than the minimum width, the value > >> +of this variable has no effect. > >> [...] > >> +(defcustom Man-width-max 80 > >> [...] > >> +If the calculated width is smaller than the maximum width, the value > >> +of this variable has no effect. > > > > I suspect some typo(s) in these doc strings, perhaps due to > > copy/pasta, because the penultimate sentence of each of them makes no > > sense to me, certainly when taken together with the other doc string. > > If I'm wrong, and there's no error here, please explain what you > > meant. > > Yes, one of them is wrong. The doc string of Man-width-min should be > changed to: > > If the calculated width is larger than the minimum width, the value > of this variable has no effect. OK, but I'm still not getting something. Here's the corrected doc string: "Minimum number of columns allowed for the width of manual pages. It defines the minimum width for the case when `Man-width' is customized to a dynamically calculated value depending on the frame/window width. If the width calculated for `Man-width' is smaller than the minimum width, it will be automatically enlarged to the width defined by this variable. If the calculated width is larger than the minimum width, the value of this variable has no effect. If the last 2 sentences want to say that the limit is from below, then they say this in a complicated and confusing way. How about removing the last sentence? > > Careful here: both window-width (why not use its official name, btw?) > > Sorry, I don't understand what is the official name? window-width is an alias, the real function is window-body-width. > >> + (setenv "COLUMNS" (number-to-string Man-columns))) > > > > Here, for example, the 'man' program will interpret COLUMNS at face > > value, and will produce lines of that many characters; but if the size > > of thefont used to display the man page is significantly different > > from the frame's default font, those lines might be wider or narrower > > than the window/frame. > > It seems this calculation works only for monospace fonts. Like I said: this has some subtle aspects, and I suggest saying that in the doc string in some way. > > Finally, I think this warrants a NEWS entry and perhaps also an update > > for the manual. > > Will do after the final patch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 07 22:02:50 2019 Received: (at 32536) by debbugs.gnu.org; 8 Dec 2019 03:02:50 +0000 Received: from localhost ([127.0.0.1]:50111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idmqP-00028F-TL for submit@debbugs.gnu.org; Sat, 07 Dec 2019 22:02:50 -0500 Received: from brown.birch.relay.mailchannels.net ([23.83.209.23]:26005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idmqO-000271-Em; Sat, 07 Dec 2019 22:02:49 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B24557407EE; Sat, 7 Dec 2019 22:38:59 +0000 (UTC) Received: from pdx1-sub0-mail-a51.g.dreamhost.com (100-96-45-206.trex.outbound.svc.cluster.local [100.96.45.206]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 718317407B4; Sat, 7 Dec 2019 22:38:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a51.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sat, 07 Dec 2019 22:38:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Shade-Irritate: 10c8d7e7381b3540_1575758339510_342623564 X-MC-Loop-Signature: 1575758339510:2677873772 X-MC-Ingress-Time: 1575758339510 Received: from pdx1-sub0-mail-a51.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a51.g.dreamhost.com (Postfix) with ESMTP id A3EC983626; Sat, 7 Dec 2019 14:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=hta/lWP5g6e956kukDHAZ5D1i80=; b= m/GBrkDhrYHEwQeAxeeT3KKZAmnx2xrUC72CJvKESm+2XJhzkUS7RBfZN8kauwCI /XIzChJ//+WKb3rlTPO+0lcezPeGiHGLHTs4ofej7SET6xdKwd5v8dm0gXHcbj9a mszRHntrcAVDkdc5N47YQVd7XVEYtVg+ZNcM7tro5Mw= Received: from mail.jurta.org (m91-129-96-42.cust.tele2.ee [91.129.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a51.g.dreamhost.com (Postfix) with ESMTPSA id 20BCF8573E; Sat, 7 Dec 2019 14:38:55 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a51 From: Juri Linkov To: 32536@debbugs.gnu.org Subject: Re: bug#32536: displayed width of man pages Organization: LINKOV.NET References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87imzfj1he.fsf@mail.linkov.net> <83muor6khd.fsf@gnu.org> <87o9964rmz.fsf@mail.linkov.net> <83a7kq6yqc.fsf@gnu.org> Date: Sun, 08 Dec 2019 00:37:42 +0200 In-Reply-To: <83a7kq6yqc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Dec 2018 06:50:51 +0200") Message-ID: <87k177iwy1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32536 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 32536 fixed close 32536 27.0.50 quit This is now pushed to master with NEWS in 7e387c9e52. From unknown Mon Sep 08 16:26:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 05 Jan 2020 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator