From bb83b7c09ee84b972f96d8f1757bbdd7ec0c438e Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Tue, 13 Jul 2021 12:06:14 +0200 Subject: [PATCH] Add option to fill paragraphs --- elpher.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/elpher.el b/elpher.el index 4c34f52..c57b1c2 100644 --- a/elpher.el +++ b/elpher.el @@ -547,6 +547,9 @@ If LINE is non-nil, replace that line instead." (defvar elpher-user-coding-system nil "User-specified coding system to use for decoding text responses.") +(defvar elpher-fill-paragraph nil + "Whether to fill text paragraphs using `fill-paragraph`.") + (defun elpher-decode (string) "Decode STRING using autodetected or user-specified coding system." (decode-coding-string string @@ -1397,6 +1400,10 @@ width defined by elpher-gemini-max-fill-width." (replace-regexp-in-string "[>\*]" " " (match-string 0 text-line)) nil))) (insert (elpher-process-text-for-display processed-text-line)) + (when elpher-fill-paragraph + (save-restriction + (narrow-to-region (line-beginning-position) (line-end-position)) + (fill-paragraph))) (newline))) (defun elpher-render-gemini-map (data _parameters) -- 2.20.1