diff options
| -rw-r--r-- | lisp/gnus/message.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ce0d9769a5a..9af38c01ed7 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -3111,16 +3111,26 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." | |||
| 3111 | (message-goto-body-1)) | 3111 | (message-goto-body-1)) |
| 3112 | 3112 | ||
| 3113 | (defun message-goto-body-1 () | 3113 | (defun message-goto-body-1 () |
| 3114 | "Go to the body and return point." | ||
| 3114 | (goto-char (point-min)) | 3115 | (goto-char (point-min)) |
| 3115 | (or (search-forward (concat "\n" mail-header-separator "\n") nil t) | 3116 | (or (search-forward (concat "\n" mail-header-separator "\n") nil t) |
| 3116 | (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) | 3117 | ;; If the message is mangled, find the end of the headers the |
| 3118 | ;; hard way. | ||
| 3119 | (progn | ||
| 3120 | ;; Skip past all headers and continuation lines. | ||
| 3121 | (while (looking-at "[^:]+:\\|[\t ]+[^\t ]") | ||
| 3122 | (forward-line 1)) | ||
| 3123 | ;; We're now at the first empty line, so perhaps move past it. | ||
| 3124 | (when (and (eolp) | ||
| 3125 | (not (eobp))) | ||
| 3126 | (forward-line 1)) | ||
| 3127 | (point)))) | ||
| 3117 | 3128 | ||
| 3118 | (defun message-in-body-p () | 3129 | (defun message-in-body-p () |
| 3119 | "Return t if point is in the message body." | 3130 | "Return t if point is in the message body." |
| 3120 | (>= (point) | 3131 | (>= (point) |
| 3121 | (save-excursion | 3132 | (save-excursion |
| 3122 | (message-goto-body-1) | 3133 | (message-goto-body-1)))) |
| 3123 | (point)))) | ||
| 3124 | 3134 | ||
| 3125 | (defun message-goto-eoh () | 3135 | (defun message-goto-eoh () |
| 3126 | "Move point to the end of the headers." | 3136 | "Move point to the end of the headers." |