1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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).
This commit is contained in:
Lars Ingebrigtsen 2022-06-21 20:51:33 +02:00
parent 406fd97921
commit 3833ce16af

View file

@ -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 <span id='foo'> things after one another). So group
;; them by position.