From be3754037e405c741b7467005f9c11a8de3314f6 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 30 Jun 2011 02:40:19 +0200 Subject: [PATCH] (message-point-in-header-p): Fix last checkin to work with an empty mail-header-separator, too. --- lisp/ChangeLog | 2 ++ lisp/message.el | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b63275186..4a8589fa0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ to saying that we're not in the headers if there is no separator at all. This makes it possible to use the Message version of `M-q' in buffers with no headers (bug#7987). + (message-point-in-header-p): Fix last checkin to work with an empty + mail-header-separator, too. * auth-source.el (auth-source-netrc-saver): If the user says "don't ask again, save the choice via customize. diff --git a/lisp/message.el b/lisp/message.el index a1823aa84..0a4537613 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3469,8 +3469,12 @@ Message buffers and is not meant to be called directly." (defun message-point-in-header-p () "Return t if point is in the header." (save-excursion - (re-search-forward - (concat "^" (regexp-quote mail-header-separator) "\n") nil t))) + (and + (not + (re-search-backward + (concat "^" (regexp-quote mail-header-separator) "\n") nil t)) + (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "\n") nil t)))) (defun message-do-auto-fill () "Like `do-auto-fill', but don't fill in message header." -- 2.25.1