]> git.eshelyaron.com Git - emacs.git/commit
Keep indenting text when 'shr-fill-text' is nil (bug#69555)
authorKévin Le Gouguec <kevin.legouguec@gmail.com>
Sun, 3 Mar 2024 16:20:56 +0000 (17:20 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Mar 2024 09:06:18 +0000 (10:06 +0100)
commit1b6f9d5fe8da2a8e3c83d4d55b79e7734e024b66
tree0293da8c47558f652f0a2bfc256ac435f07e9279
parent544f0ff907fec4177ac8b94fd730537cac59405b
Keep indenting text when 'shr-fill-text' is nil (bug#69555)

The 'shr-fill-...' functions handle both hard-filling (adding
newlines to break long lines) and indentation.  Setting
'shr-fill-text' to nil currently causes these functions to be
short-circuited completely, so e.g. blockquotes are no longer
indented, whereas the intent of this user option is only to
prevent hard-filling to let visual-line-mode reflow text.

* lisp/net/shr.el (shr-fill-lines): Document that the function
handles more than just filling; move the 'shr-fill-text' check...
(shr-fill-line): ... here, after indentation has been taken care
of.
* test/lisp/net/shr-resources/blockquote.html:
* test/lisp/net/shr-resources/blockquote.txt: New test resources.
* test/lisp/net/shr-tests.el (shr-test--rendering-check): Rename
from 'shr-test', to make the relationship with the 'rendering'
testcase clearer; prefer 'file-name-concat' to 'format'; raise
ERT failure if need be, calling (ert-fail ...) directly instead
of (should (not (list ...))).
(shr-test--rendering-extra-configs): New variable to easily check
that user customizations do not degrade rendering.
(rendering): Consult that new variable; delegate failure-raising
to reduce duplication.

(cherry picked from commit 09ab66935154ea0cc4a351b8320bc0e9276b7780)
lisp/net/shr.el
test/lisp/net/shr-resources/blockquote.html [new file with mode: 0644]
test/lisp/net/shr-resources/blockquote.txt [new file with mode: 0644]
test/lisp/net/shr-tests.el