diff options
| author | Chong Yidong | 2005-11-20 03:44:00 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-11-20 03:44:00 +0000 |
| commit | 2c127d45eaef9bd74ce423cc45798608d89ad48f (patch) | |
| tree | 8ef8dd6e5f416267c8d0bc9a5327e271b1a4f008 | |
| parent | f129a4dfe3ec1402c9b0634afd9d7b6baf247bce (diff) | |
| download | emacs-2c127d45eaef9bd74ce423cc45798608d89ad48f.tar.gz emacs-2c127d45eaef9bd74ce423cc45798608d89ad48f.zip | |
(longlines-mode): Add a message-setup-hook.
(longlines-decode-buffer): New function.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/longlines.el | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28108231a61..57d6d885534 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | * longlines.el (longlines-before-revert-hook) | 3 | * longlines.el (longlines-before-revert-hook) |
| 4 | (longlines-after-revert-hook): New functions. | 4 | (longlines-after-revert-hook): New functions. |
| 5 | (longlines-mode): Turn off longlines temporarily when reverting. | 5 | (longlines-mode): Turn off longlines temporarily when reverting. |
| 6 | Add a message-setup-hook. | ||
| 7 | (longlines-decode-buffer): New function. | ||
| 6 | 8 | ||
| 7 | 2005-11-19 Andreas Schwab <schwab@suse.de> | 9 | 2005-11-19 Andreas Schwab <schwab@suse.de> |
| 8 | 10 | ||
diff --git a/lisp/longlines.el b/lisp/longlines.el index 296b10cd652..85358207a2b 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el | |||
| @@ -127,7 +127,7 @@ are indicated with a symbol." | |||
| 127 | ;; longlines-wrap-lines that we'll never encounter from here | 127 | ;; longlines-wrap-lines that we'll never encounter from here |
| 128 | (save-restriction | 128 | (save-restriction |
| 129 | (widen) | 129 | (widen) |
| 130 | (longlines-decode-region (point-min) (point-max))) | 130 | (longlines-decode-buffer)) |
| 131 | (longlines-wrap-region (point-min) (point-max)) | 131 | (longlines-wrap-region (point-min) (point-max)) |
| 132 | (set-buffer-modified-p mod)) | 132 | (set-buffer-modified-p mod)) |
| 133 | (when (and longlines-show-hard-newlines | 133 | (when (and longlines-show-hard-newlines |
| @@ -140,6 +140,7 @@ are indicated with a symbol." | |||
| 140 | (add-hook 'mail-citation-hook 'mail-indent-citation nil t)) | 140 | (add-hook 'mail-citation-hook 'mail-indent-citation nil t)) |
| 141 | (add-hook 'mail-citation-hook 'longlines-decode-region nil t)) | 141 | (add-hook 'mail-citation-hook 'longlines-decode-region nil t)) |
| 142 | ((eq major-mode 'message-mode) | 142 | ((eq major-mode 'message-mode) |
| 143 | (add-hook 'message-setup-hook 'longlines-decode-buffer nil t) | ||
| 143 | (make-local-variable 'message-indent-citation-function) | 144 | (make-local-variable 'message-indent-citation-function) |
| 144 | (if (not (listp message-indent-citation-function)) | 145 | (if (not (listp message-indent-citation-function)) |
| 145 | (setq message-indent-citation-function | 146 | (setq message-indent-citation-function |
| @@ -325,6 +326,10 @@ If BEG and END are nil, the point and mark are used." | |||
| 325 | (set-hard-newline-properties | 326 | (set-hard-newline-properties |
| 326 | (match-beginning 0) (match-end 0))))) | 327 | (match-beginning 0) (match-end 0))))) |
| 327 | 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 | |||
| 328 | (defun longlines-encode-region (beg end &optional buffer) | 333 | (defun longlines-encode-region (beg end &optional buffer) |
| 329 | "Replace each soft newline between BEG and END with exactly one space. | 334 | "Replace each soft newline between BEG and END with exactly one space. |
| 330 | Hard newlines are left intact. The optional argument BUFFER exists for | 335 | Hard newlines are left intact. The optional argument BUFFER exists for |