*** empty log message ***
[gnus] / lisp / gnus-art.el
index a13b82b..b0e4a27 100644 (file)
@@ -102,7 +102,7 @@ If `gnus-visible-headers' is non-nil, this variable will be ignored."
   :group 'gnus-article-hiding)
 
 (defcustom gnus-visible-headers 
-  "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-"
+  "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From"
   "All headers that do not match this regexp will be hidden.
 This variable can also be a list of regexp of headers to remain visible.
 If this variable is non-nil, `gnus-ignored-headers' will be ignored."
@@ -948,7 +948,8 @@ always hide."
          (narrow-to-region beg end)
          (goto-char (point-min))
          (while (re-search-forward "^- " nil t)
-           (gnus-article-hide-text-type (match-beginning 0) (match-end 0) 'pgp))
+           (gnus-article-hide-text-type 
+            (match-beginning 0) (match-end 0) 'pgp))
          (widen))))))
 
 (defun article-hide-pem (&optional arg)
@@ -1089,17 +1090,19 @@ Put point at the beginning of the signature separator."
 Arg can be nil or a number.  Nil and positive means hide, negative
 means show, 0 means toggle."
   (save-excursion
-    (let ((hide (gnus-article-hidden-text-p type)))
-      (cond
-       ((or (null arg)
-           (> arg 0))
-       nil)
-       ((< arg 0)
-       (gnus-article-show-hidden-text type))
-       (t
-       (if (eq hide 'hidden)
-           (gnus-article-show-hidden-text type)
-         nil))))))
+    (save-restriction
+      (widen)
+      (let ((hide (gnus-article-hidden-text-p type)))
+       (cond
+        ((or (null arg)
+             (> arg 0))
+         nil)
+        ((< arg 0)
+         (gnus-article-show-hidden-text type))
+        (t
+         (if (eq hide 'hidden)
+             (gnus-article-show-hidden-text type)
+           nil)))))))
 
 (defun gnus-article-hidden-text-p (type)
   "Say whether the current buffer contains hidden text of type TYPE."
@@ -1198,11 +1201,13 @@ how much time has lapsed since DATE."
     (concat "Date: " date "\n"))
    ;; Let the user define the format.
    ((eq type 'user)
-    (format-time-string gnus-article-time-format
-                       (ignore-errors
-                         (gnus-encode-date
-                          (timezone-make-date-arpa-standard
-                           date nil "UT")))))
+    (concat 
+     (format-time-string gnus-article-time-format
+                        (ignore-errors
+                          (gnus-encode-date
+                           (timezone-make-date-arpa-standard
+                            date nil "UT"))))
+     "\n"))
    ;; Do an X-Sent lapsed format.
    ((eq type 'lapsed)
     ;; If the date is seriously mangled, the timezone functions are
@@ -1450,10 +1455,10 @@ Directory to save to is default to `gnus-article-save-directory'."
       (save-excursion
        (save-restriction
          (widen)
-         (if (and (file-readable-p filename) (mail-file-babyl-p filename))
-             (gnus-output-to-rmail filename)
-           (let ((mail-use-rfc822 t))
-             (rmail-output filename 1 t t))))))
+         (if (and (file-readable-p filename)
+                  (mail-file-babyl-p filename))
+             (gnus-output-to-rmail filename t)
+           (gnus-output-to-mail filename t)))))
     ;; Remember the directory name to save articles.
     (setq gnus-newsgroup-last-mail filename)))
 
@@ -1672,6 +1677,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
 
     "\C-d" gnus-article-read-summary-keys
     "\M-*" gnus-article-read-summary-keys
+    "\M-#" gnus-article-read-summary-keys
     "\M-^" gnus-article-read-summary-keys
     "\M-g" gnus-article-read-summary-keys)
 
@@ -1700,9 +1706,10 @@ If variable `gnus-use-long-file-name' is non-nil, it is
        ["Remove carriage return" gnus-article-remove-cr t]
        ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]))
 
-    (when (boundp 'gnus-summary-article-menu)
-      (define-key gnus-article-mode-map [menu-bar commands]
-       (cons "Commands" gnus-summary-article-menu)))
+    (when nil
+      (when (boundp 'gnus-summary-article-menu)
+       (define-key gnus-article-mode-map [menu-bar commands]
+         (cons "Commands" gnus-summary-article-menu))))
 
     (when (boundp 'gnus-summary-post-menu)
       (define-key gnus-article-mode-map [menu-bar post]
@@ -1949,56 +1956,6 @@ Provided for backwards compatibility."
 
 ;;; Article savers.
 
-(defun gnus-output-to-rmail (file-name)
-  "Append the current article to an Rmail file named FILE-NAME."
-  (require 'rmail)
-  ;; Most of these codes are borrowed from rmailout.el.
-  (setq file-name (expand-file-name file-name))
-  (setq rmail-default-rmail-file file-name)
-  (let ((artbuf (current-buffer))
-       (tmpbuf (get-buffer-create " *Gnus-output*")))
-    (save-excursion
-      (or (get-file-buffer file-name)
-         (file-exists-p file-name)
-         (if (gnus-yes-or-no-p
-              (concat "\"" file-name "\" does not exist, create it? "))
-             (let ((file-buffer (create-file-buffer file-name)))
-               (save-excursion
-                 (set-buffer file-buffer)
-                 (rmail-insert-rmail-file-header)
-                 (let ((require-final-newline nil))
-                   (gnus-write-buffer file-name)))
-               (kill-buffer file-buffer))
-           (error "Output file does not exist")))
-      (set-buffer tmpbuf)
-      (buffer-disable-undo (current-buffer))
-      (erase-buffer)
-      (insert-buffer-substring artbuf)
-      (gnus-convert-article-to-rmail)
-      ;; Decide whether to append to a file or to an Emacs buffer.
-      (let ((outbuf (get-file-buffer file-name)))
-       (if (not outbuf)
-           (append-to-file (point-min) (point-max) file-name)
-         ;; File has been visited, in buffer OUTBUF.
-         (set-buffer outbuf)
-         (let ((buffer-read-only nil)
-               (msg (and (boundp 'rmail-current-message)
-                         (symbol-value 'rmail-current-message))))
-           ;; If MSG is non-nil, buffer is in RMAIL mode.
-           (when msg
-             (widen)
-             (narrow-to-region (point-max) (point-max)))
-           (insert-buffer-substring tmpbuf)
-           (when msg
-             (goto-char (point-min))
-             (widen)
-             (search-backward "\^_")
-             (narrow-to-region (point) (point-max))
-             (goto-char (1+ (point-min)))
-             (rmail-count-new-messages t)
-             (rmail-show-message msg))))))
-    (kill-buffer tmpbuf)))
-
 (defun gnus-output-to-file (file-name)
   "Append the current article to a file named FILE-NAME."
   (let ((artbuf (current-buffer)))
@@ -2010,18 +1967,6 @@ Provided for backwards compatibility."
       (insert "\n")
       (append-to-file (point-min) (point-max) file-name))))
 
-(defun gnus-convert-article-to-rmail ()
-  "Convert article in current buffer to Rmail message format."
-  (let ((buffer-read-only nil))
-    ;; Convert article directly into Babyl format.
-    ;; Suggested by Rob Austein <sra@lcs.mit.edu>
-    (goto-char (point-min))
-    (insert "\^L\n0, unseen,,\n*** EOOH ***\n")
-    (while (search-forward "\n\^_" nil t) ;single char
-      (replace-match "\n^_" t t))      ;2 chars: "^" and "_"
-    (goto-char (point-max))
-    (insert "\^_")))
-
 (defun gnus-narrow-to-page (&optional arg)
   "Narrow the article buffer to a page.
 If given a numerical ARG, move forward ARG pages."
@@ -2513,13 +2458,16 @@ groups."
   :type 'regexp)
 
 (defcustom gnus-button-alist 
-  `(("\\(\\b<?\\(url: ?\\)?news:\\([^>\n\t ]*\\)>?\\)" 1 t
+  `(("\\(\\b<\\(url: ?\\)?news:\\([^>\n\t ]*\\)>\\)" 1 t
      gnus-button-message-id 3)
-    ("\\(\\b<?\\(url: ?\\)?news:\\(//\\)?\\([^>\n\t ]*\\)>?\\)" 1 t
+    ("\\bnews:\\([^\n\t ]+\\)" 0 t gnus-button-message-id 1)
+    ("\\(\\b<\\(url: ?\\)?news:\\(//\\)?\\([^>\n\t ]*\\)>\\)" 1 t
      gnus-button-fetch-group 4)
+    ("\\bnews:\\(//\\)?\\([^>\n\t ]+\\)" 0 t gnus-button-fetch-group 2)
     ("\\bin\\( +article\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2 
      t gnus-button-message-id 3)
-    ("\\(<URL: *\\)?mailto: *\\([^> \n\t]+\\)>?" 0 t gnus-url-mailto 2)
+    ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>" 0 t gnus-url-mailto 1)
+    ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 2)
     ;; This is how URLs _should_ be embedded in text...
     ("<URL: *\\([^>]*\\)>" 0 t gnus-button-embedded-url 1)
     ;; Raw URLs.