From: Lars Ingebrigtsen Date: Tue, 21 Jun 2022 18:51:33 +0000 (+0200) Subject: Fix shr--set-target-ids test for empty buffer X-Git-Tag: emacs-29.0.90~1447^2~1551 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3833ce16afe930a57554667afc16b20ce258983d;p=emacs.git 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). --- 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.