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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41385 in the body.
You can then email your comments to 41385 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Tue, 19 May 2020 00:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org. (Tue, 19 May 2020 00:52:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Show eww bookmarks buffer only if it's not empty
Date: Mon, 18 May 2020 17:51:06 -0700
[Message part 1 (text/plain, inline)]
Severity: minor
X-Debbugs-CC: larsi <at> gnus.org

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

Best regards,
Stefan Kangas
[0001-Show-eww-bookmarks-buffer-only-if-it-s-not-empty.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Tue, 19 May 2020 12:35:02 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Wed, 20 May 2020 03:45:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
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 20:44:30 -0700
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> 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.

Thanks, good point.  Does the attached patch look better?

Best regards,
Stefan Kangas
[0001-Show-eww-bookmarks-buffer-only-if-it-s-not-empty.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Wed, 10 Jun 2020 15:26:02 GMT) Full text and rfc822 format available.

Message #14 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: Wed, 10 Jun 2020 17:25:09 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Thanks, good point.  Does the attached patch look better?

Yup; looks good to me.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Fri, 17 Jul 2020 01:25:02 GMT) Full text and rfc822 format available.

Message #17 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: Fri, 17 Jul 2020 03:24:01 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Thanks, good point.  Does the attached patch look better?
>
> Yup; looks good to me.

That was five weeks ago, and I'm triaging shr/eww bugs tonight, so I
went ahead and applied the patch.  :-)

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jul 2020 01:25:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 41385 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jul 2020 01:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41385; Package emacs. (Wed, 29 Jul 2020 10:30:02 GMT) Full text and rfc822 format available.

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

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

> That was five weeks ago, and I'm triaging shr/eww bugs tonight, so I
> went ahead and applied the patch.  :-)

Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 242 days ago.

Previous Next


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