Feeding back from `t-gnus-6_14' into `pgnus-ichikawa'.
[elisp/gnus.git-] / lisp / gnus.el
index e1aca84..4f320a9 100644 (file)
@@ -4,6 +4,8 @@
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
+;;     Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
+;;     Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp>
 ;; Keywords: news, mail
 
 ;; This file is part of GNU Emacs.
@@ -30,7 +32,9 @@
 (eval '(run-hooks 'gnus-load-hook))
 
 (eval-when-compile (require 'cl))
-(require 'mm-util)
+(eval-when-compile (require 'static))
+
+(require 'gnus-vers)
 
 (defgroup gnus nil
   "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
@@ -255,12 +259,6 @@ is restarted, and sometimes reloaded."
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
-(defconst gnus-version-number "5.8.8"
-  "Version number for this version of Gnus.")
-
-(defconst gnus-version (format "Gnus v%s" gnus-version-number)
-  "Version string for this version of Gnus.")
-
 (defcustom gnus-inhibit-startup-message nil
   "If non-nil, the startup message will not be displayed.
 This variable is used before `.gnus.el' is loaded, so it should
@@ -307,9 +305,9 @@ be set in `.emacs' instead."
                                (setq gnus-mode-line-image-cache
                                      (find-image
                                       '((:type xpm :file "gnus-pointer.xpm"
-                                               :ascent center)
+                                               :ascent 80)
                                         (:type xbm :file "gnus-pointer.xbm"
-                                               :ascent center))))
+                                               :ascent 80))))
                              gnus-mode-line-image-cache)
                            'help-echo "This is Gnus")
                      str)
@@ -660,6 +658,11 @@ be set in `.emacs' instead."
      ()))
   "Face used for normal interest unread articles.")
 
+(defface gnus-summary-incorporated-face
+  '((t
+     ()))
+  "Face used for incorporated articles.")
+
 (defface gnus-summary-high-read-face
   '((((class color)
       (background dark))
@@ -774,31 +777,42 @@ be set in `.emacs' instead."
   ;; Insert the message.
   (erase-buffer)
   (cond
-   ((and
-     (fboundp 'find-image)
-     (display-graphic-p)
-     (let ((image (find-image
-                  `((:type xpm :file "gnus.xpm")
-                    (:type pbm :file "gnus.pbm"
-                           ;; Account for the pbm's blackground.
-                           :background ,(face-foreground 'gnus-splash-face)
-                           :foreground ,(face-background 'default))
-                    (:type xbm :file "gnus.xbm"
-                           ;; Account for the xbm's blackground.
-                           :background ,(face-foreground 'gnus-splash-face)
-                           :foreground ,(face-background 'default))))))
-       (when image
-        (let ((size (image-size image)))
-          (insert-char ?\n (max 0 (round (- (window-height)
-                                            (or y (cdr size)) 1) 2)))
-          (insert-char ?\  (max 0 (round (- (window-width)
-                                            (or x (car size))) 2)))
-          (insert-image image))
-        (setq gnus-simple-splash nil)
-        t))))
+   ((and (fboundp 'find-image)
+        (display-graphic-p)
+        (let* ((bg (face-background 'default))
+               (fg (face-foreground 'gnus-splash-face))
+               (image (find-image
+                       `((:type xpm :file "gnus.xpm"
+                                :color-symbols (("thing" . "#724214")
+                                                ("shadow" . "#1e3f03")
+                                                ("background" . ,bg)))
+                         (:type xbm :file "gnus.xbm"
+                                :background ,bg :foreground ,fg)))))
+          (when image
+            (insert
+             (propertize
+              (concat gnus-product-name " " gnus-version-number
+                      (if (zerop (string-to-number gnus-revision-number))
+                          ""
+                        (concat " (r" gnus-revision-number ")"))
+                      " based on " gnus-original-product-name " v"
+                      gnus-original-version-number)
+              'face `(variable-pitch :background ,bg :foreground ,fg)))
+            (let ((fill-column (window-width)))
+              (center-region (point-min) (point)))
+            (let ((size (image-size image)))
+              (insert-char ?\n (max 1 (round (- (window-height)
+                                                (or y (cdr size))) 2)))
+              (insert
+               (propertize " " 'display
+                           `(space :align-to
+                                   ,(max 0 (round (- (window-width)
+                                                     (or x (car size))) 2)))))
+              (insert-image image))
+            (setq gnus-simple-splash nil)
+            t))))
    (t
-    (insert
-     (format "              %s
+    (insert "
           _    ___ _             _
           _ ___ __ ___  __    _ ___
           __   _     ___    __  ___
@@ -818,9 +832,20 @@ be set in `.emacs' instead."
           __
 
 "
-            ""))
+           )
+    (goto-char (point-min))
+    (insert gnus-product-name " " gnus-version-number
+           (if (zerop (string-to-number gnus-revision-number))
+               ""
+             (concat " (r" gnus-revision-number ")"))
+           " based on " gnus-original-product-name " v"
+           gnus-original-version-number)
+    (insert-char ?\  (prog1
+                        (max 0 (/ (- (window-width) (point)) 2))
+                      (goto-char (point-min))))
+    (forward-line 1)
     ;; And then hack it.
-    (gnus-indent-rigidly (point-min) (point-max)
+    (gnus-indent-rigidly (point) (point-max)
                         (/ (max (- (window-width) (or x 46)) 0) 2))
     (goto-char (point-min))
     (forward-line 1)
@@ -1263,6 +1288,7 @@ slower."
   :group 'gnus-summary-format
   :type '(radio (function-item gnus-extract-address-components)
                (function-item mail-extract-address-components)
+               (function-item std11-extract-address-components)
                (function :tag "Other")))
 
 (defcustom gnus-carpal nil
@@ -1585,16 +1611,26 @@ If nil, no default charset is assumed when posting."
 (defvar gnus-have-read-active-file nil)
 
 (defconst gnus-maintainer
-  "bugs@gnus.org (The Gnus Bugfixing Girls + Boys)"
-  "The mail address of the Gnus maintainers.")
+  "semi-gnus-ja@meadowy.org (T-gnus Bugfixing Girls + Boys)"
+  "The mail address of the T-gnus maintainers.")
+
+(defcustom gnus-info-filename nil
+  "*Controls language of gnus Info.
+If nil and current-language-environment is Japanese, go to gnus-ja.
+Otherwise go to corresponding Info.
+This variable can be nil, gnus or gnus-ja."
+  :group 'gnus-start
+  :type '(choice (const nil)
+                (const :tag "English" gnus)
+                (const :tag "Japanese" gnus-ja)))
 
 (defvar gnus-info-nodes
-  '((gnus-group-mode "(gnus)The Group Buffer")
-    (gnus-summary-mode "(gnus)The Summary Buffer")
-    (gnus-article-mode "(gnus)The Article Buffer")
-    (gnus-server-mode "(gnus)The Server Buffer")
-    (gnus-browse-mode "(gnus)Browse Foreign Server")
-    (gnus-tree-mode "(gnus)Tree Display"))
+  '((gnus-group-mode "The Group Buffer")
+    (gnus-summary-mode "The Summary Buffer")
+    (gnus-article-mode "The Article Buffer")
+    (gnus-server-mode "The Server Buffer")
+    (gnus-browse-mode "Browse Foreign Server")
+    (gnus-tree-mode "Tree Display"))
   "Alist of major modes and related Info nodes.")
 
 (defvar gnus-group-buffer "*Group*")
@@ -1613,10 +1649,27 @@ If nil, no default charset is assumed when posting."
                        gnus-newsrc-last-checked-date
                        gnus-newsrc-alist gnus-server-alist
                        gnus-killed-list gnus-zombie-list
-                       gnus-topic-topology gnus-topic-alist
-                       gnus-format-specs)
+                       gnus-topic-topology gnus-topic-alist)
   "Gnus variables saved in the quick startup file.")
 
+(defvar gnus-product-variable-file-list
+  (let ((version (product-version (product-find 'gnus-vers)))
+       (codesys (static-if (boundp 'MULE) '*ctext* 'ctext)))
+    `(("strict-cache" ((product-version ,version) (emacs-version))
+       binary
+       gnus-format-specs-compiled)
+      ("cache" ((product-version ,version) (emacs-version))
+       ,codesys
+       gnus-format-specs)))
+  "Gnus variables are saved in the produce depend quick startup files.")
+
+(defcustom gnus-compile-user-specs t
+  "If non-nil, the user-defined format specs will be byte-compiled
+automatically.
+It has an effect on the values of `gnus-*-line-format-spec'."
+  :group 'gnus
+  :type 'boolean)
+
 (defvar gnus-newsrc-alist nil
   "Assoc list of read articles.
 gnus-newsrc-hashtb should be kept so that both hold the same information.")
@@ -1680,9 +1733,9 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
            (nthcdr 3 package)
          (cdr package)))))
    '(("info" :interactive t Info-goto-node)
-     ("pp" pp-to-string)
-     ("qp" quoted-printable-decode-region quoted-printable-decode-string)
+     ("pp" pp pp-to-string pp-eval-expression)
      ("ps-print" ps-print-preprint)
+     ("browse-url" :interactive t browse-url)
      ("message" :interactive t
       message-send-and-exit message-yank-original)
      ("babel" babel-as-string)
@@ -1744,7 +1797,8 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
       gnus-current-score-file-nondirectory gnus-score-adaptive
       gnus-score-find-trace gnus-score-file-name)
-     ("gnus-cus" :interactive t gnus-group-customize gnus-score-customize)
+     ("gnus-cus" :interactive t gnus-custom-mode gnus-group-customize
+      gnus-score-customize)
      ("gnus-topic" :interactive t gnus-topic-mode)
      ("gnus-topic" gnus-topic-remove-group gnus-topic-set-parameters
       gnus-subscribe-topics)
@@ -1762,9 +1816,10 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
       gnus-uu-decode-binhex-view gnus-uu-unmark-thread
       gnus-uu-mark-over gnus-uu-post-news)
-     ("gnus-uu" gnus-uu-delete-work-dir gnus-uu-unmark-thread)
+     ("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh
+      gnus-uu-unmark-thread)
      ("gnus-msg" (gnus-summary-send-map keymap)
-      gnus-article-mail gnus-copy-article-buffer gnus-extended-version)
+      gnus-article-mail gnus-copy-article-buffer gnus-following-method)
      ("gnus-msg" :interactive t
       gnus-group-post-news gnus-group-mail gnus-summary-post-news
       gnus-summary-followup gnus-summary-followup-with-original
@@ -1774,12 +1829,10 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-summary-resend-message gnus-summary-resend-bounced-mail
       gnus-summary-wide-reply gnus-summary-followup-to-mail
       gnus-summary-followup-to-mail-with-original gnus-bug
-      gnus-summary-wide-reply-with-original
-      gnus-summary-post-forward gnus-summary-wide-reply-with-original
-      gnus-summary-post-forward)
+      gnus-summary-wide-reply-with-original gnus-summary-post-forward
+      gnus-summary-digest-mail-forward gnus-summary-digest-post-forward)
      ("gnus-picon" :interactive t gnus-article-display-picons
-      gnus-group-display-picons gnus-picons-article-display-x-face
-      gnus-picons-display-x-face)
+      gnus-group-display-picons)
      ("gnus-picon" gnus-picons-buffer-name)
      ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
       gnus-grouplens-mode)
@@ -1790,7 +1843,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-offer-save-summaries gnus-make-thread-indent-array
       gnus-summary-exit gnus-update-read-articles gnus-summary-last-subject
       gnus-summary-skip-intangible gnus-summary-article-number
-      gnus-data-header gnus-data-find)
+      gnus-data-header gnus-data-find gnus-summary-jump-to-other-group)
      ("gnus-group" gnus-group-insert-group-line gnus-group-quit
       gnus-group-list-groups gnus-group-first-unread-group
       gnus-group-set-mode-line gnus-group-set-info gnus-group-save-newsrc
@@ -1809,19 +1862,18 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
       gnus-article-hide-headers gnus-article-hide-boring-headers
       gnus-article-treat-overstrike
       gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
-      gnus-article-display-x-face gnus-article-de-quoted-unreadable
-      gnus-article-de-base64-unreadable
+      gnus-article-display-x-face
       gnus-article-decode-HZ
       gnus-article-wash-html
       gnus-article-hide-pgp
       gnus-article-hide-pem gnus-article-hide-signature
       gnus-article-strip-leading-blank-lines gnus-article-date-local
       gnus-article-date-original gnus-article-date-lapsed
-      gnus-article-show-all-headers
+      gnus-article-show-all-headers gnus-article-show-all
       gnus-article-edit-mode gnus-article-edit-article
-      gnus-article-edit-done gnus-article-decode-encoded-words
+      gnus-article-edit-done article-decode-encoded-words
       gnus-start-date-timer gnus-stop-date-timer
-      gnus-mime-view-all-parts)
+      gnus-article-toggle-headers)
      ("gnus-int" gnus-request-type)
      ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
       gnus-dribble-enter gnus-read-init-file gnus-dribble-touch)
@@ -1836,6 +1888,20 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
      ("gnus-async" gnus-async-request-fetched-article gnus-async-prefetch-next
       gnus-async-prefetch-article gnus-async-prefetch-remove-group
       gnus-async-halt-prefetch)
+     ("gnus-offline"
+      gnus-offline-setup)
+     ("gnus-offline" :interactive t
+      gnus-offline-toggle-plugged
+      gnus-offline-set-unplugged-state
+      gnus-offline-toggle-auto-hangup
+      gnus-offline-toggle-on/off-send-mail
+      gnus-offline-toggle-articles-to-fetch
+      gnus-offline-set-interval-time
+      gnus-offline-agent-expire)
+     ("miee" :interactive t gnspool-get-news
+      mail-spool-send news-spool-post)
+     ("international/mw32misc" define-process-argument-editing
+      general-process-argument-editing-function)
      ("gnus-agent" gnus-open-agent gnus-agent-get-function
       gnus-agent-save-groups gnus-agent-save-active gnus-agent-method-p
       gnus-agent-get-undownloaded-list gnus-agent-fetch-session
@@ -1849,6 +1915,14 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.")
      ("gnus-mlspl" :interactive t gnus-group-split-setup
       gnus-group-split-update))))
 
+(eval-and-compile
+  (unless (featurep 'xemacs)
+    (if (>= emacs-major-version 21)
+       (autoload 'x-face-decode-message-header "x-face-e21")
+      (autoload 'gnus-smiley-display "gnus-bitmap" nil t)
+      (autoload 'smiley-toggle-buffer "gnus-bitmap")
+      (autoload 'x-face-mule-gnus-article-display-x-face "x-face-mule"))))
+
 ;;; gnus-sum.el thingies
 
 
@@ -2095,48 +2169,19 @@ STRINGS will be evaluated in normal `or' order."
        (setq strings nil)))
     string))
 
-(defun gnus-version (&optional arg)
-  "Version number of this version of Gnus.
-If ARG, insert string at point."
-  (interactive "P")
-  (if arg
-      (insert (message gnus-version))
-    (message gnus-version)))
-
-(defun gnus-continuum-version (version)
-  "Return VERSION as a floating point number."
-  (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
-           (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
-    (let ((alpha (and (match-beginning 1) (match-string 1 version)))
-         (number (match-string 2 version))
-         major minor least)
-      (unless (string-match
-              "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
-       (error "Invalid version string: %s" version))
-      (setq major (string-to-number (match-string 1 number))
-           minor (string-to-number (match-string 2 number))
-           least (if (match-beginning 3)
-                     (string-to-number (match-string 3 number))
-                   0))
-      (string-to-number
-       (if (zerop major)
-          (format "%s00%02d%02d"
-                  (if (member alpha '("(ding)" "d"))
-                      "4.99"
-                    (+ 5 (* 0.02
-                            (abs
-                             (- (mm-char-int (aref (downcase alpha) 0))
-                                (mm-char-int ?t))))
-                       -0.01))
-                  minor least)
-        (format "%d.%02d%02d" major minor least))))))
-
 (defun gnus-info-find-node ()
   "Find Info documentation of Gnus."
   (interactive)
   ;; Enlarge info window if needed.
   (let (gnus-info-buffer)
-    (Info-goto-node (cadr (assq major-mode gnus-info-nodes)))
+    (Info-goto-node
+     (format "(%s)%s"
+            (or gnus-info-filename
+                (get-language-info current-language-environment 'gnus-info)
+                "gnus")
+            (or (cadr (assq major-mode gnus-info-nodes))
+                (and (eq (current-buffer) (get-buffer gnus-article-buffer))
+                     (cadr (assq 'gnus-article-mode gnus-info-nodes))))))
     (setq gnus-info-buffer (current-buffer))
     (gnus-configure-windows 'info)))
 
@@ -2237,8 +2282,8 @@ g -- Group name."
        out)
       (cond
        ((= c ?r)
-       (push (if (< (point) (mark) (point) (mark))) out)
-       (push (if (> (point) (mark) (point) (mark))) out))))
+       (push (if (< (point) (mark)) (point) (mark)) out)
+       (push (if (> (point) (mark)) (point) (mark)) out))))
     (setq out (delq 'gnus-prefix-nil out))
     (nreverse out)))
 
@@ -2925,19 +2970,42 @@ As opposed to `gnus', this command will not connect to the local server."
   (interactive "P")
   (gnus arg nil 'slave))
 
+(defcustom gnus-frame-properties nil
+  "The properties of the frame in which gnus is displayed. Under XEmacs,
+the variable `toolbar-news-frame-plist' will be refered instead."
+  :type '(repeat (cons :format "%v"
+                      (symbol :tag "Parameter")
+                      (sexp :tag "Value")))
+  :group 'gnus)
+
+(defvar gnus-frame nil
+  "The frame in which gnus is displayed. It is not used under XEmacs.")
+
 ;;;###autoload
 (defun gnus-other-frame (&optional arg)
   "Pop up a frame to read news."
   (interactive "P")
-  (let ((window (get-buffer-window gnus-group-buffer)))
-    (cond (window
-          (select-frame (window-frame window)))
-         (t
-          (select-frame (make-frame)))))
-  (gnus arg))
-
-;;(setq thing ?                                ; this is a comment
-;;      more 'yes)
+  (static-if (featurep 'xemacs)
+      (let ((toolbar-news-use-separate-frame t))
+       (toolbar-gnus))
+    (if (frame-live-p gnus-frame)
+       (raise-frame gnus-frame)
+      (setq gnus-frame (make-frame gnus-frame-properties))
+      (if (and (gnus-buffer-live-p gnus-group-buffer)
+              (save-current-buffer
+                (set-buffer gnus-group-buffer)
+                (eq 'gnus-group-mode major-mode)))
+         (progn
+           (select-frame gnus-frame)
+           (switch-to-buffer gnus-group-buffer))
+       (add-hook 'gnus-exit-gnus-hook
+                 (lambda ()
+                   (when (and (frame-live-p gnus-frame)
+                              (cdr (frame-list)))
+                     (delete-frame gnus-frame))
+                   (setq gnus-frame nil)))
+       (select-frame gnus-frame)
+       (gnus arg)))))
 
 ;;;###autoload
 (defun gnus (&optional arg dont-connect slave)
@@ -2952,6 +3020,6 @@ prompt the user for the name of an NNTP server to use."
 
 (gnus-ems-redefine)
 
-(provide 'gnus)
+(product-provide (provide 'gnus) 'gnus-vers)
 
 ;;; gnus.el ends here