From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50497: [PATCH] Adding eww-{next,previous,up,top}-path. Date: Fri, 10 Sep 2021 09:43:09 +0300 Organization: LINKOV.NET Message-ID: <877dfp53zm.fsf@mail.linkov.net> References: <87lf45xh86.fsf@ypei.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34152"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 50497@debbugs.gnu.org To: Yuchen Pei Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 10 08:45:46 2021 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 1mOaIE-0008e6-0O for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Sep 2021 08:45:46 +0200 Original-Received: from localhost ([::1]:48112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOaIC-0005vP-6H for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Sep 2021 02:45:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOaHY-0005tb-5H for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 02:45:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOaHX-0002F9-RW for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 02:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOaHW-0001kq-Q0 for bug-gnu-emacs@gnu.org; Fri, 10 Sep 2021 02:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Sep 2021 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50497 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50497-submit@debbugs.gnu.org id=B50497.16312562826686 (code B ref 50497); Fri, 10 Sep 2021 06:45:02 +0000 Original-Received: (at 50497) by debbugs.gnu.org; 10 Sep 2021 06:44:42 +0000 Original-Received: from localhost ([127.0.0.1]:36731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOaHB-0001jm-O0 for submit@debbugs.gnu.org; Fri, 10 Sep 2021 02:44:41 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOaHA-0001jJ-Lp for 50497@debbugs.gnu.org; Fri, 10 Sep 2021 02:44:41 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 7993824000E; Fri, 10 Sep 2021 06:44:32 +0000 (UTC) In-Reply-To: <87lf45xh86.fsf@ypei.me> (Yuchen Pei's message of "Fri, 10 Sep 2021 13:05:45 +1000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:213964 Archived-At: > I often find myself wanting to navigate paginated web pages > (e.g. ), or to go up or all > the way up when visiting a web page, which is why I added these functions > to my eww. > > Does this change make sense? This reminds a very useful Firefox add-on "Go Up" that lets you go up a level to the parent directory on the current website by pressing Alt+UpArrow, and some other add-ons I don't remember their names. > + (define-key map "N" 'eww-next-path) > + (define-key map "P" 'eww-previous-path) > + (define-key map "U" 'eww-up-path) > + (define-key map "T" 'eww-top-path) Would it be possible to combine this feature with the existing (define-key map "n" 'eww-next-url) (define-key map "p" 'eww-previous-url) (define-key map "u" 'eww-up-url) (define-key map "t" 'eww-top-url) that rely on special attributes. I mean to install your new commands. Then later add fallbacks to both sets of commands: if there is no special attribute, then "n"/"p"/"u"/"t" could try to deduce the page from URL by calling your new commands, instead of signaling an error as they do currently by (user-error "No `next' on this page"). And vice versa: if your commands don't match a number in the URL, then fall back to "n"/"p"/"u"/"t", maybe optionally.