*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 08:35:49 +0000 (08:35 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 08:35:49 +0000 (08:35 +0000)
lisp/ChangeLog
lisp/browse-url.el
lisp/gnus-msg.el
lisp/gnus-score.el
lisp/gnus.el
lisp/message.el
lisp/nndir.el
lisp/nneething.el
lisp/nnheader.el

index da95c31..aed0c7f 100644 (file)
@@ -1,5 +1,49 @@
+Fri Mar 29 07:38:59 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>
+
+       * gnus.el (gnus-read-active-file): Activate secondary groups.
+
+Fri Mar 29 07:44:06 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>
+
+       * nneething.el (nneething-get-head): Would return nil on proper
+       heads. 
+
+Sat Mar 23 22:19:09 1996  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+       * browse-url.el (browse-url-netscape): Start remote netscape in
+       the background.  Use sentinel to start a new netscape if the
+       remote can't connect.
+
+Fri Mar 29 05:22:50 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>
+
+       * message.el (message-send-mail): Would remove ignored news
+       headers. 
+
+       * gnus.el (gnus-news-group-p): Moved function here. 
+       (gnus-summary-refer-article): Use it.
+       (gnus-group-best-unread-group): Wouldn't work under topics.
+
+       * message.el (message-cite-function): New variable.
+       (message-cite-original): New function.
+       (message-yank-original): Use it.
+       (message-make-domain): New definition.
+       (message-make-address): Ditto.
+       (message-make-message-id): New definition.
+       (message-insert-signature): Interactive `force' of signature.
+
+Fri Mar 29 06:01:56 1996  Lars Magne Ingebrigtsen  <larsi@nipling.ifi.uio.no>
+
+       * gnus-msg.el (gnus-summary-mail-other-window): Restore window
+       conf. 
+
+Thu Mar 28 10:15:06 1996  Lars Magne Ingebrigtsen  <lars@eyesore.no>
+
+       * message.el (nnheader): Require nnheader.
+       (message-mode): Doc fix.
+
 Thu Mar 28 06:12:28 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>
 
+       * gnus.el: September Gnus v0.60 is released.
+
        * message.el (message-send-mail): Remove Gcc header.
        (message-setup): Would insert default headers in the body.
 
index 7cb6dd7..e2fba9a 100644 (file)
@@ -525,19 +525,25 @@ used instead of browse-url-new-window-p."
   (interactive (append (browse-url-interactive-arg "Netscape URL: ")
                       (list (not (eq (null browse-url-new-window-p)
                                      (null current-prefix-arg))))))
-  (or (zerop
-       (apply 'call-process "netscape" nil nil nil
-             (append browse-url-netscape-arguments
-                     (if new-window '("-noraise"))
-                     (list "-remote" 
-                           (concat "openURL(" url 
-                                   (if new-window ",new-window")
-                                   ")")))))
-      (progn                           ; Netscape not running - start it
-       (message "Starting Netscape...")
-       (apply 'start-process "netscape" nil
-              browse-url-netscape-command
-              (append browse-url-netscape-arguments (list url))))))
+  (let ((process (apply 'start-process
+                       (concat "netscape " url) nil
+                       browse-url-netscape-command
+                       (append browse-url-netscape-arguments
+                               (if new-window '("-noraise"))
+                               (list "-remote" 
+                                     (concat "openURL(" url 
+                                             (if new-window ",new-window")
+                                             ")"))))))
+    (set-process-sentinel 
+     process 
+     `(lambda (process change)
+       (or (eq (process-exit-status process) 0)
+           (progn
+             ;; Netscape not running - start it
+             (message "Starting Netscape...")
+             (apply 'start-process (concat "netscape" ,url) nil
+                    browse-url-netscape-command
+                    (append browse-url-netscape-arguments (list ,url)))))))))
 
 (defun browse-url-netscape-reload ()
   "Ask Netscape to reload its current document."
index 5706f00..3692bce 100644 (file)
@@ -384,12 +384,6 @@ If SILENT, don't prompt the user."
      ;; Use the normal select method.
      (t gnus-select-method))))
 
-(defun gnus-news-group-p (group &optional article)
-  "Return non-nil if GROUP (and ARTICLE) come from a news server."
-  (or (gnus-member-of-valid 'post group) ; Ordinary news group.
-      (and (gnus-member-of-valid 'post-mail group) ; Combined group.
-          (eq (gnus-request-type group article) 'news))))
-
 (defun gnus-inews-narrow-to-headers ()
   (widen)
   (narrow-to-region
@@ -558,8 +552,8 @@ The current group name will be inserted at \"%s\".")
 (defun gnus-summary-mail-other-window ()
   "Compose mail in other window."
   (interactive)
-  (gnus-set-global-variables)
-  (message-mail))
+  (gnus-setup-message 'message
+    (message-mail)))
 
 (defun gnus-mail-parse-comma-list ()
   (let (accumulated
index dd4d1c9..681f4c6 100644 (file)
@@ -1323,8 +1323,7 @@ SCORE is the score to add."
        (while articles
          (setq article (mail-header-number (caar articles)))
          (gnus-message 7 "Scoring on article %s of %s..." article last)
-         (if (not (funcall request-func article gnus-newsgroup-name))
-             ()
+         (when (funcall request-func article gnus-newsgroup-name)
            (widen)
            (goto-char (point-min))
            ;; If just parts of the article is to be searched, but the
index 8fe5446..8e8fb6c 100644 (file)
@@ -1688,7 +1688,7 @@ variable (string, integer, character, etc).")
   "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
   "The mail address of the Gnus maintainers.")
 
-(defconst gnus-version "September Gnus v0.60"
+(defconst gnus-version "September Gnus v0.61"
   "Version number for this version of Gnus.")
 
 (defvar gnus-info-nodes
@@ -3565,6 +3565,12 @@ that that variable is buffer-local to the summary buffers."
   (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
                        gnus-valid-select-methods)))
 
+(defun gnus-news-group-p (group &optional article)
+  "Return non-nil if GROUP (and ARTICLE) come from a news server."
+  (or (gnus-member-of-valid 'post group) ; Ordinary news group.
+      (and (gnus-member-of-valid 'post-mail group) ; Combined group.
+          (eq (gnus-request-type group article) 'news))))
+
 (defsubst gnus-simplify-subject-fully (subject)
   "Simplify a subject string according to the user's wishes."
   (cond
@@ -5320,7 +5326,8 @@ If EXCLUDE-GROUP, do not go to that group."
   (goto-char (point-min))
   (let ((best 100000)
        unread best-point)
-    (while (setq unread (get-text-property (point) 'gnus-unread))
+    (while (not (eobp))
+      (setq unread (get-text-property (point) 'gnus-unread))
       (if (and (numberp unread) (> unread 0))
          (progn
            (if (and (get-text-property (point) 'gnus-level)
@@ -10813,7 +10820,9 @@ Return how many articles were fetched."
          ;; The article is present in the buffer, to we just go to it.
          (gnus-summary-goto-article (mail-header-number header) nil t)
        ;; We fetch the article
-       (let ((gnus-override-method gnus-refer-article-method)
+       (let ((gnus-override-method 
+              (and (gnus-news-group-p gnus-newsgroup-name)
+                   gnus-refer-article-method))
              number)
          ;; Start the special refer-article method, if necessary.
          (when gnus-refer-article-method
@@ -15736,9 +15745,7 @@ Returns whether the updating was successful."
             ((and (eq gnus-read-active-file 'some)
                   (gnus-check-backend-function 'retrieve-groups (car method)))
              (let ((newsrc (cdr gnus-newsrc-alist))
-                   (gmethod (if (stringp method)
-                                (gnus-server-get-method nil method)
-                              method))
+                   (gmethod (gnus-server-get-method nil method))
                    groups info)
                (while (setq info (pop newsrc))
                  (when (gnus-server-equal
index 394084f..638996f 100644 (file)
 (eval-when-compile 
   (require 'cl))
 (require 'mail-header)
+(require 'nnheader)
 
+;;;###autoload
 (defvar message-fcc-handler-function 'rmail-output
   "*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.")
 
+;;;###autoload
 (defvar message-courtesy-message
   "The following message is a courtesy copy of an article\nthat has been posted as well.\n\n"
   "*This is inserted at the start of a mailed copy of a posted message.
 If this variable is nil, no such courtesy message will be added.")
 
+;;;###autoload
 (defvar message-ignored-bounced-headers "^\\(Received\\):"
   "*Regexp that matches headers to be removed in resent bounced mail.")
 
+;;;###autoload
 (defvar message-from-style 'angles 
   "*Specifies how \"From\" headers look.
 
@@ -57,6 +62,7 @@ If `parens', they look like:
 If `angles', they look like:
        Elvis Parsley <king@grassland.com>")
 
+;;;###autoload
 (defvar message-syntax-checks
   '(subject-cmsg multiple-headers sendsys message-id from
                 long-lines control-chars size new-text
@@ -66,8 +72,10 @@ If `angles', they look like:
 If this variable is t, message will check everything it can.  If it is
 a list, then those elements in that list will be checked.")
 
+;;;###autoload
 (defvar message-required-news-headers
-  '(From Date Newsgroups Subject Message-ID Organization Lines 
+  '(From Date Newsgroups Subject 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,
@@ -75,6 +83,7 @@ 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.")
 
+;;;###autoload
 (defvar message-required-mail-headers 
   '(From Date To Subject (optional . In-Reply-To) Message-ID Lines
         (optional . X-Mailer))
@@ -82,39 +91,48 @@ header, remove it from this list.")
 RFC822 required that From, Date, To, Subject and Message-ID be
 included.  Organization, Lines and X-Mailer are optional.")
 
+;;;###autoload
 (defvar message-deletable-headers '(Message-ID Date)
   "*Headers to be deleted if they already exist and were generated by message previously.")
 
+;;;###autoload
 (defvar message-ignored-news-headers 
   "^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:"
   "*Regexp of headers to be removed unconditionally before posting.")
 
+;;;###autoload
 (defvar message-ignored-mail-headers "^Gcc:"
   "*Regexp of headers to be removed unconditionally before mailing.")
 
+;;;###autoload
 (defvar message-ignored-supersedes-headers
   "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|Return-Path:"
   "*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.")
 
+;;;###autoload
 (defvar message-signature-separator "^-- *$"
   "Regexp matching signature separator.")
 
+;;;###autoload
 (defvar 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.")
 
 (defvar gnus-local-organization)
+;;;###autoload
 (defvar message-user-organization 
   (if (boundp 'gnus-local-organization)
       gnus-local-organization t)
   "*String to be used as an Organization header.
 If t, use `message-user-organization-file'.")
 
+;;;###autoload
 (defvar message-user-organization-file "/usr/lib/news/organization"
   "*Local news organization file.")
 
+;;;###autoload
 (defvar message-autosave-directory "~/Mail/drafts/"
   "*Directory where message autosaves buffers.
 If nil, message won't autosave.")
@@ -127,13 +145,16 @@ If nil, message won't autosave.")
   "------- End of forwarded message -------\n"
   "*Delimiter inserted after forwarded messages.")
 
+;;;###autoload
 (defvar message-signature-before-forwarded-message t
   "*If non-nil, put the signature before any included forwarded message.")
 
+;;;###autoload
 (defvar 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:"
   "*Regexp matching headers to be included in forwarded messages.")
 
+;;;###autoload
 (defvar message-ignored-resent-headers "^Return-receipt"
   "*All headers that match this regexp will be deleted when resending a message.")
 
@@ -148,20 +169,25 @@ If nil, message won't autosave.")
 The headers should be delimited by a line whose contents match the
 variable `message-header-separator'.")
 
+;;;###autoload
 (defvar message-send-news-function 'message-send-news
   "Function to call to send the current buffer as news.
 The headers should be delimited by a line whose contents match the
 variable `message-header-separator'.")
 
+;;;###autoload
 (defvar message-reply-to-function nil
   "Function that should return a list of headers.")
 
+;;;###autoload
 (defvar message-wide-reply-to-function nil
   "Function that should return a list of headers.")
 
+;;;###autoload
 (defvar message-followup-to-function nil
   "Function that should return a list of headers.")
 
+;;;###autoload
 (defvar message-use-followup-to 'ask
   "*Specifies what to do with Followup-To header.
 If nil, ignore the header. If it is t, use its value, but ignore
@@ -169,6 +195,7 @@ If nil, ignore the header. If it is t, use its value, but ignore
 ignore the \"poster\" value.  If it is the symbol `use', always use
 the value.")
 
+;;;###autoload
 (defvar message-post-method 
   (cond ((boundp 'gnus-post-method)
         gnus-post-method)
@@ -177,6 +204,7 @@ the value.")
        (t '(nnspool "")))
   "Method used to post news.")
 
+;;;###autoload
 (defvar message-generate-headers-first nil
   "*If non-nil, generate all possible headers before composing.")
 
@@ -202,12 +230,10 @@ This file need not actually exist.")
   "Normal hook, run each time a new outgoing message is initialized.
 The function `message-setup' runs this hook.")
 
-(defvar message-cite-hook nil
-  "Hook run when yanking articles.")
-
 (defvar message-header-setup-hook nil
   "Hook called narrowed to the headers when setting up a message buffer.")
 
+;;;###autoload
 (defvar message-citation-line-function 'message-insert-citation-line
   "*Function called to insert the \"Whomever writes:\" line.")
 
@@ -222,6 +248,7 @@ The alias definitions in the file have this form:
 (defvar message-alias-modtime nil
   "The modification time of your mail alias file when it was last examined.")
 
+;;;###autoload
 (defvar message-yank-prefix "> "
   "*Prefix inserted on the lines of yanked messages.
 nil means use indentation.")
@@ -230,6 +257,11 @@ nil means use indentation.")
   "*Number of spaces to insert at the beginning of each cited line.
 Used by `message-yank-original' via `message-yank-cite'.")
 
+;;;###autoload
+(defvar message-cite-function 'message-cite-original
+  "*Function for citing an original message.")
+
+;;;###autoload
 (defvar message-indent-citation-function 'message-indent-citation
   "*Function for modifying a citation just inserted in the mail buffer.
 This can also be a list of functions.  Each function can find the
@@ -249,12 +281,14 @@ Optional second arg EXCLUDE may be a regular expression defining text to be
 removed from alias expansions."
   nil)
 
+;;;###autoload
 (defvar message-signature t
   "*String to be inserted at the and the the message buffer.
 If t, the `message-signature-file' file will be inserted instead.
 If a function, the result from the function will be used instead.
 If a form, the result from the form will be used instead.")
 
+;;;###autoload
 (defvar message-signature-file "~/.signature"
   "*File containing the text inserted at end of mail buffer.")
 
@@ -268,12 +302,6 @@ If a form, the result from the form will be used instead.")
   "If nil, use the NNTP server name in the Path header.
 If stringp, use this; if non-nil, use no host name (user name only).")
 
-(defvar message-generic-domain nil
-  "If nil, the full host name will be the system name prepended to the domain name.
-If this is a string, the full host name will be this string.
-If this is non-nil, non-string, the domain name will be used as the
-full host name.")
-
 (defvar message-reply-buffer nil)
 (defvar message-reply-headers nil)
 (defvar message-newsreader nil)
@@ -283,14 +311,17 @@ full host name.")
 (defvar message-send-actions nil
   "A list of actions to be performed upon successful sending of a message.")
 
+;;;###autoload
 (defvar message-default-headers nil
   "*A string containing header lines to be inserted in outgoing messages.
 It is inserted before you edit the message, so you can edit or delete
 these lines.")
 
+;;;###autoload
 (defvar message-default-mail-headers nil
   "*A string of header lines to be inserted in outgoing mails.")
 
+;;;###autoload
 (defvar message-default-news-headers nil
   "*A string of header lines to be inserted in outgoing news articles.")
 
@@ -559,20 +590,19 @@ Return the number of headers removed."
 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-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:
-        C-c C-f C-f  move to FCC:      C-c C-f C-r  move to Reply-To:
-        C-c C-f C-u  move to Summary:  C-c C-f C-n  move to Newsgroups:
-        C-c C-f C-k  move to Kewords:  C-c C-f C-d  move to Distribution:
-        C-c C-f C-o  move to Followup-To:
-C-c C-t  message-insert-to (add a To: header to a news followup)
-C-c C-n  message-insert-newsgroups (add a Newsgroup: header to a news reply)
-C-c C-b  message-goto-text (move to beginning of message text).
+        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
+        C-c C-f C-f  move to Fcc       C-c C-f C-r  move to Reply-To
+        C-c C-f C-u  move to Summary   C-c C-f C-n  move to Newsgroups
+        C-c C-f C-k  move to Keywords  C-c C-f C-d  move to Distribution
+        C-c C-f C-o  move to Followup-To
+C-c C-t  message-insert-to (add a To header to a news followup)
+C-c C-n  message-insert-newsgroups (add a Newsgroup header to a news reply)
+C-c C-b  message-goto-body (move to beginning of message text).
 C-c C-s  message-goto-signature (move to the beginning of the signature).
 C-c C-w  message-insert-signature (insert `message-signature-file' file).
 C-c C-y  message-yank-original (insert current message, if any).
 C-c C-q  message-fill-yanked-message (fill what was yanked).
-C-c C-v  message-sent-via (add a Sent-via field for each To or CC).
 C-c C-r  message-ceasar-buffer-body (rot13 the message body)."
   (interactive)
   (kill-all-local-variables)
@@ -701,11 +731,14 @@ or the line sollowing `message-signature-separator'."
 
 ;;; Various commands
 
-(defun message-insert-signature ()
+(defun message-insert-signature (&optional force)
   "Insert a signature.  See documentation for the `message-signature' variable."
-  (interactive)
+  (interactive (list t))
   (let* ((signature 
-         (cond ((message-functionp message-signature)
+         (cond ((and (null message-signature)
+                     force)
+                t)
+               ((message-functionp message-signature)
                 (funcall message-signature))
                ((listp message-signature)
                 (eval message-signature))
@@ -832,30 +865,12 @@ if `message-yank-prefix' is non-nil, insert that prefix on each line.
 Just \\[universal-argument] as argument means don't indent, insert no
 prefix, and don't delete any headers."
   (interactive "P")
-  (when message-reply-buffer
-    (let ((start (point))
-         (functions 
-          (when message-indent-citation-function
-            (if (listp message-indent-citation-function)
-                message-indent-citation-function
-              (list message-indent-citation-function))))
-         (modified (buffer-modified-p)))
-      ;; If the original message is in another window in the same frame,
-      ;; delete that window to save screen space.
-      ;; t means don't alter other frames.
+  (let ((modified (buffer-modified-p)))
+    (when (and message-reply-buffer
+              message-cite-function)
       (delete-windows-on message-reply-buffer t)
       (insert-buffer message-reply-buffer)
-      (unless (consp arg)
-       (goto-char start)
-       (let ((message-indentation-spaces
-              (if arg (prefix-numeric-value arg)
-                message-indentation-spaces)))
-         (while functions
-           (funcall (pop functions)))))
-      (when message-citation-line-function
-       (unless (bolp)
-         (insert "\n"))
-       (funcall message-citation-line-function))
+      (funcall message-cite-function)
       ;; This is like exchange-point-and-mark, but doesn't activate the mark.
       ;; It is cleaner to avoid activation, even though the command
       ;; loop would deactivate the mark because we inserted text.
@@ -864,8 +879,26 @@ prefix, and don't delete any headers."
       (unless (bolp)
        (insert ?\n))
       (unless modified
-       (setq message-checksum (message-checksum)))
-      (run-hooks 'message-cite-hook))))
+       (setq message-checksum (message-checksum))))))
+
+(defun message-cite-original ()    
+  (let ((start (point))
+       (functions 
+        (when message-indent-citation-function
+          (if (listp message-indent-citation-function)
+              message-indent-citation-function
+            (list message-indent-citation-function)))))
+    (unless (consp arg)
+      (goto-char start)
+      (let ((message-indentation-spaces
+            (if arg (prefix-numeric-value arg)
+              message-indentation-spaces)))
+       (while functions
+         (funcall (pop functions)))))
+    (when message-citation-line-function
+      (unless (bolp)
+       (insert "\n"))
+      (funcall message-citation-line-function))))
 
 (defun message-insert-citation-line ()
   "Function that inserts a simple citation line."
@@ -1022,7 +1055,7 @@ the user from the mailer."
          (save-restriction
            (message-narrow-to-headers)
            ;; Remove some headers.
-           (message-remove-header message-ignored-news-headers t))
+           (message-remove-header message-ignored-mail-headers t))
          (goto-char (point-max))
          ;; require one newline at the end.
          (or (= (preceding-char) ?\n)
@@ -1395,7 +1428,19 @@ the user from the mailer."
 
 (defun message-make-message-id ()
   "Make a unique Message-ID."
-  (concat "<" (message-unique-id) "@" (message-make-fqdm) ">"))
+  (concat "<" (message-unique-id) 
+         (let ((psubject (save-excursion (mail-fetch-field "subject"))))
+           (if (and message-reply-headers
+                    (mail-header-references message-reply-headers)
+                    (mail-header-subject message-reply-headers)
+                    psubject
+                    (mail-header-subject message-reply-headers)
+                    (not (string= 
+                          (message-strip-subject-re
+                           (mail-header-subject message-reply-headers))
+                          (message-strip-subject-re psubject))))
+               "_-_" ""))
+         "@" (message-make-fqdm) ">"))
 
 (defvar message-unique-id-char nil)
 
@@ -1562,18 +1607,21 @@ give as trustworthy answer as possible."
 
 (defun message-make-address ()
   "Make the address of the user."
-  (concat (user-login-name) "@" (message-make-domain)))
+  (or user-mail-address
+      (concat (user-login-name) "@" (message-make-domain))))
 
 (defun message-make-fqdm ()
   "Return user's fully qualified domain name."
   (let ((system-name (system-name)))
-    (if (string-match "[^.]\\.[^.]" system-name)
-       ;; `system-name' returned the right result.
-       system-name
-      ;; We try `user-mail-address' as a backup.
-      (if (string-match "@\\([^ ]+\\)\\($\\| \\)" user-mail-address)
-         (match-string 1 user-mail-address)
-       (concat system-name ".i-have-a-misconfigured-system-so-shoot-me")))))
+    (cond 
+     ((string-match "[^.]\\.[^.]" system-name)
+      ;; `system-name' returned the right result.
+      system-name)
+     ;; We try `user-mail-address' as a backup.
+     ((string-match "@\\(\\W+\\)\\(\\'\\|\\W\\)" user-mail-address)
+      (match-string 1 user-mail-address))
+     (t
+      (concat system-name ".i-have-a-misconfigured-system-so-shoot-me")))))
 
 (defun message-make-host-name ()
   "Return the name of the host."
@@ -1583,12 +1631,8 @@ give as trustworthy answer as possible."
 
 (defun message-make-domain ()
   "Return the domain name."
-  (let ((fqdm (message-make-fqdm)))
-    (if message-generic-domain
-       (progn
-         (string-match "^[^.]+\\." fqdm)
-         (substring fqdm (match-end 0)))
-      fqdm)))
+  (or mail-host-address
+      (message-make-fqdm)))
 
 (defun message-generate-headers (headers)
   "Prepare article HEADERS.
@@ -1620,22 +1664,6 @@ Headers already prepared in the buffer are not modified."
               (get-text-property (1+ (match-beginning 0)) 'message-deletable)
               (message-delete-line))
          (pop headers)))
-      ;; If there are References, and the subject has changed, then
-      ;; we have to change the Message-ID.  See Son-of-1036.
-      (when (and message-reply-headers
-                (mail-fetch-field "references"))
-       (let ((psubject (mail-fetch-field "subject")))
-         (and psubject (mail-header-subject message-reply-headers)
-              (string= (message-strip-subject-re
-                        (mail-header-subject message-reply-headers))
-                       (message-strip-subject-re
-                        psubject))
-              (progn
-                (string-match "@" Message-ID)
-                (setq Message-ID
-                      (concat (substring Message-ID 0 (match-beginning 0))
-                              "_-_" 
-                              (substring Message-ID (match-beginning 0))))))))
       ;; Go through all the required headers and see if they are in the
       ;; articles already. If they are not, or are empty, they are
       ;; inserted automatically - except for Subject, Newsgroups and
@@ -2240,6 +2268,60 @@ you."
       (insert mail-header-separator))
     (message-position-point)))
 
+;;;
+;;; Interactive entry points for new message buffers.
+;;;
+
+;;;###autoload
+(defun message-mail-other-window (&optional to subject)
+  "Like `message-mail' command, but display mail buffer in another window."
+  (interactive)
+  (let ((pop-up-windows t)
+       (special-display-buffer-names nil)
+       (special-display-regexps nil)
+       (same-window-buffer-names nil)
+       (same-window-regexps nil))
+    (message-pop-to-buffer "*mail message*"))
+  (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))))
+
+;;;###autoload
+(defun message-mail-other-frame (&optional to subject)
+  "Like `message-mail' command, but display mail buffer in another frame."
+  (interactive)
+  (let ((pop-up-frames t)
+       (special-display-buffer-names nil)
+       (special-display-regexps nil)
+       (same-window-buffer-names nil)
+       (same-window-regexps nil))
+    (message-pop-to-buffer "*mail message*"))
+  (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))))
+
+;;;###autoload
+(defun message-news-other-window (&optional newsgroups subject)
+  "Start editing a news article to be sent."
+  (interactive)
+  (let ((pop-up-windows t)
+       (special-display-buffer-names nil)
+       (special-display-regexps nil)
+       (same-window-buffer-names nil)
+       (same-window-regexps nil))
+    (message-pop-to-buffer "*news message*"))
+  (message-setup `((Newsgroups . ,(or newsgroups "")) 
+                  (Subject . ,(or subject "")))))
+
+;;;###autoload
+(defun message-news-other-frame (&optional newsgroups subject)
+  "Start editing a news article to be sent."
+  (interactive)
+  (let ((pop-up-frames t)
+       (special-display-buffer-names nil)
+       (special-display-regexps nil)
+       (same-window-buffer-names nil)
+       (same-window-regexps nil))
+    (message-pop-to-buffer "*news message*"))
+  (message-setup `((Newsgroups . ,(or newsgroups "")) 
+                  (Subject . ,(or subject "")))))
+
 (provide 'message)
 
 ;;; message.el ends here
index 20b9585..091fc6c 100644 (file)
          (eval command))
       (let ((dir (directory-file-name (expand-file-name nndir-directory))))
        (string-match "/[^/]+$" dir)
-       (let ((nndir-group (substring dir (1+ (match-beginning 0))))
-             (nnml-directory (substring dir 0 (1+ (match-beginning 0))))
-             (nnml-nov-is-evil nndir-nov-is-evil)
-             (nnml-get-new-mail nil))
+       (let* ((nndir-group (substring dir (1+ (match-beginning 0))))
+              (nnml-directory (substring dir 0 (1+ (match-beginning 0))))
+              (nnml-nov-is-evil nndir-nov-is-evil)
+              (nnml-get-new-mail nil)
+              (defs `((nnml-directory ,nnml-directory)
+                      (nnml-nov-is-evil ,nnml-nov-is-evil)
+                      (nnml-get-new-mail))))
+         (unless (nnml-server-opened nndir-current-server)
+           (nnml-open-server nndir-current-server defs))
          (eval command))))))
 
 (provide 'nndir)
index f3978b2..c70d747 100644 (file)
@@ -284,7 +284,8 @@ If this variable is nil, no files will be excluded.")
 (defun nneething-insert-head (file)
   "Insert the head of FILE."
   (when (nneething-get-head file)
-    (insert-buffer-substring nneething-work-buffer)))
+    (insert-buffer-substring nneething-work-buffer)
+    (goto-char (point-max))))
 
 (defun nneething-make-head (file &optional buffer)
   "Create a head by looking at the file attributes of FILE."
@@ -368,8 +369,8 @@ If this variable is nil, no files will be excluded.")
           (point-max))
        (goto-char (point-min))
        (nneething-make-head file (current-buffer))
-       (delete-region (point) (point-max))
-       t)))))
+       (delete-region (point) (point-max)))
+      t))))
 
 (defun nneething-file-name (article)
   "Return the file name of ARTICLE."
index 3b12174..c3dcb7b 100644 (file)
@@ -39,7 +39,6 @@
 
 (require 'mail-utils)
 (require 'sendmail)
-(require 'message)
 (require 'rmail)
 (eval-when-compile (require 'cl))
 
@@ -329,7 +328,7 @@ on your system, you could say something like:
 (defvar nnheader-numerical-full-files (concat "/" nnheader-numerical-files)
   "Regexp that matches numerical full file paths.")
 
-(defun nnheader-file-to-number (file)
+(defsubst nnheader-file-to-number (file)
   "Take a file name and return the article number."
   (if (not (boundp 'jka-compr-compression-info-list))
       (string-to-int file)