bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41385: [PATCH] Show eww bookmarks buffer only if it's not empty


From: Lars Ingebrigtsen
Subject: bug#41385: [PATCH] Show eww bookmarks buffer only if it's not empty
Date: Tue, 19 May 2020 14:34:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Kangas <stefan@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]