From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre Neidhardt Newsgroups: gmane.emacs.devel Subject: EWW improvements: open in new buffer, tags, quickmarks, search engines, ... Date: Mon, 16 Apr 2018 15:56:40 +0530 Message-ID: <87zi23bg67.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1523874296 28715 195.159.176.226 (16 Apr 2018 10:24:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2018 10:24:56 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 16 12:24:52 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f81Jc-0007Kb-18 for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2018 12:24:52 +0200 Original-Received: from localhost ([::1]:34885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f81Lg-0007Y0-Iz for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2018 06:27:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f81LW-0007XF-Ue for emacs-devel@gnu.org; Mon, 16 Apr 2018 06:26:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f81LS-0000XY-PC for emacs-devel@gnu.org; Mon, 16 Apr 2018 06:26:50 -0400 Original-Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]:45339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f81LS-0000Wk-IO for emacs-devel@gnu.org; Mon, 16 Apr 2018 06:26:46 -0400 Original-Received: by mail-pf0-x22e.google.com with SMTP id l27so10316612pfk.12 for ; Mon, 16 Apr 2018 03:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=SpXXhJkjzQtnlLBIfBf7BvOVMOa951lya1kwJH+p604=; b=E+ffi/KEGPOVJ//KN4SZU6Zurp6Lf8e+Cmd0I4Q3QsbuWu5ODX5YUcSduemmPlFq7z TRsF/XokVxmgP3sKpn+xCekZLhl2ZpeYf2A3luvFHXsrMRTau9ApftYxHnTTxdFV9emv kAQjIOr39taGtbSa7qahqcqjUef9OUqmVBbDEOMBHLUFRfOhq9Fj8a+QQoUlxVoJOHDF J9Y74PkOz8BEGfokMwNf1oNvQCuvUkmRx/bP2Ce5ziWGyG2jM+yu0VpBqbvZtgzcCkNS C4gOfy/MTEJRMgknnxfR8vILZX+YMqPk/iQYrSegT2zGSwjmpNJZ1E2krWjhPQz1izA7 wHpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=SpXXhJkjzQtnlLBIfBf7BvOVMOa951lya1kwJH+p604=; b=TLGnQcQqJnOZQ3d5tP1E0OuUNvvHpT23jwi47JxgaFgFlYzbsC7A5IDtjP8gj5x2Sl Z4IfC4LfhjA5kp73sU/vOT5lwHqBS0fzddzC0z2SXbikk4B2igFDnBr+tms47f8K0jxv CbXO+c+r69+lQvAuxGf1S10IJXJPKNmFCtt6lyGxbZt4fmq1xNT90Gpjb+V2rTtIDZl5 UGjyS1S/CUnRNbnT+48TO5Z81rhUpTXZMx6q+tnoG3fSt+An2uVA6zaGvdp//hUnhZ86 f5MvdondU1qdVxFGa6vAh/lh0KQAfGhTfc9FrXPlGzP5jDh28CjDmPEl+WH9lIouoJjE UqAA== X-Gm-Message-State: ALQs6tAQVe8KZvEVR3+xnvHFIBImdIIR1ZWLgRkj1cjHF80S0Dpfa4Ic CDt6r/9FD5JeixYh/835pRtZCA== X-Google-Smtp-Source: AIpwx4+8k/HM2s3BupuFf5Ivy2PFypJfozwyc8aC4dQ/Jwmj3PW/s+8nx7sOc2OMMoCt58sfluGq4w== X-Received: by 10.99.119.201 with SMTP id s192mr8816386pgc.51.1523874405178; Mon, 16 Apr 2018 03:26:45 -0700 (PDT) Original-Received: from mimimi ([103.61.255.46]) by smtp.gmail.com with ESMTPSA id k198sm6512342pgc.8.2018.04.16.03.26.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 03:26:44 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224633 Archived-At: --=-=-= Content-Type: text/plain I've recently hacked around EWW and since it's coming into good shape I'm thinking of committing this upstream. Before sending a patch, here is the current state of my hacks: https://github.com/Ambrevar/dotfiles/blob/master/.emacs.d/lisp/init-eww.el Summary: - Add `eww-copy-page-title' that mirrors `eww-copy-page-url', it's useful enough. - Enhances eww-next-url / eww-previous-url so that when there is no next / previous links, it tries to increment / decrement the last number in the last element of the URL. ("do what you mean" style.) - Add a `eww-reload-all' command to reload all *eww* buffers, it's useful when using desktop-mode but when `eww-restore-desktop' is nil. - Make `eww' so that the default value is in the prompt, ready to be edited by the user. Very convenient in my opinion. - Change `eww-open-in-new-buffer' so that it queries for a URL instead of cloning the current buffer (which is not very useful in my opinion). - Make eww-update-header-line-format also update the buffer name so that it contains the page title. _Very useful_ to browse / search *eww* buffers (think Ivy/Helm). - Ask for tags when saving a bookmark. Tags are stored under the key :tags as a list of strings. - Make `eww-add-bookmark' run a customizable function to decide when. to error out. For instance, error out when a duplicate is detected with protocol stripped out (https://foo.bar is seen as a duplicate of http://foo.bar). - Make `eww-write-bookmarks' run a customizable function before saving the file. That function can be used, for instance, to detect duplicates or to sort the bookmarks. This would make the eww-bookmarks file more friendly to versioning. - Bookmarks can have a mark which is a string saved under the key :mark. The mark should be unique. It could be used like the "quickmark" function found in some browsers: use it to quickly load a bookmark. (Work in progress.) - Bookmarks can have a search engine which is either appended to the bookmark' URL if it does not start with "https?://", or used as-is otherwise. The search engine is stored as a string under the key :search. A "%s" must be present in the search engine string as a place-holder for the query. - Make `eww-bookmark-prepare' only load bookmarks from file if not already set. This makes it possible to display a custom / narrowed list of bookmarks in the bookmark buffer. - Make `eww-bookmark-prepare' display the mark, the tags and the search engine, if available. Work in progress. I'm thinking of using a different face for the mark if a search engine is present. - Add a `eww-bookmarks-by-tags' command which queries the user for a completing list of tags and then displays a bookmark buffers of all the bookmarks which match the tags. The matching can be either inclusive or exclusive (bookmarks which match at least one tag vs. all of them). - Make `eww--dwim-expand-url' follow a different logic to bind it all together: - With a multi-word query, if first word is a mark of a bookmark with a search engine, then use the said search engine over the rest of the query. - With a single word query, if first word is a mark then open the corresponding bookmark. - Else query the default search engine. - Fix `eww-forward-url' as it seems to corrupt the history. (Work in progress.) Of course in its present state my hacks are what they are, very hacky. It needs to be made more customizable and interfaceable. What do you think? -- Pierre Neidhardt Power corrupts. Absolute power is kind of neat. -- John Lehman, Secretary of the Navy, 1981-1987 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlrUemAACgkQm9z0l6S7 zH97pAf/fQ92rXMT2Y+V1Yoy6Q6DhRIvTU04NaQmSm1Y3D/42JdrbctADfhX9M3/ EI2DdmFa9oTNMWI17qDRVLKyxrJwMjhumr3wfHK23GWB1LLFKbGIUuM14kqrwHDe z1xkTsdpRwvshy83RXCWoNOJVsNUnmvrAIX7aZmlTtCDYicMJG62tmZOQh77pVf2 A0ovCnwq+Ju03GTarMrVbD4HYIvPVSIt6i+UL1LL4ZS5dbBqHsZr46/GGFWkQPlE mztz+Fy4P4C66i/dDB8a1Fnl5urJ37VgawuIW4Jay2d16yeA2tNpi1HNuWns/bJ2 sTqwvsq802NwiWvmb5jzYylh5Qzyrw== =Zknm -----END PGP SIGNATURE----- --=-=-=--