From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: eww and bookmarks Date: Sun, 07 Jun 2020 16:30:23 +0100 Message-ID: <87mu5e3ncg.fsf@tcd.ie> References: <87k1163jz5.fsf@gmail.com> <87tv0a5k5b.fsf@web.de> <87mu5ec3pf.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="116550"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 07 17:31:19 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 1jhxGZ-000UAC-S3 for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jun 2020 17:31:19 +0200 Original-Received: from localhost ([::1]:54244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhxGY-0003kC-Un for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jun 2020 11:31:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhxFk-0003HR-Ud for emacs-devel@gnu.org; Sun, 07 Jun 2020 11:30:28 -0400 Original-Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:39402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhxFj-0008Dl-8h for emacs-devel@gnu.org; Sun, 07 Jun 2020 11:30:28 -0400 Original-Received: by mail-wr1-x441.google.com with SMTP id t18so14735035wru.6 for ; Sun, 07 Jun 2020 08:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=B1GFizOnfksYbUQ0XAC7x/o9hJJ2xzkaBnSHITE7DsA=; b=h4eV7YJrHh89/lR63DgoJvUJj7yZGR03UcvzgJZp/oKHj8zvKcm94aVOBtgivOFtQp 7i++x6Q2YeSEN8sgWSyGxIhXFyH5VQydPU0ehMeaEVswcxDk6qIWtbhGB5f/To3kX2yo Q2QMJSVQqNn+kN5D2za4XVHX+eAsVI1lVeI3lVUXe6OWjC82hH2MUYOXaWMugBMSNf/s Piymcv/+vQPUY+Z2nL5seO2fKeEth9Alg8bBHQKZ4isgWohaDzrq4gJXXIW+3GG+JhmP 6yoZSGs8IzP5RtWzZwM6RckFbgu03qEGmhBM3z4RAw6uRtLJDGocSTFPeaGJa9k24vr9 j6bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=B1GFizOnfksYbUQ0XAC7x/o9hJJ2xzkaBnSHITE7DsA=; b=F0z02ONI/nt2+7UVUiR9YWLbxw8glOL/fJYeHHBFxP7fPK7SADRZlwGF6LBlWzGr4t 1A0Jx+iIZ7DLZos8vlbd6SENrBUu6Ag7sk4QvO2MYvaq3MloaXipffwTnyPu/2Ftie1H Fkujc5i9Vc4deoFhQmzqHW7J+K3DJxabOFGRmqAYONodz7TRuxpyzYKqUDn1+ygmv6FL bwPRa36CtQrajDG9zdiWgtpwZi7+URl25FMYuGf3gV+gdlojJjDIMdT0ODylZG/m2xTO 3FylJScZFNpSg72L1F53MvfZ/yB370NwXp4sY+m8nHpKFgE9xBf6RDCAz1Iip9dmXl4A +z6w== X-Gm-Message-State: AOAM5304KwSZ2eU0EwJlOZnxUgJhPFhO9ANw2YUrMjbECHQADQsHGktc lXj3Kzlp8bFjgkUHMfLVHCo3Bg== X-Google-Smtp-Source: ABdhPJzGeaRz/RrE7FSkzwLrVusjszGwc35HEixe2fBpNYNv4oTTgv0Wm48yRbVlxQHSmGdadYYZbw== X-Received: by 2002:adf:dec5:: with SMTP id i5mr20440209wrn.16.1591543825304; Sun, 07 Jun 2020 08:30:25 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id k17sm18839261wmj.15.2020.06.07.08.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 08:30:24 -0700 (PDT) In-Reply-To: <87mu5ec3pf.fsf@web.de> (Michael Heerdegen's message of "Sun, 07 Jun 2020 17:09:48 +0200") Received-SPF: none client-ip=2a00:1450:4864:20::441; envelope-from=contovob@tcd.ie; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:252013 Archived-At: Michael Heerdegen writes: > Michael Heerdegen writes: > >> I'll install my suggested patch as well soon, sorry for the delay. > > Coming back to this: I've got a problem with the implementation: because > eww retrieves asynchronously, jumping to the bookmark's position does > not work, because when that is done, the buffer is not yet filled and > rendered. I don't see a way to make this work that is not either an > ugly hack or would involve changing and refactoring parts of the eww > code. I don't really feel qualified. > > What would be needed at least would be to replace the hardcoded > #'eww-render in the `url-retrieve' call in `eww' with a newly introduced > variable `eww-render-function' I could bind. Or is there a better way? There's eww-after-render-hook. Sample usage: https://emacs.stackexchange.com/a/36287/15748 > Here is what I have so far: Thanks, some minor comments from me. [...] > diff --git a/lisp/net/eww.el b/lisp/net/eww.el > index 2a70560ca7..3b1948649d 100644 > --- a/lisp/net/eww.el > +++ b/lisp/net/eww.el > @@ -83,6 +83,13 @@ eww-bookmarks-directory > :group 'eww > :type 'directory) > > +(defcustom bookmark-eww-browse-url-function #'eww-browse-url > + "Doc..." > + :type '(choice > + (function-item eww-browse-url :doc "Use eww") > + (const :tag "Use value of `browse-url-browser-function'" nil) > + function)) Isn't it strange having a boookmark-... variable defined in eww.el? [...] > +(defun eww--bookmark-title (title-string) > + (replace-regexp-in-string > + "\\` +\\| +\\'" "" > + (replace-regexp-in-string "[\n\t\r]" " " title-string))) Is the outer replace-regexp-in-string doing the same as string-trim? [...] > +(defun eww-bookmark-make-record () > + "Create an emacs bookmark record for an eww buffer. ^^^^^ ^^^ Capitalize Upcase > +This implements the `bookmark-make-record-function' type (which > +see)." [...] > +(defun bookmark-eww-bookmark-jump (bookmark) > + "Bookmark handler for eww buffers." ^^^ Upcase [...] Thanks, -- Basil