(require 'smtp)
(defvar gnus-message-group-art)
(defvar gnus-list-identifiers)) ; gnus-sum is required where necessary
-(eval-and-compile
- (if (boundp 'MULE)
- (progn
- (require 'base64)
- (require 'canlock-om))
- (require 'canlock)))
+(require 'canlock)
(require 'mailheader)
(require 'nnheader)
;; This is apparently necessary even though things are autoloaded.
(require 'rfc822)
(eval-and-compile
- (autoload 'customize-save-variable "cus-edit") ;; for Mule 2.
- (autoload 'sha1 "sha1-el")
(autoload 'gnus-find-method-for-group "gnus")
(autoload 'nnvirtual-find-group-art "nnvirtual")
(autoload 'gnus-group-decoded-name "gnus-group"))
+(eval-when-compile
+ (autoload 'sha1 "sha1-el"))
(defgroup message '((user-mail-address custom-variable)
(user-full-name custom-variable))
(if (string-match "[[:digit:]]" "1") ;; support POSIX?
"\\([ \t]*[-_.[:word:]]+>+\\|[ \t]*[]>|}+]\\)+"
;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
- (let ((old-table (syntax-table))
- non-word-constituents)
- (set-syntax-table text-mode-syntax-table)
- (setq non-word-constituents
- (concat
- (if (string-match "\\w" "-") "" "-")
- (if (string-match "\\w" "_") "" "_")
- (if (string-match "\\w" ".") "" ".")))
- (set-syntax-table old-table)
+ (let (non-word-constituents)
+ (with-syntax-table text-mode-syntax-table
+ (setq non-word-constituents
+ (concat
+ (if (string-match "\\w" "-") "" "-")
+ (if (string-match "\\w" "_") "" "_")
+ (if (string-match "\\w" ".") "" "."))))
(if (equal non-word-constituents "")
"\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}+]\\)+"
(concat "\\([ \t]*\\(\\w\\|["
(defvar message-user-agent nil
"String of the form of PRODUCT/VERSION. Used for User-Agent header field.")
-(static-when (boundp 'MULE)
- (require 'reporter));; `define-mail-user-agent' is here.
-
;;;###autoload
(define-mail-user-agent 'message-user-agent
'message-mail 'message-send-and-exit
(autoload 'message-setup-toolbar "messagexmas")
(autoload 'mh-new-draft-name "mh-comp")
(autoload 'mh-send-letter "mh-comp")
- (autoload 'gnus-point-at-eol "gnus-util")
- (autoload 'gnus-point-at-bol "gnus-util")
(autoload 'gnus-output-to-rmail "gnus-util")
(autoload 'gnus-output-to-mail "gnus-util")
(autoload 'nndraft-request-associate-buffer "nndraft")
(when (message-goto-signature)
(forward-line -2)))
-(defun message-kill-to-signature ()
- "Deletes all text up to the signature."
- (interactive)
- (let ((point (point)))
- (message-goto-signature)
- (unless (eobp)
- (end-of-line -1))
- (kill-region point (point))
- (unless (bolp)
- (insert "\n"))))
+(defun message-kill-to-signature (&optional arg)
+ "Kill all text up to the signature.
+If a numberic argument or prefix arg is given, leave that number
+of lines before the signature intact."
+ (interactive "p")
+ (save-excursion
+ (save-restriction
+ (let ((point (point)))
+ (narrow-to-region point (point-max))
+ (message-goto-signature)
+ (unless (eobp)
+ (if (and arg (numberp arg))
+ (forward-line (- -1 arg))
+ (end-of-line -1)))
+ (unless (= point (point))
+ (kill-region point (point))
+ (insert "\n"))))))
(defun message-newline-and-reformat (&optional arg not-break)
"Insert four newlines, and then reformat if inside quoted text.
(defun message-delete-frame (frame org-frame)
"Delete frame for editing message."
- (when (and (or (static-if (featurep 'xemacs)
- (device-on-window-system-p)
- window-system)
- (>= emacs-major-version 20))
+ (when (and (static-if (featurep 'xemacs)
+ (device-on-window-system-p)
+ window-system)
(or (and (eq message-delete-frame-on-exit t)
(select-frame frame)
(or (eq frame org-frame)
font-lock-face highlight))))
(when hidden-start
(goto-char hidden-start)
- (set-window-start (selected-window) (gnus-point-at-bol))
+ (set-window-start (selected-window) (point-at-bol))
(unless (yes-or-no-p
"Invisible text found and made visible; continue sending? ")
(error "Invisible text found and made visible")))))
(defun message-canlock-generate ()
"Return a string that is non-trivial to guess.
Do not use this for anything important, it is cryptographically weak."
+ (require 'sha1-el)
(let (sha1-maximum-internal-length)
(sha1 (concat (message-unique-id)
(format "%x%x%x" (random) (random t) (random))
"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
(mml-externalize-attachments message-fcc-externalize-attachments))
(save-excursion
(forward-line -1)))
;; The value of this header was empty, so we clear
;; totally and insert the new value.
- (delete-region (point) (gnus-point-at-eol))
+ (delete-region (point) (point-at-eol))
;; If the header is optional, and the header was
;; empty, we can't insert it anyway.
(unless optionalp
(message-point-in-header-p))
(let* ((here (point))
(bol (progn (beginning-of-line n) (point)))
- (eol (gnus-point-at-eol))
+ (eol (point-at-eol))
(eoh (re-search-forward ": *" eol t)))
(if (or (not eoh) (equal here eoh))
(goto-char bol)
(defun message-pop-to-buffer (name)
"Pop to buffer NAME, and warn if it already exists and is modified."
(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))
+ (pop-up-frames (and (static-if (featurep 'xemacs)
+ (device-on-window-system-p)
+ window-system)
message-use-multi-frames)))
(if (and buffer
(buffer-name buffer))
message-auto-save-directory))
(setq buffer-auto-save-file-name (make-auto-save-file-name)))
(clear-visited-file-modtime)
- (static-if (boundp 'MULE)
- (set-file-coding-system message-draft-coding-system)
- (setq buffer-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."
:type '(alist :key-type regexp :value-type function))
(defcustom message-expand-name-function
- (if (fboundp 'bbdb-complete-name)
- 'bbdb-complete-name
- (if (fboundp 'lsdb-complete-name)
- 'lsdb-complete-name
- 'expand-abbrev))
+ (cond ((and (boundp 'eudc-protocol)
+ eudc-protocol)
+ 'eudc-expand-inline)
+ ((fboundp 'bbdb-complete-name)
+ 'bbdb-complete-name)
+ ((fboundp 'lsdb-complete-name)
+ 'lsdb-complete-name)
+ (t 'expand-abbrev))
"*A function called to expand addresses in field body."
:group 'message
:type 'function)