(require 'mail-abbrevs)
(require 'mailabbrev))
(require 'mime-edit)
+(eval-when-compile (require 'static))
;; Avoid byte-compile warnings.
(eval-when-compile
Checks include subject-cmsg multiple-headers sendsys message-id from
long-lines control-chars size new-text redirected-followup signature
approved sender empty empty-headers message-id from subject
-shorten-followup-to existing-newsgroups buffer-file-name unchanged."
+shorten-followup-to existing-newsgroups buffer-file-name unchanged
+newsgroups."
:group 'message-news)
(defcustom message-required-news-headers
:group 'message-various
:type 'hook)
-(defcustom message-header-hook '(eword-encode-header)
+(defcustom message-header-hook '((lambda () (eword-encode-header t)))
"Hook run in a message mode buffer narrowed to the headers."
:group 'message-various
:type 'hook)
Note that `message-cite-original' uses `mail-citation-hook' if that is non-nil."
:type '(radio (function-item message-cite-original)
(function-item message-cite-original-without-signature)
+ (function-item mu-cite/cite-original)
(function-item sc-cite-original)
(function :tag "Other"))
:group 'message-insertion)
(defvar message-draft-coding-system
(cond
+ ((boundp 'MULE) '*junet*)
((not (fboundp 'find-coding-system)) nil)
- ((find-coding-system 'emacs-mule) 'emacs-mule)
+ ((find-coding-system 'emacs-mule)
+ (if (string-match "nt\\|windows" system-configuration)
+ 'emacs-mule-dos 'emacs-mule))
((find-coding-system 'escape-quoted) 'escape-quoted)
((find-coding-system 'no-conversion) 'no-conversion)
(t nil))
(autoload 'gnus-request-post "gnus-int")
(autoload 'gnus-copy-article-buffer "gnus-msg")
(autoload 'gnus-alive-p "gnus-util")
- (autoload 'rmail-output "rmail"))
+ (autoload 'rmail-output "rmail")
+ (autoload 'mu-cite/cite-original "mu-cite"))
\f
["Newline and Reformat" message-newline-and-reformat t]
["Rename buffer" message-rename-buffer t]
["Spellcheck" ispell-message t]
+ ["Attach file as MIME" mime-edit-insert-file t]
"----"
["Send Message" message-send-and-exit t]
["Abort Message" message-dont-send t]
"Major mode for editing mail and news to be sent.
Like Text Mode but with these additional commands:
C-c C-s message-send (send the message) C-c C-c message-send-and-exit
+C-c C-d Pospone sending the message C-c C-k Kill the message
C-c C-f move to a header field (and create it if there isn't):
C-c C-f C-t move to To C-c C-f C-s move to Subject
C-c C-f C-c move to Cc C-c C-f C-b move to Bcc
(goto-char (point-min))
(search-forward (concat "\n" mail-header-separator "\n") nil t)
(let ((fill-prefix message-yank-prefix))
- (fill-individual-paragraphs (point) (point-max) justifyp t))))
+ (fill-individual-paragraphs (point) (point-max) justifyp))))
(defun message-indent-citation ()
"Modify text just inserted from a message to be cited.
(defun message-delete-frame (frame org-frame)
"Delete frame for editing message."
- (when (and (or (and (featurep 'xemacs)
- (not (eq 'tty (device-type))))
- window-system
+ (when (and (or (static-if (featurep 'xemacs)
+ (device-on-window-system-p)
+ window-system)
(>= emacs-major-version 20))
(or (and (eq message-delete-frame-on-exit t)
(select-frame frame)
(car elem))))
(setq success (funcall (caddr elem) arg)))))
(setq sent t))))
+ (unless sent
+ (error "No methods specified to send by"))
(prog1
(when (and success sent)
(message-do-fcc)
;; Remove some headers.
(save-restriction
(message-narrow-to-headers)
+;; We Semi-gnus people have no use for it.
+;; ;; We (re)generate the Lines header.
+;; (when (memq 'Lines message-required-mail-headers)
+;; (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-mail-headers t))
(goto-char (point-max))
;; Remove some headers.
(save-restriction
(message-narrow-to-headers)
+;; We Semi-gnus people have no use for it.
+;; ;; We (re)generate the Lines header.
+;; (when (memq 'Lines message-required-mail-headers)
+;; (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-news-headers t))
(goto-char (point-max))
(defun message-check-news-header-syntax ()
(and
+ ;; Check Newsgroups header.
+ (message-check 'newsgroyps
+ (let ((group (message-fetch-field "newsgroups")))
+ (or
+ (and group
+ (not (string-match "\\`[ \t]*\\'" group)))
+ (ignore
+ (message
+ "The newsgroups field is empty or missing. Posting is denied.")))))
;; Check the Subject header.
(message-check 'subject
(let* ((case-fold-search t)
(message-check 'from
(let* ((case-fold-search t)
(from (message-fetch-field "from"))
- (ad (nth 1 (std11-extract-address-components from))))
+ ad)
(cond
((not from)
(message "There is no From line. Posting is denied.")
nil)
- ((or (not (string-match "@[^\\.]*\\." ad)) ;larsi@ifi
+ ((or (not (string-match
+ "@[^\\.]*\\."
+ (setq ad (nth 1 (mail-extract-address-components
+ from))))) ;larsi@ifi
(string-match "\\.\\." ad) ;larsi@ifi..uio
(string-match "@\\." ad) ;larsi@.ifi.uio
(string-match "\\.$" ad) ;larsi@ifi.uio.
"Process Fcc headers in the current buffer."
(let ((case-fold-search t)
(coding-system-for-write 'raw-text)
+ (output-coding-system 'raw-text)
list file)
(save-excursion
(set-buffer (get-buffer-create " *message temp*"))
;; colon, if there is none.
(if (/= (char-after) ? ) (insert " ") (forward-char 1))
;; Find out whether the header is empty...
- (looking-at "[ \t]*$")))
+ (looking-at "[ \t]*\n[^ \t]")))
;; So we find out what value we should insert.
(setq value
(cond
(t
(format "*%s message*" type))))
+(defmacro message-pop-to-buffer-1 (buffer)
+ `(if pop-up-frames
+ (let (special-display-buffer-names
+ special-display-regexps
+ same-window-buffer-names
+ same-window-regexps)
+ (pop-to-buffer ,buffer))
+ (pop-to-buffer ,buffer)))
+
(defun message-pop-to-buffer (name)
"Pop to buffer NAME, and warn if it already exists and is modified."
- (let ((pop-up-frames pop-up-frames)
- (special-display-buffer-names special-display-buffer-names)
- (special-display-regexps special-display-regexps)
- (same-window-buffer-names same-window-buffer-names)
- (same-window-regexps same-window-regexps)
- (buffer (get-buffer name))
- (cur (current-buffer)))
- (if (or (and (featurep 'xemacs)
- (not (eq 'tty (device-type))))
- window-system
- (>= emacs-major-version 20))
- (when message-use-multi-frames
- (setq pop-up-frames t
- special-display-buffer-names nil
- special-display-regexps nil
- same-window-buffer-names nil
- same-window-regexps nil))
- (setq pop-up-frames nil))
+ (let ((buffer (get-buffer name))
+ (pop-up-frames (and (or (static-if (featurep 'xemacs)
+ (device-on-window-system-p)
+ window-system)
+ (>= emacs-major-version 20))
+ message-use-multi-frames)))
(if (and buffer
(buffer-name buffer))
(progn
- (set-buffer (pop-to-buffer buffer))
+ (message-pop-to-buffer-1 buffer)
(when (and (buffer-modified-p)
(not (y-or-n-p
"Message already being composed; erase? ")))
(error "Message being composed")))
- (set-buffer (pop-to-buffer name)))
+ (message-pop-to-buffer-1 name))
(erase-buffer)
(message-mode)
(when pop-up-frames
- (make-local-variable 'message-original-frame)
- (setq message-original-frame (selected-frame)))))
+ (set (make-local-variable 'message-original-frame) (selected-frame)))))
(defun message-do-send-housekeeping ()
"Kill old message buffers."
message-auto-save-directory))
(setq buffer-auto-save-file-name (make-auto-save-file-name)))
(clear-visited-file-modtime)
- (setq buffer-file-coding-system message-draft-coding-system)))
+ (static-if (boundp 'MULE)
+ (set-file-coding-system message-draft-coding-system)
+ (setq buffer-file-coding-system message-draft-coding-system))))
(defun message-disassociate-draft ()
"Disassociate the message buffer from the drafts directory."
from subject date to cc
references message-id follow-to
(inhibit-point-motion-hooks t)
+ (message-this-is-mail t)
mct never-mct mft mrt gnus-warning in-reply-to)
(save-restriction
(message-narrow-to-head)
;;; MIME functions
;;;
-(defvar messgage-inhibit-body-encoding t)
+(defvar message-inhibit-body-encoding t)
(defun message-encode-message-body ()
- (unless messgage-inhibit-body-encoding
+ (unless message-inhibit-body-encoding
(let ((mail-parse-charset (or mail-parse-charset
message-default-charset
message-posting-charset))