+2001-11-09 Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * message.el (message-point-in-header-p): New function.
+ (message-do-auto-fill): Use it.
+ (message-beginning-of-line): New function. Goes to beginning of
+ header value (i.e., end of header name), or to beginning of line
+ if already at beginning of value.
+ (message-mode-map): Bind it.
+
2001-11-08 Simon Josefsson <jas@extundo.com>
* gnus-msg.el (gnus-posting-styles): Add doc.
;;(define-key message-mode-map "\M-q" 'message-fill-paragraph)
(define-key message-mode-map "\C-c\C-a" 'mml-attach-file)
-
+
+ (define-key message-mode-map "\C-a" 'message-beginning-of-line)
(define-key message-mode-map "\t" 'message-tab)
(define-key message-mode-map "\M-;" 'comment-region))
(message-newline-and-reformat arg t)
t))
+;; Is it better to use `mail-header-end'?
+(defun message-point-in-header-p ()
+ "Return t if point is in the header."
+ (save-excursion
+ (let ((p (point)))
+ (goto-char (point-min))
+ (or (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "\n")
+ p t)
+ (re-search-forward "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" p t)))))
+
(defun message-do-auto-fill ()
"Like `do-auto-fill', but don't fill in message header."
- (when (> (point) (save-excursion
- (goto-char (point-min))
- (if (re-search-forward
- (concat "^" (regexp-quote mail-header-separator)
- "\n") nil t)
- (match-beginning 0)
- (point-max))))
+ (when (message-point-in-header-p)
(do-auto-fill)))
+;;- (when (> (point) (save-excursion
+;;- (goto-char (point-min))
+;;- (if (re-search-forward
+;;- (concat "^" (regexp-quote mail-header-separator)
+;;- "\n") nil t)
+;;- (match-beginning 0)
+;;- (point-max))))
+;;- (do-auto-fill)))
(defun message-insert-signature (&optional force)
"Insert a signature. See documentation for variable `message-signature'."
(forward-line 2)))
(sit-for 0)))
+(defun message-beginning-of-line (&optional n)
+ "Move point to beginning of header value or to beginning of line."
+ (interactive "p")
+ (let* ((here (point))
+ (bol (progn (beginning-of-line n) (point)))
+ (eol (gnus-point-at-eol))
+ (eoh (re-search-forward ": *" eol t)))
+ (if (equal here eoh)
+ (goto-char bol)
+ (goto-char eoh))))
+
(defun message-buffer-name (type &optional to group)
"Return a new (unique) buffer name based on TYPE and TO."
(cond
@findex message-goto-signature
Move to the signature of the message (@code{message-goto-signature}).
+@item C-a
+@kindex C-a
+@findex message-beginning-of-line
+If at beginning of header value, go to beginning of line, else go to
+beginning of header value. (The header value comes after the header
+name and the colon.)
+
@end table