From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 41385@debbugs.gnu.org
Subject: bug#41385: [PATCH] Show eww bookmarks buffer only if it's not empty
Date: Tue, 19 May 2020 14:34:45 +0200 [thread overview]
Message-ID: <87ftbwrtlm.fsf@gnus.org> (raw)
In-Reply-To: <CADwFkmn_N69_=diF=Ck91fitWT3AFe_dguL_Eg5=Ab0TR51EPg@mail.gmail.com> (Stefan Kangas's message of "Mon, 18 May 2020 17:51:06 -0700")
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
next prev parent reply other threads:[~2020-05-19 12:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 0:51 bug#41385: [PATCH] Show eww bookmarks buffer only if it's not empty Stefan Kangas
2020-05-19 12:34 ` Lars Ingebrigtsen [this message]
2020-05-20 3:44 ` Stefan Kangas
2020-06-10 15:25 ` Lars Ingebrigtsen
2020-07-17 1:24 ` Lars Ingebrigtsen
2020-07-29 10:29 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ftbwrtlm.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=41385@debbugs.gnu.org \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.