127 |
;; longlines-wrap-lines that we'll never encounter from here |
;; longlines-wrap-lines that we'll never encounter from here |
128 |
(save-restriction |
(save-restriction |
129 |
(widen) |
(widen) |
130 |
(longlines-decode-region (point-min) (point-max))) |
(longlines-decode-buffer)) |
131 |
(longlines-wrap-region (point-min) (point-max)) |
(longlines-wrap-region (point-min) (point-max)) |
132 |
(set-buffer-modified-p mod)) |
(set-buffer-modified-p mod)) |
133 |
(when (and longlines-show-hard-newlines |
(when (and longlines-show-hard-newlines |
140 |
(add-hook 'mail-citation-hook 'mail-indent-citation nil t)) |
(add-hook 'mail-citation-hook 'mail-indent-citation nil t)) |
141 |
(add-hook 'mail-citation-hook 'longlines-decode-region nil t)) |
(add-hook 'mail-citation-hook 'longlines-decode-region nil t)) |
142 |
((eq major-mode 'message-mode) |
((eq major-mode 'message-mode) |
143 |
|
(add-hook 'message-setup-hook 'longlines-decode-buffer nil t) |
144 |
(make-local-variable 'message-indent-citation-function) |
(make-local-variable 'message-indent-citation-function) |
145 |
(if (not (listp message-indent-citation-function)) |
(if (not (listp message-indent-citation-function)) |
146 |
(setq message-indent-citation-function |
(setq message-indent-citation-function |
326 |
(set-hard-newline-properties |
(set-hard-newline-properties |
327 |
(match-beginning 0) (match-end 0))))) |
(match-beginning 0) (match-end 0))))) |
328 |
|
|
329 |
|
(defun longlines-decode-buffer () |
330 |
|
"Turn all newlines in the buffer into hard newlines." |
331 |
|
(longlines-decode-region (point-min) (point-max))) |
332 |
|
|
333 |
(defun longlines-encode-region (beg end &optional buffer) |
(defun longlines-encode-region (beg end &optional buffer) |
334 |
"Replace each soft newline between BEG and END with exactly one space. |
"Replace each soft newline between BEG and END with exactly one space. |
335 |
Hard newlines are left intact. The optional argument BUFFER exists for |
Hard newlines are left intact. The optional argument BUFFER exists for |