From: Daniel Nagy Date: Tue, 13 Jul 2021 10:06:14 +0000 (+0200) Subject: Add option to fill paragraphs X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fpatch_fill_paragraph;p=elpher.git Add option to fill paragraphs --- 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)