From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#39901: Emacs needs to update window-width when the user updates the text size Date: Thu, 05 Mar 2020 08:00:09 +0900 Organization: Emacsen advocacy group Message-ID: References: <878skhphb5.8.fsf@jidanni.org> <877e00nqx8.5.fsf_-_@jidanni.org> <8c863836-1236-49ea-b185-996f55ee18c7@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="76922"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-cygwin) Cc: 953033@bugs.debian.org, 39901@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Cancel-Lock: sha1:QxBEO5/JaP8J7iotOKsAlgJ8mPU= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 05 00:02:31 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9d25-000Jt7-GE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Mar 2020 00:02:29 +0100 Original-Received: from localhost ([::1]:40868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9d24-0004aG-DS for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Mar 2020 18:02:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41292) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9d0h-00039B-Bz for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2020 18:01:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9d0g-0000dU-CJ for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2020 18:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35971) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9d0g-0000dQ-4E for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2020 18:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j9d0g-0003Yn-38 for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2020 18:01:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <877e00nqx8.5.fsf_-_@jidanni.org> Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Mar 2020 23:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39901 X-GNU-PR-Package: emacs Original-Received: via spool by 39901-submit@debbugs.gnu.org id=B39901.158336283013640 (code B ref 39901); Wed, 04 Mar 2020 23:01:02 +0000 Original-Received: (at 39901) by debbugs.gnu.org; 4 Mar 2020 23:00:30 +0000 Original-Received: from localhost ([127.0.0.1]:41944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9d0A-0003Xu-Kd for submit@debbugs.gnu.org; Wed, 04 Mar 2020 18:00:30 -0500 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:39737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9d07-0003Xk-HP for 39901@debbugs.gnu.org; Wed, 04 Mar 2020 18:00:28 -0500 X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 91ED31A0715; Wed, 4 Mar 2020 23:00:25 +0000 (UTC) Original-Received: from hampton.hostforweb.net (100-96-217-40.trex.outbound.svc.cluster.local [100.96.217.40]) (Authenticated sender: tih5qno0ow) by relay.mailchannels.net (Postfix) with ESMTPA id 4AB521A164F; Wed, 4 Mar 2020 23:00:24 +0000 (UTC) X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net Original-Received: from hampton.hostforweb.net ([TEMPUNAVAIL]. [172.245.115.217]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 04 Mar 2020 23:00:25 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: tih5qno0ow|x-authuser|yamaoka@hampton.hostforweb.net X-MailChannels-Auth-Id: tih5qno0ow X-Scare-Tank: 54c3d1ab69f40045_1583362825194_3433768091 X-MC-Loop-Signature: 1583362825194:415711472 X-MC-Ingress-Time: 1583362825194 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=jpl.org; s=default; h=Content-Type:MIME-Version:References:Subject:Cc:To:From: Message-ID:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nJBb5uizFbxm6cheBAqUiHo782pNkhCdOvG8Cxx5yPE=; b=K1jDeSG4glVC8fyplcQrosEyUA zuvXEJXku0xmn7lpOU8w97AnqVmiFI6B52Cm2PJ6RWWPnldL1ecH/Kykq3HlL6XuiRN6AC0tSByON J39Y47dcVTnpPqZxsUK82fw7tX73K+1Bbvv9d/GMmg2qUG85bXkCG0GAK4/IvZmUAKbSVZN7uS6/b Fm0kFU3tHq5/hvf7E5y1i/Fmz3L79vPq9JweoyK70nMwoHNEUDkn0Jk5L3Nv8jrnZXYhaMYiUlzQ8 2z6B2jvX1o5GaEmh430e0fYGyB21hrYhebSsGQiMYbkSLADQ2GPNdj9JAgXI2lgYF4Wyj1syloRIA boKXGRKw==; Original-Received: from 113x33x36x204.ap113.ftth.ucom.ne.jp ([113.33.36.204]:36885 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j9czr-003UBN-HF; Wed, 04 Mar 2020 17:00:16 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( X-OutGoing-Spam-Status: No, score=-0.2 X-AuthUser: yamaoka@hampton.hostforweb.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176863 Archived-At: Thanks Drew. Jidanni, try the following two advices if interest. Probably this would be what you want `text-scale-adjust' to do. The first one tweaks the `window-width' function so to return a value based on the text scaling, and the second one makes the `text-scale-adjust' function redisplay an emacs-w3m page. It's only a quick hack, so I don't want to imprement it in emacs-w3m. (defadvice w3m-redisplay-this-page (around adjust-window-width activate) "Adjust window-width value according to `face-remapping-alist'." (current-buffer) (let ((height (ignore-errors (cadr (assq :height (assq 'default face-remapping-alist)))))) (if height (let ((ofn (symbol-function 'window-width))) (fset 'window-width (lambda (&rest args) (floor (/ (funcall ofn) height)))) (unwind-protect ad-do-it (fset 'window-width ofn))) ad-do-it))) (defadvice text-scale-adjust (after redisplay-w3m-page activate) "Redisplay w3m page after scaling text." (when (eq major-mode 'w3m-mode) (let ((w3m-message-silent t)) (w3m-redisplay-this-page))))