*** empty log message ***
[gnus] / lisp / message.el
index 73cc014..41351b6 100644 (file)
@@ -1,5 +1,5 @@
 ;;; message.el --- composing mail and news messages
 ;;; message.el --- composing mail and news messages
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996,97 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;; Keywords: mail, news
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;; Keywords: mail, news
@@ -29,8 +29,8 @@
 
 ;;; Code:
 
 
 ;;; Code:
 
-(eval-when-compile 
-  (require 'cl))
+(eval-when-compile (require 'cl))
+
 (require 'mailheader)
 (require 'rmail)
 (require 'nnheader)
 (require 'mailheader)
 (require 'rmail)
 (require 'nnheader)
     (require 'mail-abbrevs)
   (require 'mailabbrev))
 
     (require 'mail-abbrevs)
   (require 'mailabbrev))
 
-(defgroup message nil
+(defgroup message '((user-mail-address custom-variable)
+                   (user-full-name custom-variable))
   "Mail and news message composing."
   "Mail and news message composing."
-  :group 'emacs)
+  :link '(custom-manual "(message)Top")
+  :group 'mail
+  :group 'news)
+
+(put 'user-mail-address 'custom-type 'string)
+(put 'user-full-name 'custom-type 'string)
+
+(defgroup message-various nil
+  "Various Message Variables"
+  :link '(custom-manual "(message)Various Message Variables")
+  :group 'message)
+
+(defgroup message-buffers nil
+  "Message Buffers"
+  :link '(custom-manual "(message)Message Buffers")
+  :group 'message)
+
+(defgroup message-sending nil
+  "Message Sending"
+  :link '(custom-manual "(message)Sending Variables")
+  :group 'message)
+
+(defgroup message-interface nil
+  "Message Interface"
+  :link '(custom-manual "(message)Interface")
+  :group 'message)
+
+(defgroup message-forwarding nil
+  "Message Forwarding"
+  :link '(custom-manual "(message)Forwarding")
+  :group 'message-interface)
+
+(defgroup message-insertion nil
+  "Message Insertion"
+  :link '(custom-manual "(message)Insertion")
+  :group 'message)
+
+(defgroup message-headers nil
+  "Message Headers"
+  :link '(custom-manual "(message)Message Headers")
+  :group 'message)
+
+(defgroup message-news nil
+  "Composing News Messages"
+  :group 'message)
+
+(defgroup message-mail nil
+  "Composing Mail Messages"
+  :group 'message)
+
+(defgroup message-faces nil
+  "Faces used for message composing."
+  :group 'message
+  :group 'faces)
 
 (defcustom message-directory "~/Mail/"
   "*Directory from which all other mail file variables are derived."
 
 (defcustom message-directory "~/Mail/"
   "*Directory from which all other mail file variables are derived."
-  :group 'message
+  :group 'message-various
   :type 'directory)
 
 (defcustom message-max-buffers 10
   "*How many buffers to keep before starting to kill them off."
   :type 'directory)
 
 (defcustom message-max-buffers 10
   "*How many buffers to keep before starting to kill them off."
-  :group 'message
+  :group 'message-buffers
   :type 'integer)
 
 (defcustom message-send-rename-function nil
   "Function called to rename the buffer after sending it."
   :type 'integer)
 
 (defcustom message-send-rename-function nil
   "Function called to rename the buffer after sending it."
-  :group 'message
+  :group 'message-buffers
   :type 'function)
 
   :type 'function)
 
-;;;###autoload
-(defvar message-fcc-handler-function 'rmail-output
+(defcustom message-fcc-handler-function 'message-output
   "*A function called to save outgoing articles.
 This function will be called with the name of the file to store the
   "*A function called to save outgoing articles.
 This function will be called with the name of the file to store the
-article in.  The default function is `rmail-output' which saves in Unix
-mailbox format.")
-(put 'message-fcc-handler-function 
-     'custom-type '(radio (function-item rmail-output)
-                         (function :tag "Other")))
-(put 'message-fcc-handler-function
-     'factory-value '('rmail-output))
-(custom-add-to-group 'message 'message-fcc-handler-function 'custom-variable)
+article in.  The default function is `message-output' which saves in Unix
+mailbox format."
+  :type '(radio (function-item message-output)
+               (function :tag "Other"))
+  :group 'message-sending)
 
 (defcustom message-courtesy-message
   "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
 
 (defcustom message-courtesy-message
   "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
@@ -79,16 +129,16 @@ mailbox format.")
 If the string contains the format spec \"%s\", the Newsgroups
 the article has been posted to will be inserted there.
 If this variable is nil, no such courtesy message will be added."
 If the string contains the format spec \"%s\", the Newsgroups
 the article has been posted to will be inserted there.
 If this variable is nil, no such courtesy message will be added."
-  :group 'message
+  :group 'message-sending
   :type 'string)
 
 (defcustom message-ignored-bounced-headers "^\\(Received\\|Return-Path\\):"
   "*Regexp that matches headers to be removed in resent bounced mail."
   :type 'string)
 
 (defcustom message-ignored-bounced-headers "^\\(Received\\|Return-Path\\):"
   "*Regexp that matches headers to be removed in resent bounced mail."
-  :group 'message
+  :group 'message-interface
   :type 'regexp)
 
 ;;;###autoload
   :type 'regexp)
 
 ;;;###autoload
-(defvar message-from-style 'default
+(defcustom message-from-style 'default
   "*Specifies how \"From\" headers look.
 
 If `nil', they contain just the return address like:
   "*Specifies how \"From\" headers look.
 
 If `nil', they contain just the return address like:
@@ -99,17 +149,14 @@ If `angles', they look like:
        Elvis Parsley <king@grassland.com>
 
 Otherwise, most addresses look like `angles', but they look like
        Elvis Parsley <king@grassland.com>
 
 Otherwise, most addresses look like `angles', but they look like
-`parens' if `angles' would need quoting and `parens' would not.")
-(put 'message-from-style
-     'custom-type '(choice (const :tag "simple" nil)
-                          (const parens)
-                          (const angles)
-                          (const default)))
-(put 'message-from-style
-     'factory-value '('default))
-(custom-add-to-group 'message 'message-from-style 'custom-variable)
-
-(defvar message-syntax-checks nil
+`parens' if `angles' would need quoting and `parens' would not."
+  :type '(choice (const :tag "simple" nil)
+                (const parens)
+                (const angles)
+                (const default))
+  :group 'message-headers)
+
+(defcustom message-syntax-checks nil
   ;; Guess this one shouldn't be easy to customize...
   "Controls what syntax checks should not be performed on outgoing posts.
 To disable checking of long signatures, for instance, add
   ;; Guess this one shouldn't be easy to customize...
   "Controls what syntax checks should not be performed on outgoing posts.
 To disable checking of long signatures, for instance, add
@@ -120,65 +167,71 @@ Don't touch this variable unless you really know what you're doing.
 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
 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.")
+shorten-followup-to existing-newsgroups."
+  :group 'message-news)
 
 (defcustom message-required-news-headers
 
 (defcustom message-required-news-headers
-  '(From Newsgroups Subject Date Message-ID 
-        (optional . Organization) Lines 
+  '(From Newsgroups Subject Date Message-ID
+        (optional . Organization) Lines
         (optional . X-Newsreader))
   "Headers to be generated or prompted for when posting an article.
 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
 Message-ID.  Organization, Lines, In-Reply-To, Expires, and
 X-Newsreader are optional.  If don't you want message to insert some
 header, remove it from this list."
         (optional . X-Newsreader))
   "Headers to be generated or prompted for when posting an article.
 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
 Message-ID.  Organization, Lines, In-Reply-To, Expires, and
 X-Newsreader are optional.  If don't you want message to insert some
 header, remove it from this list."
-  :group 'message
-  :type 'sexp)
+  :group 'message-news
+  :group 'message-headers
+  :type '(repeat sexp))
 
 
-(defcustom message-required-mail-headers 
+(defcustom message-required-mail-headers
   '(From Subject Date (optional . In-Reply-To) Message-ID Lines
         (optional . X-Mailer))
   "Headers to be generated or prompted for when mailing a message.
 RFC822 required that From, Date, To, Subject and Message-ID be
 included.  Organization, Lines and X-Mailer are optional."
   '(From Subject Date (optional . In-Reply-To) Message-ID Lines
         (optional . X-Mailer))
   "Headers to be generated or prompted for when mailing a message.
 RFC822 required that From, Date, To, Subject and Message-ID be
 included.  Organization, Lines and X-Mailer are optional."
-  :group 'message
-  :type 'sexp)
+  :group 'message-mail
+  :group 'message-headers
+  :type '(repeat sexp))
 
 (defcustom message-deletable-headers '(Message-ID Date Lines)
   "Headers to be deleted if they already exist and were generated by message previously."
 
 (defcustom message-deletable-headers '(Message-ID Date Lines)
   "Headers to be deleted if they already exist and were generated by message previously."
-  :group 'message
+  :group 'message-headers
   :type 'sexp)
 
   :type 'sexp)
 
-(defcustom message-ignored-news-headers 
+(defcustom message-ignored-news-headers
   "^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:\\|^Fcc:\\|^Resent-Fcc:"
   "*Regexp of headers to be removed unconditionally before posting."
   "^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:\\|^Fcc:\\|^Resent-Fcc:"
   "*Regexp of headers to be removed unconditionally before posting."
-  :group 'message
+  :group 'message-news
+  :group 'message-headers
   :type 'regexp)
 
 (defcustom message-ignored-mail-headers "^Gcc:\\|^Fcc:\\|^Resent-Fcc:"
   "*Regexp of headers to be removed unconditionally before mailing."
   :type 'regexp)
 
 (defcustom message-ignored-mail-headers "^Gcc:\\|^Fcc:\\|^Resent-Fcc:"
   "*Regexp of headers to be removed unconditionally before mailing."
-  :group 'message
+  :group 'message-mail
+  :group 'message-headers
   :type 'regexp)
 
 (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|Return-Path:\\|^Supersedes:"
   "*Header lines matching this regexp will be deleted before posting.
 It's best to delete old Path and Date headers before posting to avoid
 any confusion."
   :type 'regexp)
 
 (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|Return-Path:\\|^Supersedes:"
   "*Header lines matching this regexp will be deleted before posting.
 It's best to delete old Path and Date headers before posting to avoid
 any confusion."
-  :group 'message
+  :group 'message-interface
   :type 'regexp)
 
 ;;;###autoload
   :type 'regexp)
 
 ;;;###autoload
-(defvar message-signature-separator "^-- *$"
-  "Regexp matching the signature separator.")
-(put 'message-signature-separator
-     'custom-type 'regexp)
-(put 'message-signature-separator
-     'factory-value '("^-- *$"))
-(custom-add-to-group 'message 'message-signature-separator 'custom-variable)
-
-(defcustom message-interactive nil 
+(defcustom message-signature-separator "^-- *$"
+  "Regexp matching the signature separator."
+  :type 'regexp
+  :group 'message-various)
+
+(defcustom message-elide-elipsis "\n[...]\n\n"
+  "*The string which is inserted for elided text.")
+
+(defcustom message-interactive nil
   "Non-nil means when sending a message wait for and display errors.
 nil means let mailer mail back a message to report errors."
   "Non-nil means when sending a message wait for and display errors.
 nil means let mailer mail back a message to report errors."
-  :group 'message
+  :group 'message-sending
+  :group 'message-mail
   :type 'boolean)
 
 (defcustom message-generate-new-buffers t
   :type 'boolean)
 
 (defcustom message-generate-new-buffers t
@@ -186,144 +239,147 @@ nil means let mailer mail back a message to report errors."
 If this is a function, call that function with three parameters:  The type,
 the to address and the group name.  (Any of these may be nil.)  The function
 should return the new buffer name."
 If this is a function, call that function with three parameters:  The type,
 the to address and the group name.  (Any of these may be nil.)  The function
 should return the new buffer name."
-  :group 'message
+  :group 'message-buffers
   :type '(choice (const :tag "off" nil)
                 (const :tag "on" t)
                 (function fun)))
 
 (defcustom message-kill-buffer-on-exit nil
   "*Non-nil means that the message buffer will be killed after sending a message."
   :type '(choice (const :tag "off" nil)
                 (const :tag "on" t)
                 (function fun)))
 
 (defcustom message-kill-buffer-on-exit nil
   "*Non-nil means that the message buffer will be killed after sending a message."
-  :group 'message
+  :group 'message-buffers
   :type 'boolean)
 
 (defvar gnus-local-organization)
   :type 'boolean)
 
 (defvar gnus-local-organization)
-(defcustom message-user-organization 
+(defcustom message-user-organization
   (or (and (boundp 'gnus-local-organization)
   (or (and (boundp 'gnus-local-organization)
+          (stringp gnus-local-organization)
           gnus-local-organization)
       (getenv "ORGANIZATION")
       t)
   "*String to be used as an Organization header.
 If t, use `message-user-organization-file'."
           gnus-local-organization)
       (getenv "ORGANIZATION")
       t)
   "*String to be used as an Organization header.
 If t, use `message-user-organization-file'."
-  :group 'message
+  :group 'message-headers
   :type '(choice string
                 (const :tag "consult file" t)))
 
 ;;;###autoload
   :type '(choice string
                 (const :tag "consult file" t)))
 
 ;;;###autoload
-(defvar message-user-organization-file "/usr/lib/news/organization"
-  "*Local news organization file.")
-(put 'message-user-organization-file
-     'custom-type 'file)
-(put 'message-user-organization-file
-     'factory-value '("/usr/lib/news/organization"))
-(custom-add-to-group 'message 'message-user-organization-file 'custom-variable)
-
-(defcustom message-autosave-directory "~/"
-  ; (concat (file-name-as-directory message-directory) "drafts/")
-  "*Directory where message autosaves buffers.
-If nil, message won't autosave."
-  :group 'message
+(defcustom message-user-organization-file "/usr/lib/news/organization"
+  "*Local news organization file."
+  :type 'file
+  :group 'message-headers)
+
+(defcustom message-autosave-directory
+  (nnheader-concat message-directory "drafts/")
+  "*Directory where Message autosaves buffers.
+If nil, Message won't autosave."
+  :group 'message-buffers
   :type 'directory)
 
   :type 'directory)
 
-(defcustom message-forward-start-separator 
+(defcustom message-forward-start-separator
   "------- Start of forwarded message -------\n"
   "*Delimiter inserted before forwarded messages."
   "------- Start of forwarded message -------\n"
   "*Delimiter inserted before forwarded messages."
-  :group 'message
+  :group 'message-forwarding
   :type 'string)
 
 (defcustom message-forward-end-separator
   "------- End of forwarded message -------\n"
   "*Delimiter inserted after forwarded messages."
   :type 'string)
 
 (defcustom message-forward-end-separator
   "------- End of forwarded message -------\n"
   "*Delimiter inserted after forwarded messages."
-  :group 'message
+  :group 'message-forwarding
   :type 'string)
 
 (defcustom message-signature-before-forwarded-message t
   "*If non-nil, put the signature before any included forwarded message."
   :type 'string)
 
 (defcustom message-signature-before-forwarded-message t
   "*If non-nil, put the signature before any included forwarded message."
-  :group 'message
+  :group 'message-forwarding
   :type 'boolean)
 
   :type 'boolean)
 
-(defcustom message-included-forward-headers 
+(defcustom message-included-forward-headers
   "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-\\|^Message-ID:\\|^References:"
 &nbs