From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: eww and bookmarks Date: Mon, 26 Oct 2020 14:05:36 -0500 Message-ID: <87mu08iz9b.fsf@alphapapa.net> References: <87k1163jz5.fsf@gmail.com> <87tv0a5k5b.fsf@web.de> <87mu5ec3pf.fsf@web.de> <87mu5e3ncg.fsf@tcd.ie> <87tuzlwrdv.fsf@web.de> <87bllt1olu.fsf@tcd.ie> <878sgvi0pp.fsf@web.de> <87r1pkj1l3.fsf@alphapapa.net> <87v9ewx1xs.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4905"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 26 20:06:36 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kX7pC-00019e-Vx for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Oct 2020 20:06:34 +0100 Original-Received: from localhost ([::1]:49124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX7pB-0000We-VQ for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Oct 2020 15:06:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX7oM-00087f-JH for emacs-devel@gnu.org; Mon, 26 Oct 2020 15:05:42 -0400 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:43784 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX7oK-0006X7-Eb for emacs-devel@gnu.org; Mon, 26 Oct 2020 15:05:42 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kX7oH-000AcT-Lt for emacs-devel@gnu.org; Mon, 26 Oct 2020 20:05:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/26 14:15:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258469 Archived-At: Lars Ingebrigtsen writes: > Adam Porter writes: > >> Having recently put together a new package that uses bookmarks to >> restore windows and buffers, Burly[0], I tested bookmarks with EWW >> buffers, expecting them to be bookmarkable with Emacs bookmarks, but I >> found that they aren't. Then I found this thread[1] from June about >> Michael's patch, which sounds great, but it doesn't seem to have been >> applied yet. > > It sounded like a good idea to me, but looking at the thread, there were > some problems with an async callback? I've just skimmed it. But I'm > for using the normal Emacs bookmark regime in eww, if possible. AIUI the issue is with restoring the position within a restored EWW buffer. That's certainly desirable, but IMHO it needn't prevent the patch from being merged; not all major modes even have bookmark support, and not all bookmark handlers always restore the buffer position correctly, anyway (e.g. if the file has changed sufficiently since being bookmarked). As for fixing that issue, I have two thoughts: 1. In Burly I faced a similar problem. I used a solution similar to one mentioned in the thread: I added a self-removing function to a hook that's run after the bookmark is loaded. In the thread, that solution was not exactly rejected[0]; I think it's probably a good-enough solution, especially by adding to the hook buffer-locally and wrapping the hook-removal in an unwind-protect. 2. An alternative mentioned in the thread[1] was to use url-retrieve's callback to move point after the buffer is rendered. If there are any problems with that solution, it doesn't seem that any were mentioned. 0: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00338.html 1: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00363.html