From a69d49e02f529e4b97f8158aa17582667d162f90 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 3 Jun 2004 22:06:37 +0000 Subject: [PATCH] Synch to No Gnus 200406031937. --- ChangeLog | 6 ++++++ etc/gnus/gnus-setup.ast | 16 ++++++++------- lisp/ChangeLog | 9 +++++++++ lisp/assistant.el | 50 +++++++++++++++++++++++++++++++++++++---------- 4 files changed, 64 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a456c5..8e7735a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-06-03 Teodor Zlatanov + + * etc/gnus/gnus-setup.ast (Setting up a NNTP server) + (Setting up local mail storage (nnml)): fixed some bugs, added a + new screen - still testing + 2004-06-01 Simon Josefsson * make.bat: Add SASL manual. diff --git a/etc/gnus/gnus-setup.ast b/etc/gnus/gnus-setup.ast index a31cb61..790c6a0 100644 --- a/etc/gnus/gnus-setup.ast +++ b/etc/gnus/gnus-setup.ast @@ -1,11 +1,8 @@ @title Configuring Gnus for the first time @node What do you want to do with Gnus? - @variable outbound (:radio ((item :tag "Send mail via sendmail" "sendmail") (item :tag "Send mail via SMTP" "smtp"))) "sendmail" - @variable backends (:set ((item :tag "Read news via NNTP" "nntp") (item :tag"Sacrifice a goat" "goat") (item :tag "Read mail, store it locally" "nnml") (item :tag "Read mail and store it on an IMAP server" "nnimap"))) (list "nnml") - @result primary-mail-selections (list backends outbound) @text @@ -21,13 +18,11 @@ Choose the method Gnus will use to send mail: @end text @next (member "nnml" backends) "Setting up local mail storage (nnml)" +@next (member "nntp" backends) "Setting up a NNTP server" -@node "Setting up local mail storage (nnml)" - +@node Setting up local mail storage (nnml) @variable mechanism (:radio ((item :tag "Get mail from your Unix mbox" "mbox") (item :tag "Use POP3 to retrieve mail" "pop3"))) "mbox" - @result nnml-mechanism (list mechanism) - @text You are setting up local mail storage, using the nnml backend in Gnus terms. @@ -36,6 +31,13 @@ Your mail can be downloaded into Gnus in several ways, choose one: @end text +@node Setting up a NNTP server + +@text +TODO: this will be a real link. +Run M-x assistant and use the news-server.ast file as input. +@end text + @ignore @end ignore diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3efacd2..56bbf6e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2004-06-03 Teodor Zlatanov + + * assistant.el (assistant-node-name): new convenience function + (assistant-render-text, assistant-render-node): error handling, + plus handle multiple next nodes + (assistant-find-next-node): commented out for now + (assistant-find-next-nodes): new function, returns list of next + nodes + 2004-06-02 Reiner Steib * mail-source.el (mail-source-directory): Fix doc-string. diff --git a/lisp/assistant.el b/lisp/assistant.el index bacbe17..ef10be6 100644 --- a/lisp/assistant.el +++ b/lisp/assistant.el @@ -170,6 +170,9 @@ (pop ast)) (car ast))) +(defun assistant-node-name (node) + (assistant-get node "node")) + (defun assistant-previous-node-text (node) (format "<< Go back to %s" node)) @@ -210,6 +213,10 @@ (setcar (nthcdr 3 elem) value))))) (defun assistant-render-text (text node) + (unless (and text node) + (gnus-error + 5 + "The assistant was asked to render invalid text or node data")) (dolist (elem text) (if (stringp elem) ;; Ordinary text @@ -279,10 +286,12 @@ (inhibit-read-only t) (previous assistant-current-node) (buffer-read-only nil)) + (unless node + (gnus-error 5 "The node for %s could not be found" node-name)) (set (make-local-variable 'assistant-widgets) nil) (assistant-set-defaults node) (if (equal (assistant-get node "type") "interstitial") - (assistant-render-node (assistant-find-next-node node-name)) + (assistant-render-node (nth 0 (assistant-find-next-nodes node-name))) (setq assistant-current-node node-name) (when previous (push previous assistant-previous-nodes)) @@ -301,9 +310,11 @@ (assistant-set-defaults (assistant-find-node node) 'force) (assistant-render-node node))) "Reset") - (insert " ") - (assistant-node-button 'next (assistant-find-next-node)) (insert "\n") + (dolist (nnode (assistant-find-next-nodes)) + (assistant-node-button 'next nnode) + (insert "\n")) + (goto-char (point-min)) (assistant-make-read-only)))) @@ -373,15 +384,34 @@ (error "%s" result)))) (assistant-set node "save" t))) -(defun assistant-find-next-node (&optional node) +;; (defun assistant-find-next-node (&optional node) +;; (let* ((node (assistant-find-node (or node assistant-current-node))) +;; (node-name (assistant-node-name node)) +;; (nexts (assistant-get-list node "next")) +;; next elem applicable) + +;; (while (setq elem (pop nexts)) +;; (when (assistant-eval (car (cadr elem))) +;; (setq applicable (cons elem applicable)))) + +;; ;; return the first thing we can +;; (cadr (cadr (pop applicable))))) + +(defun assistant-find-next-nodes (&optional node) (let* ((node (assistant-find-node (or node assistant-current-node))) (nexts (assistant-get-list node "next")) - next elem) - (while (and (setq elem (cadr (pop nexts))) - (not next)) - (when (setq next (assistant-eval (car elem))) - (setq next (or (cadr elem) next)))) - next)) + next elem applicable return) + + (while (setq elem (pop nexts)) + (when (assistant-eval (car (cadr elem))) + (setq applicable (cons elem applicable)))) + + ;; return the first thing we can + + (while (setq elem (pop applicable)) + (push (cadr (cadr elem)) return)) + + return)) (defun assistant-get-all-variables () (let ((variables nil)) -- 1.7.10.4