* gnus-art.el (gnus-parse-news-url): New function.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 1 Apr 2001 17:56:11 +0000 (17:56 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 1 Apr 2001 17:56:11 +0000 (17:56 +0000)
(gnus-button-handle-news): New function.
(gnus-button-alist): Point to new functions.

* gnus-group.el (gnus-group-quit): Only mark buffer in non-empty.

* gnus-start.el (gnus-read-newsrc-el-file): Nix out
gnus-format-specs.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-start.el

index aa180bb..a0886ab 100644 (file)
@@ -1,5 +1,14 @@
 2001-04-02 00:40:12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-art.el (gnus-parse-news-url): New function.
+       (gnus-button-handle-news): New function.
+       (gnus-button-alist): Point to new functions.
+
+       * gnus-group.el (gnus-group-quit): Only mark buffer in non-empty.
+
+       * gnus-start.el (gnus-read-newsrc-el-file): Nix out
+       gnus-format-specs. 
+
        * message.el (message-check-news-header-syntax): Question even
        when Gnus doesn't know the group names.
        (message-send-news): Clean up.
index 28a5ab9..5a8ab62 100644 (file)
@@ -4681,9 +4681,10 @@ groups."
   :type 'regexp)
 
 (defcustom gnus-button-alist
-  `(("<\\(url:[>\n\t ]*?\\)?news:[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>"
-     0 t gnus-button-message-id 2)
-    ("\\bnews:\\([^>\n\t ]*@[^>)!;:,\n\t ]*\\)" 0 t gnus-button-message-id 1)
+  `(("<\\(url:[>\n\t ]*?\\)?\\(nntp\\|news\\):[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>"
+     0 t gnus-button-handle-news 3)
+    ("\\b\\(nntp\\|news\\):\\([^>\n\t ]*@[^>)!;:,\n\t ]*\\)" 0 t
+     gnus-button-handle-news 2)
     ("\\(\\b<\\(url:[>\n\t ]*\\)?news:[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)"
      1 t
      gnus-button-fetch-group 4)
@@ -5024,6 +5025,45 @@ specified by `gnus-button-alist'."
        (gnus-message 1 "You must define `%S' to use this button"
                      (cons fun args)))))))
 
+(defun gnus-parse-news-url (url)
+  (let (scheme server group message-id articles)
+    (with-temp-buffer
+      (insert url)
+      (goto-char (point-min))
+      (when (looking-at "\\([A-Za-z]+\\):")
+       (setq scheme (match-string 1))
+       (goto-char (match-end 0)))
+      (when (looking-at "//\\([^/]+\\)/")
+       (setq server (match-string 1))
+       (goto-char (match-end 0)))
+       
+      (cond
+       ((looking-at "\\(.*@.*\\)")
+       (setq message-id (match-string 1)))
+       ((looking-at "\\([^/]+\\)/\\([-0-9]+\\)")
+       (setq group (match-string 1)
+             articles (split-string (match-string 2) "-")))
+       ((looking-at "\\([^/]+\\)/?")
+       (setq group (match-string 1)))
+       (t
+       (error "Unknown news URL syntax"))))
+    (list scheme server group message-id articles)))
+
+(defun gnus-button-handle-news (url)
+  "Fetch a news URL."
+  (destructuring-bind (scheme server group message-id articles)
+      (gnus-parse-news-url url)
+    (cond
+     (message-id
+      (save-excursion
+       (set-buffer gnus-summary-buffer)
+       (if server
+           (let ((gnus-refer-article-method (list (list 'nntp server))))
+             (gnus-summary-refer-article message-id))
+         (gnus-summary-refer-article message-id))))
+     (group
+      (gnus-button-fetch-group url)))))
+
 (defun gnus-button-message-id (message-id)
   "Fetch MESSAGE-ID."
   (save-excursion
index 657eae2..c3d6b17 100644 (file)
@@ -3672,8 +3672,12 @@ The hook `gnus-exit-gnus-hook' is called before actually exiting."
                     (file-name-nondirectory gnus-current-startup-file))))
     (gnus-run-hooks 'gnus-exit-gnus-hook)
     (gnus-configure-windows 'group t)
-    (gnus-dribble-enter
-     ";;; Gnus was exited on purpose without saving the .newsrc files.")
+    (when (and gnus-dribble-buffer
+              (not(zerop (save-excursion
+                           (set-buffer gnus-dribble-buffer)
+                           (buffer-size)))))
+      (gnus-dribble-enter
+       ";;; Gnus was exited on purpose without saving the .newsrc files."))
     (gnus-dribble-save)
     (gnus-close-backends)
     (gnus-clear-system)
index 8a3dd72..07c8908 100644 (file)
@@ -2075,6 +2075,11 @@ If FORCE is non-nil, the .newsrc file is read."
         (unless (gnus-yes-or-no-p
                  (format "Error in %s; continue? " ding-file))
           (error "Error in %s" ding-file))))
+      ;; Older versions of `gnus-format-specs' are no longer valid
+      ;; in Oort Gnus 0.01.
+      (when (< (gnus-continuum-version gnus-newsrc-file-version)
+              5.090002)
+       (setq gnus-format-specs nil))
       (when gnus-newsrc-assoc
        (setq gnus-newsrc-alist gnus-newsrc-assoc)))
     (gnus-make-hashtable-from-newsrc-alist)