GNU bug report logs - #41385
[PATCH] Show eww bookmarks buffer only if it's not empty

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Tue, 19 May 2020 00:52:02 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 41385 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41385 <at> debbugs.gnu.org
Subject: Re: bug#41385: [PATCH] Show eww bookmarks buffer only if it's not
 empty
Date: Tue, 19 May 2020 14:34:45 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Please see the attached patch which fixes a minor annoyance with
> eww-list-bookmarks.

[...]

> -  (pop-to-buffer "*eww bookmarks*")
> -  (eww-bookmark-prepare))
> +  (let ((buf (get-buffer-create "*eww bookmarks*")) no-error)
> +    (unwind-protect
> +        (progn
> +          (pop-to-buffer buf)
> +          (eww-bookmark-prepare)
> +          (setq no-error t))
> +      (when (not no-error) (kill-buffer buf)))))

I don't think this is an ideal way to fix this command -- using error
handling to do control flow is usually the wrong thing to do, and it
makes debugging difficult.  What if there's a real bug in
eww-bookmark-prepare?

Instead eww-list-bookmarks should just do the

  (eww-read-bookmarks)
  (unless eww-bookmarks
    (user-error "No bookmarks are defined"))

bit, I think.  It might mean rearranging some stuff in eww-next-bookmark
etc, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.