Revert "Remove an unused local variable"
authorAlex Schroeder <alex@gnu.org>
Wed, 7 Jul 2021 21:26:46 +0000 (23:26 +0200)
committerAlex Schroeder <alex@gnu.org>
Wed, 7 Jul 2021 21:27:48 +0000 (23:27 +0200)
This reverts commit 914f190a3d33214d43d0d1014e65ae022460299b.

fill-prefix is required for adaptive-fill-mode to work correctly when
filling list items that are more than one line.

elpher.el

index 50637b0..3e71cae 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1497,7 +1497,12 @@ width defined by `elpher-gemini-max-fill-width'."
                      (propertize text-line 'face 'elpher-gemini-quoted))
                     (t text-line))
             text-line))
-         (adaptive-fill-mode t))
+         (adaptive-fill-mode t)
+        ;; fill-prefix is important for adaptive-fill-mode: without
+        ;; it, multi-line list items are not indented correct
+         (fill-prefix (if (match-string 2 text-line)
+                          (replace-regexp-in-string "[>\*]" " " (match-string 0 text-line))
+                        nil)))
     (insert (elpher-process-text-for-display processed-text-line))
     (newline)))