X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/943f7f902ed3d7a5ce00bbb5a9cc60e01607b661..72c20d0be811966afccdb7551d3341d10d3be9a9:/lisp/net/shr.el?ds=inline diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 58deaea6f5..a48d098fe2 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -203,6 +203,12 @@ cid: URL as the argument.") (goto-char begin) (shr-insert-document dom)))) +(defun shr--have-one-fringe-p () + "Return non-nil if we know at least one of the fringes has non-zero width." + (and (fboundp 'fringe-columns) + (or (not (zerop (fringe-columns 'right))) + (not (zerop (fringe-columns 'left)))))) + ;;;###autoload (defun shr-insert-document (dom) "Render the parsed document DOM into the current buffer. @@ -230,19 +236,13 @@ DOM should be a parse tree as generated by (if (not shr-use-fonts) (- (window-body-width) 1 (if (and (null shr-width) - (or (zerop - (fringe-columns 'right)) - (zerop - (fringe-columns 'left)))) + (not (shr--have-one-fringe-p))) 0 1)) (- (window-body-width nil t) (* 2 (frame-char-width)) (if (and (null shr-width) - (or (zerop - (fringe-columns 'right)) - (zerop - (fringe-columns 'left)))) + (not (shr--have-one-fringe-p))) (* (frame-char-width) 2) 0)))))) (shr-descend dom) @@ -466,8 +466,7 @@ size, and full-buffer size." ;; to usurp one column for the ;; continuation glyph. (if (and (null shr-width) - (or (zerop (fringe-columns 'right)) - (zerop (fringe-columns 'left)))) + (not (shr--have-one-fringe-p))) (* (frame-char-width) 2) 0)))) (shr-insert text)