From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenjiro NAKAYAMA Newsgroups: gmane.emacs.bugs Subject: bug#16204: eww does not respect shr-width customization Date: Sat, 21 Dec 2013 23:49:40 +0900 Message-ID: <87zjnucl8b.fsf@dhcp-193-97.nrt.redhat.com> References: <87ob4bwj6l.fsf@violet.siamics.net> <874n624gz5.fsf@dhcp-193-97.nrt.redhat.com> <87k3eywjfb.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1387637421 27285 80.91.229.3 (21 Dec 2013 14:50:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Dec 2013 14:50:21 +0000 (UTC) Cc: 16204@debbugs.gnu.org To: Ivan Shmakov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 21 15:50:24 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VuNsi-0000An-8Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Dec 2013 15:50:20 +0100 Original-Received: from localhost ([::1]:54426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuNsh-0006oi-Sn for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Dec 2013 09:50:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuNsY-0006oZ-Ff for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2013 09:50:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuNsS-0008FK-Bk for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2013 09:50:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuNsS-0008Dq-8E for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2013 09:50:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VuNsR-0000Zt-2M for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2013 09:50:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenjiro NAKAYAMA Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Dec 2013 14:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16204 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16204-submit@debbugs.gnu.org id=B16204.13876373942198 (code B ref 16204); Sat, 21 Dec 2013 14:50:02 +0000 Original-Received: (at 16204) by debbugs.gnu.org; 21 Dec 2013 14:49:54 +0000 Original-Received: from localhost ([127.0.0.1]:32828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VuNsH-0000ZN-7E for submit@debbugs.gnu.org; Sat, 21 Dec 2013 09:49:53 -0500 Original-Received: from mail-pa0-f43.google.com ([209.85.220.43]:38798) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VuNsD-0000Z8-7g for 16204@debbugs.gnu.org; Sat, 21 Dec 2013 09:49:50 -0500 Original-Received: by mail-pa0-f43.google.com with SMTP id bj1so3785627pad.16 for <16204@debbugs.gnu.org>; Sat, 21 Dec 2013 06:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type:content-transfer-encoding; bh=aGUhG7RKHve2p0CSHjepriY3H6nsvdU2wKtMpl8Xpl4=; b=bipDX5h02FC5MjV2HOlh/AJuZFC2qlW6Fdf4b0AaAfQCfYfzq52ywGqzVxFV5Sxt4K oKzlewNPgA3FeDRrlnIrYObjkSYPEmFTTZtwfzOSu/UKz2mT7QEEFgTliu2PlIbBT+Ea +6lxrSNF6QffieiL49jpbAUkI9k5QrrSZtM9L4kD/NITRKaEVjwMbTg1X+CswfbeADFV d/erx6mSoj/cmEaLR+NIMqZDGBjOCwsJnCAiNR+fBgv3xqsj9uLi6VdLO5Pi4FzYwPAZ 5qQ9s+AGA44smWmHyJ2zb/talroGmubKGRktGm/n6YWsWcxW0rMl4E37beI6pDkmqtMT Y4fg== X-Received: by 10.68.189.133 with SMTP id gi5mr15355661pbc.57.1387637388174; Sat, 21 Dec 2013 06:49:48 -0800 (PST) Original-Received: from dhcp-193-97.nrt.redhat.com (nat-pool-nrt-t1.redhat.com. [66.187.238.10]) by mx.google.com with ESMTPSA id m2sm21819366pbn.19.2013.12.21.06.49.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Dec 2013 06:49:46 -0800 (PST) User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.1 In-reply-to: <87k3eywjfb.fsf@violet.siamics.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82326 Archived-At: Thank you for your review. But I have some comments. I'm sorry if I misunderstood. > I’d also ask for a separate “do not override” value. That is: > > (shr-width (if (DO-NOT-SET-P eww-rendering-width) > shr-width > eww-rendering-width)) I'm not sure how to work well with this logic. I think shr-width should be overridden by nil or new rendering-width every time, since previous windows-width will be set to shr-width next rendering. When users change their window-width, the shr-width should be current window-width, not previous width. > > +(defvar eww-rendering-width nil) > > Shouldn’t it rather be defcustom? For the above reason, I think defvar is ok. > Shouldn’t this rather be ‘error’? Yes, it is my mistake. Sorry. Kenjiro Nakayama ivan@siamics.net writes: >>>>>> Kenjiro NAKAYAMA writes: >>>>>> ivan@siamics.net writes: > > >> Package: emacs Severity: wishlist > > >> As currently implemented, eww-display-html simply resets shr-width > >> to nil, disrespecting any user’s customization thereof, and > >> providing no easy way to specify the HTML rendering width to use in > >> EWW buffers. > > > Yes, I think so too. I wrote the patch to cusomize rendering-width > > (shr-width) easily by users. > > ACK, thanks! > > […] > > > --- a/lisp/net/eww.el > > +++ b/lisp/net/eww.el > > @@ -129,6 +129,7 @@ See also `eww-form-checkbox-selected-symbol'." > > (defvar eww-home-url nil) > > (defvar eww-start-url nil) > > (defvar eww-contents-url nil) > > +(defvar eww-rendering-width nil) > > Shouldn’t it rather be defcustom? > > > (defvar eww-local-regex "localhost" > > "When this regex is found in the URL, it's not a keyword but an address.") > > @@ -255,7 +256,7 @@ word(s) will be searched for via `eww-search-prefix'." > > (setq eww-current-dom document) > > (let ((inhibit-read-only t) > > (after-change-functions nil) > > - (shr-width nil) > > + (shr-width eww-rendering-width) > > I’d also ask for a separate “do not override” value. That is: > > (shr-width (if (DO-NOT-SET-P eww-rendering-width) > shr-width > eww-rendering-width)) > > (And, similarly, defcustom’s :type above being a ‘choice’.) > > > (shr-target-id (url-target (url-generic-parse-url url))) > > (shr-external-rendering-functions > > '((title . eww-tag-title) > > […] > > > @@ -543,6 +546,15 @@ appears in a or tag." > > (url-retrieve eww-current-url 'eww-render > > (list eww-current-url (point)))) > > > +(defun eww-set-rendering-width (width) > > + "Set the redering width." > > + (interactive "nSet new redering width (0: window-width) :") > > + (if (zerop width) > > + (setq eww-rendering-width nil) > > + (if (wholenump width) > > + (setq eww-rendering-width width) > > + (message "Set Number to rendering width")))) > > Shouldn’t this rather be ‘error’? > > > + > > ;; Form support. > > > (defvar eww-form nil)