From 3833ce16afe930a57554667afc16b20ce258983d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 21 Jun 2022 20:51:33 +0200 Subject: [PATCH] Fix shr--set-target-ids test for empty buffer * lisp/net/shr.el (shr--set-target-ids): Fix the check for an empty buffer (which may be narrowed). --- lisp/net/shr.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index b269607e323..0645f4721a3 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -399,7 +399,7 @@ DOM should be a parse tree as generated by (defun shr--set-target-ids (ids) ;; If the buffer is empty, there's no point in setting targets. - (unless (zerop (buffer-size)) + (unless (zerop (- (point-max) (point-min))) ;; We may have several targets in the same place (if you have ;; several things after one another). So group ;; them by position. -- 2.39.2