From: keiichi Date: Sat, 4 Mar 2000 07:21:52 +0000 (+0000) Subject: (message-narrow-to-headers-or-head): Copy from Gnus 5.8.3. X-Git-Tag: nana-gnus-7_1_0_16~29 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdff35f70ad5681a910167b1b3cd6691a5a71f71;p=elisp%2Fgnus.git- (message-narrow-to-headers-or-head): Copy from Gnus 5.8.3. --- diff --git a/lisp/message.el b/lisp/message.el index 96b39eb..4802ce0 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1243,6 +1243,21 @@ Return the number of headers removed." (point-max))) (goto-char (point-min))) +(defun message-narrow-to-headers-or-head () + "Narrow the buffer to the head of the message." + (widen) + (narrow-to-region + (goto-char (point-min)) + (cond + ((re-search-forward + (concat "^" (regexp-quote mail-header-separator) "\n") nil t) + (match-beginning 0)) + ((search-forward "\n\n" nil t) + (1- (point))) + (t + (point-max)))) + (goto-char (point-min))) + (defun message-news-p () "Say whether the current buffer contains a news message." (and (not message-this-is-mail)