From: yamaoka Date: Wed, 1 Nov 2000 03:59:42 +0000 (+0000) Subject: Synch with Gnus. X-Git-Tag: t-gnus-6_14-quimby-before-installer-changed-~25 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f992cb0fad1b33b4a97845ecfc183fa8a4d9b91e;p=elisp%2Fgnus.git- Synch with Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3654e9..c8f7cea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2000-10-31 22:06:13 ShengHuo ZHU + + * gnus-sum.el (gnus-article-charset): New variable. + (gnus-summary-display-article): Set it. + * gnus-msg.el (gnus-copy-article-buffer): Use it. + * gnus-art.el (gnus-article-mode): Make it local variable. + +2000-11-01 01:12:29 Lars Magne Ingebrigtsen + + * nnultimate.el (nnultimate-create-mapping): Use nreverse. + +2000-10-31 23:45:31 Lars Magne Ingebrigtsen + + * nnwfm.el: New file. + + * nnweb.el (nnweb-replace-in-string): New function. + 2000-10-31 17:32:02 ShengHuo ZHU * mml2015.el: Wrap gpg.el. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 7358e37..68e0462 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2910,6 +2910,8 @@ commands: (make-local-variable 'gnus-article-decoded-p) (make-local-variable 'gnus-article-mime-handle-alist) (make-local-variable 'gnus-article-wash-types) + (make-local-variable 'gnus-article-charset) + (make-local-variable 'gnus-article-ignored-charsets) (gnus-set-default-directory) (buffer-disable-undo) (setq buffer-read-only t) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 93ce9ce..33343d6 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -493,40 +493,45 @@ header line with the old Message-ID." (error "Can't find any article buffer") (save-excursion (set-buffer article-buffer) - (save-restriction - ;; Copy over the (displayed) article buffer, delete - ;; hidden text and remove text properties. - (widen) - (let ((inhibit-read-only t)) - (copy-to-buffer gnus-article-copy (point-min) (point-max)) + (let ((gnus-newsgroup-charset (or gnus-article-charset + gnus-newsgroup-charset)) + (gnus-newsgroup-ignored-charsets + (or gnus-article-ignored-charsets + gnus-newsgroup-ignored-charsets))) + (save-restriction + ;; Copy over the (displayed) article buffer, delete + ;; hidden text and remove text properties. + (widen) + (let ((inhibit-read-only t)) + (copy-to-buffer gnus-article-copy (point-min) (point-max)) + (set-buffer gnus-article-copy) + ;; Encode bitmap smileys to ordinary text. + ;; Possibly, the original text might be restored. + (static-unless (featurep 'xemacs) + (when (featurep 'smiley-mule) + (smiley-encode-buffer))) + (gnus-article-delete-text-of-type 'annotation) + (gnus-remove-text-with-property 'gnus-prev) + (gnus-remove-text-with-property 'gnus-next) + (gnus-remove-text-with-property 'x-face-mule-bitmap-image) + (insert + (prog1 + (buffer-substring-no-properties (point-min) (point-max)) + (erase-buffer)))) + ;; Find the original headers. + (set-buffer gnus-original-article-buffer) + (goto-char (point-min)) + (while (looking-at message-unix-mail-delimiter) + (forward-line 1)) + (setq beg (point)) + (setq end (or (search-forward "\n\n" nil t) (point))) + ;; Delete the headers from the displayed articles. (set-buffer gnus-article-copy) - ;; Encode bitmap smileys to ordinary text. - ;; Possibly, the original text might be restored. - (static-unless (featurep 'xemacs) - (when (featurep 'smiley-mule) - (smiley-encode-buffer))) - (gnus-article-delete-text-of-type 'annotation) - (gnus-remove-text-with-property 'gnus-prev) - (gnus-remove-text-with-property 'gnus-next) - (gnus-remove-text-with-property 'x-face-mule-bitmap-image) - (insert - (prog1 - (buffer-substring-no-properties (point-min) (point-max)) - (erase-buffer)))) - ;; Find the original headers. - (set-buffer gnus-original-article-buffer) - (goto-char (point-min)) - (while (looking-at message-unix-mail-delimiter) - (forward-line 1)) - (setq beg (point)) - (setq end (or (search-forward "\n\n" nil t) (point))) - ;; Delete the headers from the displayed articles. - (set-buffer gnus-article-copy) - (delete-region (goto-char (point-min)) - (or (search-forward "\n\n" nil t) (point-max))) - ;; Insert the original article headers. - (insert-buffer-substring gnus-original-article-buffer beg end) - (article-decode-encoded-words))) + (delete-region (goto-char (point-min)) + (or (search-forward "\n\n" nil t) (point-max))) + ;; Insert the original article headers. + (insert-buffer-substring gnus-original-article-buffer beg end) + (article-decode-encoded-words)))) gnus-article-copy))) (defun gnus-post-news (post &optional group header article-buffer yank subject diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 6c3e5c4..3aae533 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -949,6 +949,8 @@ when prompting the user for which type of files to save." (defvar gnus-article-mime-handles nil) (defvar gnus-article-decoded-p nil) +(defvar gnus-article-charset nil) +(defvar gnus-article-ignored-charsets nil) (defvar gnus-scores-exclude-files nil) (defvar gnus-page-broken nil) (defvar gnus-inhibit-mime-unbuttonizing nil) @@ -5886,6 +5888,10 @@ Given a prefix, will force an `article' buffer configuration." (defun gnus-summary-display-article (article &optional all-header) "Display ARTICLE in article buffer." (gnus-set-global-variables) + (when (gnus-buffer-live-p gnus-article-buffer) + (with-current-buffer gnus-article-buffer + (setq gnus-article-charset gnus-newsgroup-charset) + (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets))) (if (null article) nil (prog1 diff --git a/lisp/gnus.el b/lisp/gnus.el index 68fa965..1184377 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1315,6 +1315,7 @@ slower." ("nnweb" none) ("nnslashdot" post) ("nnultimate" none) + ("nnwfm" none) ("nnwarchive" none) ("nnlistserv" none) ("nnagent" post-mail) @@ -1357,8 +1358,7 @@ this variable. I think." :inline t (list :format "%v" variable - (sexp :tag "Value")))) - )) + (sexp :tag "Value")))))) (gnus-redefine-select-method-widget) diff --git a/lisp/nnultimate.el b/lisp/nnultimate.el index edbdbcc..262955f 100644 --- a/lisp/nnultimate.el +++ b/lisp/nnultimate.el @@ -166,7 +166,7 @@ (setq date (substring (car datel) (match-end 0)) datel nil)) (pop datel)) - (setq date (delete "" (split-string date "[- \n\t\r    ]"))) + (setq date (delete "" (split-string date "[- \n\t\r    ]"))) (if (or (member "AM" date) (member "PM" date)) (setq date (format "%s %s %s %s" @@ -335,7 +335,7 @@ ;; the group is entered, there's 2 new articles in topic one ;; and 1 in topic three. Then Gnus article number 8-9 be 5-6 ;; in topic one and 10 will be the 2 in topic three. - (dolist (row (reverse forum-contents)) + (dolist (row (nreverse forum-contents)) (setq row (nth 2 row)) (when (setq a (nnweb-parse-find 'a row)) (setq subject (car (last (nnweb-text a))) diff --git a/lisp/nnweb.el b/lisp/nnweb.el index 7328882..ded79d9 100644 --- a/lisp/nnweb.el +++ b/lisp/nnweb.el @@ -739,9 +739,9 @@ and `altavista'.") (setq elem (char-to-string elem))) (replace-match elem t t)))) -(defun nnweb-decode-entities-string (str) +(defun nnweb-decode-entities-string (string) (with-temp-buffer - (insert str) + (insert string) (nnweb-decode-entities) (buffer-substring (point-min) (point-max)))) @@ -822,6 +822,11 @@ If FOLLOW-REFRESH is non-nil, redirect refresh url in META." (listp (cdr element))) (nnweb-text-1 element))))) +(defun nnweb-replace-in-string (string match newtext) + (while (string-match match string) + (setq string (replace-match newtext t t string))) + string) + (provide 'nnweb) ;;; nnweb.el ends here diff --git a/lisp/nnwfm.el b/lisp/nnwfm.el new file mode 100644 index 0000000..5ec1a06 --- /dev/null +++ b/lisp/nnwfm.el @@ -0,0 +1,426 @@ +;;; nnwfm.el --- interfacing with a web forum +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen +;; Keywords: news + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Note: You need to have `url' and `w3' installed for this +;; backend to work. + +;;; Code: + +(eval-when-compile (require 'cl)) + +(require 'nnoo) +(require 'message) +(require 'gnus-util) +(require 'gnus) +(require 'nnmail) +(require 'mm-util) +(eval-when-compile + (ignore-errors + (require 'nnweb))) +;; Report failure to find w3 at load time if appropriate. +(eval '(require 'nnweb)) + +(nnoo-declare nnwfm) + +(defvoo nnwfm-directory (nnheader-concat gnus-directory "wfm/") + "Where nnwfm will save its files.") + +(defvoo nnwfm-address "" + "The address of the Ultimate bulletin board.") + +;;; Internal variables + +(defvar nnwfm-groups-alist nil) +(defvoo nnwfm-groups nil) +(defvoo nnwfm-headers nil) +(defvoo nnwfm-articles nil) +(defvar nnwfm-table-regexp + "postings.*editpost\\|forumdisplay\\|Forum[0-9]+/HTML\\|getbio") + +;;; Interface functions + +(nnoo-define-basics nnwfm) + +(deffoo nnwfm-retrieve-headers (articles &optional group server fetch-old) + (nnwfm-possibly-change-server group server) + (unless gnus-nov-is-evil + (let* ((last (car (last articles))) + (did nil) + (start 1) + (entry (assoc group nnwfm-groups)) + (sid (nth 2 entry)) + (topics (nth 4 entry)) + (mapping (nth 5 entry)) + (old-total (or (nth 6 entry) 1)) + (nnwfm-table-regexp "Thread.asp") + headers article subject score from date lines parent point + contents tinfo fetchers map elem a href garticles topic old-max + inc datel table string current-page total-contents pages + farticles forum-contents parse furl-fetched mmap farticle + thread-id tables hstuff bstuff time) + (setq map mapping) + (while (and (setq article (car articles)) + map) + (while (and map + (or (> article (caar map)) + (< (cadar map) (caar map)))) + (pop map)) + (when (setq mmap (car map)) + (setq farticle -1) + (while (and article + (<= article (nth 1 mmap))) + ;; Do we already have a fetcher for this topic? + (if (setq elem (assq (nth 2 mmap) fetchers)) + ;; Yes, so we just add the spec to the end. + (nconc elem (list (cons article + (+ (nth 3 mmap) (incf farticle))))) + ;; No, so we add a new one. + (push (list (nth 2 mmap) + (cons article + (+ (nth 3 mmap) (incf farticle)))) + fetchers)) + (pop articles) + (setq article (car articles))))) + ;; Now we have the mapping from/to Gnus/nnwfm article numbers, + ;; so we start fetching the topics that we need to satisfy the + ;; request. + (if (not fetchers) + (save-excursion + (set-buffer nntp-server-buffer) + (erase-buffer)) + (setq nnwfm-articles nil) + (mm-with-unibyte-buffer + (dolist (elem fetchers) + (erase-buffer) + (setq subject (nth 2 (assq (car elem) topics)) + thread-id (nth 0 (assq (car elem) topics))) + (nnweb-insert + (concat nnwfm-address + (format "Item.asp?GroupID=%d&ThreadID=%d" sid + thread-id))) + (goto-char (point-min)) + (setq contents + (ignore-errors (w3-parse-buffer (current-buffer)))) + (setq tables (caddar (caddar (cdr (caddar (caddar contents)))))) + (setq tables (cdr (caddar (memq (assq 'div tables) tables)))) + (setq contents nil) + (dolist (table tables) + (setq table (caddar (caddar (caddr table))) + hstuff (delete ":link" (nnweb-text (car table))) + bstuff (car (caddar (cdr table))) + from (car hstuff)) + (when (nth 2 hstuff) + (setq time (nnwfm-date-to-time (nth 2 hstuff))) + (push (list from time bstuff) contents))) + (setq contents (nreverse contents)) + (dolist (art (cdr elem)) + (push (list (car art) + (nth (1- (cdr art)) contents) + subject) + nnwfm-articles)))) + (setq nnwfm-articles + (sort nnwfm-articles 'car-less-than-car)) + ;; Now we have all the articles, conveniently in an alist + ;; where the key is the Gnus article number. + (dolist (articlef nnwfm-articles) + (setq article (nth 0 articlef) + contents (nth 1 articlef) + subject (nth 2 articlef)) + (setq from (nth 0 contents) + date (message-make-date (nth 1 contents))) + (push + (cons + article + (make-full-mail-header + article subject + from (or date "") + (concat "<" (number-to-string sid) "%" + (number-to-string article) + "@wfm>") + "" 0 + (/ (length (mapconcat 'identity (nnweb-text (nth 2 contents)) "")) + 70) + nil nil)) + headers)) + (setq nnwfm-headers (sort headers 'car-less-than-car)) + (save-excursion + (set-buffer nntp-server-buffer) + (mm-with-unibyte-current-buffer + (erase-buffer) + (dolist (header nnwfm-headers) + (nnheader-insert-nov (cdr header)))))) + 'nov))) + +(deffoo nnwfm-request-group (group &optional server dont-check) + (nnwfm-possibly-change-server nil server) + (when (not nnwfm-groups) + (nnwfm-request-list)) + (unless dont-check + (nnwfm-create-mapping group)) + (let ((elem (assoc group nnwfm-groups))) + (cond + ((not elem) + (nnheader-report 'nnwfm "Group does not exist")) + (t + (nnheader-report 'nnwfm "Opened group %s" group) + (nnheader-insert + "211 %d %d %d %s\n" (cadr elem) 1 (cadr elem) + (prin1-to-string group)))))) + +(deffoo nnwfm-request-close () + (setq nnwfm-groups-alist nil + nnwfm-groups nil)) + +(deffoo nnwfm-request-article (article &optional group server buffer) + (nnwfm-possibly-change-server group server) + (let ((contents (cdr (assq article nnwfm-articles)))) + (when (setq contents (nth 2 (car contents))) + (save-excursion + (set-buffer (or buffer nntp-server-buffer)) + (erase-buffer) + (nnweb-insert-html contents) + (goto-char (point-min)) + (insert "Content-Type: text/html\nMIME-Version: 1.0\n") + (let ((header (cdr (assq article nnwfm-headers)))) + (mm-with-unibyte-current-buffer + (nnheader-insert-header header))) + (nnheader-report 'nnwfm "Fetched article %s" article) + (cons group article))))) + +(deffoo nnwfm-request-list (&optional server) + (nnwfm-possibly-change-server nil server) + (mm-with-unibyte-buffer + (nnweb-insert + (if (string-match "/$" nnwfm-address) + (concat nnwfm-address "Group.asp") + nnwfm-address)) + (let* ((nnwfm-table-regexp "Thread.asp") + (contents (w3-parse-buffer (current-buffer))) + sid elem description articles a href group forum + a1 a2) + (dolist (row (cdr (nth 2 (car (nth 2 (nnwfm-find-forum-table + contents)))))) + (setq row (nth 2 row)) + (when (setq a (nnweb-parse-find 'a row)) + (setq group (car (last (nnweb-text a))) + href (cdr (assq 'href (nth 1 a)))) + (setq description (car (last (nnweb-text (nth 1 row))))) + (setq articles + (string-to-number + (nnweb-replace-in-string + (car (last (nnweb-text (nth 3 row)))) "," ""))) + (when (and href + (string-match "GroupId=\\([0-9]+\\)" href)) + (setq forum (string-to-number (match-string 1 href))) + (if (setq elem (assoc group nnwfm-groups)) + (setcar (cdr elem) articles) + (push (list group articles forum description nil nil nil nil) + nnwfm-groups)))))) + (nnwfm-write-groups) + (nnwfm-generate-active) + t)) + +(deffoo nnwfm-request-newgroups (date &optional server) + (nnwfm-possibly-change-server nil server) + (nnwfm-generate-active) + t) + +(nnoo-define-skeleton nnwfm) + +;;; Internal functions + +(defun nnwfm-new-threads-p (group time) + "See whether we want to fetch the threads for GROUP written before TIME." + (let ((old-time (nth 7 (assoc group nnwfm-groups)))) + (or (null old-time) + (time-less-p old-time time)))) + +(defun nnwfm-create-mapping (group) + (let* ((entry (assoc group nnwfm-groups)) + (sid (nth 2 entry)) + (topics (nth 4 entry)) + (mapping (nth 5 entry)) + (old-total (or (nth 6 entry) 1)) + (current-time (current-time)) + (nnwfm-table-regexp "Thread.asp") + (furls (list (concat nnwfm-address + (format "Thread.asp?GroupId=%d" sid)))) + fetched-urls + contents forum-contents a subject href + garticles topic tinfo old-max inc parse elem date + url time) + (mm-with-unibyte-buffer + (while furls + (erase-buffer) + (push (car furls) fetched-urls) + (nnweb-insert (pop furls)) + (goto-char (point-min)) + (while (re-search-forward " wr(" nil t) + (forward-char -1) + (setq elem (message-tokenize-header + (buffer-substring + (1+ (point)) + (progn + (forward-sexp 1) + (1- (point)))))) + (push (list + (string-to-number (nth 1 elem)) + (nnweb-replace-in-string (nth 2 elem) "\"" "") + (string-to-number (nth 5 elem))) + forum-contents)) + (when (re-search-forward "href=\"\\(Thread.*DateLast=\\([^\"]+\\)\\)" + nil t) + (setq url (match-string 1) + time (nnwfm-date-to-time (url-unhex-string (match-string 2)))) + (when (and (nnwfm-new-threads-p group time) + (not (member + (setq url (concat + nnwfm-address + (nnweb-decode-entities-string url))) + fetched-urls))) + (push url furls)))) + ;; The main idea here is to map Gnus article numbers to + ;; nnwfm article numbers. Say there are three topics in + ;; this forum, the first with 4 articles, the seconds with 2, + ;; and the third with 1. Then this will translate into 7 Gnus + ;; article numbers, where 1-4 comes from the first topic, 5-6 + ;; from the second and 7 from the third. Now, then next time + ;; the group is entered, there's 2 new articles in topic one + ;; and 1 in topic three. Then Gnus article number 8-9 be 5-6 + ;; in topic one and 10 will be the 2 in topic three. + (dolist (elem (nreverse forum-contents)) + (setq subject (nth 1 elem) + topic (nth 0 elem) + garticles (nth 2 elem)) + (if (setq tinfo (assq topic topics)) + (progn + (setq old-max (cadr tinfo)) + (setcar (cdr tinfo) garticles)) + (setq old-max 0) + (push (list topic garticles subject) topics) + (setcar (nthcdr 4 entry) topics)) + (when (not (= old-max garticles)) + (setq inc (- garticles old-max)) + (setq mapping (nconc mapping + (list + (list + old-total (1- (incf old-total inc)) + topic (1+ old-max))))) + (incf old-max inc) + (setcar (nthcdr 5 entry) mapping) + (setcar (nthcdr 6 entry) old-total)))) + (setcar (nthcdr 7 entry) current-time) + (setcar (nthcdr 1 entry) (1- old-total)) + (nnwfm-write-groups) + mapping)) + +(defun nnwfm-possibly-change-server (&optional group server) + (nnwfm-init server) + (when (and server + (not (nnwfm-server-opened server))) + (nnwfm-open-server server)) + (unless nnwfm-groups-alist + (nnwfm-read-groups) + (setq nnwfm-groups (cdr (assoc nnwfm-address + nnwfm-groups-alist))))) + +(deffoo nnwfm-open-server (server &optional defs connectionless) + (nnheader-init-server-buffer) + (if (nnwfm-server-opened server) + t + (unless (assq 'nnwfm-address defs) + (setq defs (append defs (list (list 'nnwfm-address server))))) + (nnoo-change-server 'nnwfm server defs))) + +(defun nnwfm-read-groups () + (setq nnwfm-groups-alist nil) + (let ((file (expand-file-name "groups" nnwfm-directory))) + (when (file-exists-p file) + (mm-with-unibyte-buffer + (insert-file-contents file) + (goto-char (point-min)) + (setq nnwfm-groups-alist (read (current-buffer))))))) + +(defun nnwfm-write-groups () + (setq nnwfm-groups-alist + (delq (assoc nnwfm-address nnwfm-groups-alist) + nnwfm-groups-alist)) + (push (cons nnwfm-address nnwfm-groups) + nnwfm-groups-alist) + (with-temp-file (expand-file-name "groups" nnwfm-directory) + (prin1 nnwfm-groups-alist (current-buffer)))) + +(defun nnwfm-init (server) + "Initialize buffers and such." + (unless (file-exists-p nnwfm-directory) + (gnus-make-directory nnwfm-directory))) + +(defun nnwfm-generate-active () + (save-excursion + (set-buffer nntp-server-buffer) + (erase-buffer) + (dolist (elem nnwfm-groups) + (insert (prin1-to-string (car elem)) + " " (number-to-string (cadr elem)) " 1 y\n")))) + +(defun nnwfm-find-forum-table (contents) + (catch 'found + (nnwfm-find-forum-table-1 contents))) + +(defun nnwfm-find-forum-table-1 (contents) + (dolist (element contents) + (unless (stringp element) + (when (and (eq (car element) 'table) + (nnwfm-forum-table-p element)) + (throw 'found element)) + (when (nth 2 element) + (nnwfm-find-forum-table-1 (nth 2 element)))))) + +(defun nnwfm-forum-table-p (parse) + (when (not (apply 'gnus-or + (mapcar + (lambda (p) + (nnweb-parse-find 'table p)) + (nth 2 parse)))) + (let ((href (cdr (assq 'href (nth 1 (nnweb-parse-find 'a parse 20))))) + case-fold-search) + (when (and href (string-match nnwfm-table-regexp href)) + t)))) + +(defun nnwfm-date-to-time (date) + (let ((time (mapcar #'string-to-number (split-string date "[\\.\\+ :]")))) + (encode-time 0 (nth 4 time) (nth 3 time) + (nth 0 time) (nth 1 time) + (if (< (nth 2 time) 70) + (+ 2000 (nth 2 time)) + (+ 1900 (nth 2 time)))))) + +(provide 'nnwfm) + +;; Local Variables: +;; coding: iso-8859-1 +;; End: + +;;; nnwfm.el ends here diff --git a/texi/ChangeLog b/texi/ChangeLog index 04873fc..48c64cd 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2000-10-31 Jorge Godoy + + * gnus.texi: gnus-gpg document. + 2000-10-31 Simon Josefsson * gnus.texi (NNTP): Explain `port'. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 9f210dd..1f978cb 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -663,6 +663,7 @@ Composing Messages * Posting Styles:: $B$"$J$?$,C/$G$"$k$+$r;XDj$9$k$h$j4JC1$JJ}K!(B * Drafts:: $B%a%C%;!<%8$N1d4|$H5qH]$5$l$?%a%C%;!<%8(B * Rejected Articles:: $B%5!<%P!<$,$"$J$?$N5-;v$r9%$-$G$J$$$H$-$K2?$,5/$3$k(B? +@c * Using GPG:: How to use GPG and MML to sign and encrypt messages Select Methods @@ -1020,7 +1021,7 @@ Emacs for Heathens @vindex gnus-nntpserver-file @cindex NNTPSERVER @cindex @sc{nntp} server -$B$b$7$3$NJQ?t$,@_Dj$5$l$F$$$J$1$l$P!"(Bgnus $B$O(B @code{NNTPSERVER} $B4D6-JQ?t$r(B +$B$b$7$3$NJQ?t$,@_Dj$5$l$F$$$J$1$l$P!"(Bgnus $B$O(B @env{NNTPSERVER} $B4D6-JQ?t$r(B $BFI$_$K$$$-$^$9!#$b$7$=$NJQ?t$,@_Dj$5$l$F$$$J$1$l$P!"(B gnus $B$O(B @code{gnus-nntpserver-file} ($B@_Dj$5$l$F$$$J$$>l9g(B $B$O(B @file{/etc/nntpserver}) $B$,$3$N7o$K4X$7$F2?$+$r8@$C$F$$$J$$$+$rD4$Y$^(B @@ -9027,6 +9028,7 @@ GNUS $B$d(B Gnus $B$G$O!"$3$N$?$A$N0-$$LdBj$G6C$+$5$l$J$$$h$&$K$9$k$K$O!"35N, @cindex reply @cindex followup @cindex post +@c @cindex using gpg @kindex C-c C-c ($BEj9F(B) $BA4$F$NEj9F$H%a!<%k$NL?Na$O!"(B@kbd{C-c C-c} $B$r2!$9;v$K$h$C$F!"5-;v$rAw?.$9(B @@ -9043,6 +9045,7 @@ GNUS $B$d(B Gnus $B$G$O!"$3$N$?$A$N0-$$LdBj$G6C$+$5$l$J$$$h$&$K$9$k$K$O!"35N, * Posting Styles:: $B$"$J$?$,C/$G$"$k$+$r;XDj$9$k$h$j4JC1$JJ}K!(B * Drafts:: $B%a%C%;!<%8$N1d4|$H5qH]$5$l$?%a%C%;!<%8(B * Rejected Articles:: $B%5!<%P!<$,$"$J$?$N5-;v$r9%$-$G$J$$$H$-$K2?$,5/$3$k(B? +@c * Using GPG:: How to use GPG and MML to sign and encrypt messages @end menu $BEj9F$9$k$Y$-$G$J$+$C$?5-;v$r:o=|$9$k$?$a$N>pJs$O(B @pxref{Canceling and @@ -9498,6 +9501,50 @@ Gnus $B$O30$X=P$F9T$/A4$F$N%a%C%;!<%8$K!"0l$D$+$=$l0J>e$N$=$N%5!<%P!<$N%0(B $B$^$9!#%5!<%P!<$,La$C$F$-$?$J$i!"IaDL$O$=$N%0%k!<%W$KF~$C$FA4$F$N5-;v$rAw(B $B$j$^$9!#(B +@ignore +@node Using GPG +@section Using GPG +@cindex using gpg + +Gnus has an ALPHA support to GPG that's provided by @file{gpg.el} and +@file{mml2015.el}. When viewing signed or encrypted messages, Gnus automatically +asks if you want to verify or decrypt them. + +To use this correctly with GPG, you'll need the following lisp code in your +@file{~/.emacs} or @file{~/.gnus}: + +@lisp +(setq mml2015-use 'gpg) +(setq gpg-temp-directory "~/.gnupg/tmp") +@end lisp + +The @code{gpg-temp-directory} need to point to a directory with permissions set +to 700, for your own safety. + +If you want to benefit of PGP2.6 compatibility, you might create a script named +@file{gpg-2comp} with these instructions: + +@code{ +#!/bin/sh +exec gpg --rfc1991 "$@@" +} + +If you don't want to use such compatibility, you can add the following line to +your @file{~/.emacs} or @file{~/.gnus}: + +@lisp +(setq gpg-command-default-alist (quote ((gpg . "gpg") (gpg-2comp . "gpg")))) +@end lisp + +To sign or encrypt your message you may choose to use the MML Security menu or +@kbd{M-m s p} to sign your message using PGP/MIME, @kbd{M-m s s} to sign your +message using S/MIME. There's also @kbd{M-m c p} to encrypt your message with +PGP/MIME and @kbd{M-m c s} to encrypt using S/MIME. + +Gnus will ask for your passphrase three times and then it will send your +message, if you've typed it correctly. + +@end ignore @node Select Methods @chapter $BA*BrJ}K!(B @cindex foreign groups @@ -13082,7 +13129,7 @@ IMAP $B$O%a!<%k(B ($B$b$7$/$O!"%K%e!<%9!"$b$7$/$O(B ...) $B$rFI$`$?$a$N%M%C $B$h$&$J$b$N$K$J$k$G$7$g$&(B: @lisp -(setq gnus-secondary-select-methods +(setq gnus-secondary-select-methods '((nnimap "simpleserver") ; $BIaDL$N@_Dj(B ; SSH $B%]!<%H$r%U%)%o!<%I$7$?%5!<%P!<(B: (nnimap "dolk" @@ -16831,7 +16878,7 @@ The GNU Emacs Lisp Reference Manual}. XEmacs $B$G$O!"%U%l!<%`%W%m%Q%F%#%j(B @subsection $B%&%#%s%I%&@_Dj$NNc(B @itemize @bullet -@item +@item $B:8B&$r69$a$F%0%k!<%W%P%C%U%!$K!#1&B&$rJ,3d$7$F35N,%P%C%U%!(B ($B>e(B 1/6) $B$H(B $B5-;v%P%C%U%!(B ($B2<(B) $B$K!#(B diff --git a/texi/gnus.texi b/texi/gnus.texi index c8a22cc..b9000c2 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -943,7 +943,7 @@ certainly be much faster. @cindex NNTPSERVER @cindex @sc{nntp} server If this variable is not set, gnus will take a look at the -@code{NNTPSERVER} environment variable. If that variable isn't set, +@env{NNTPSERVER} environment variable. If that variable isn't set, gnus will see whether @code{gnus-nntpserver-file} (@file{/etc/nntpserver} by default) has any opinions on the matter. If that fails as well, gnus will try to use the machine running Emacs as an @sc{nntp} server. That's a long shot, though. @@ -9458,6 +9458,7 @@ This is the delimiter mentioned above. By default, it is @samp{^L} @cindex reply @cindex followup @cindex post +@cindex using gpg @kindex C-c C-c (Post) All commands for posting and mailing will put you in a message buffer @@ -9475,6 +9476,7 @@ on your setup (@pxref{Posting Server}). * Posting Styles:: An easier way to specify who you are. * Drafts:: Postponing messages and rejected messages. * Rejected Articles:: What happens if the server doesn't like your article? +* Using GPG:: How to use GPG and MML to sign and encrypt messages @end menu Also see @pxref{Canceling and Superseding} for information on how to @@ -9948,6 +9950,48 @@ The rejected articles will automatically be put in a special draft group (@pxref{Drafts}). When the server comes back up again, you'd then typically enter that group and send all the articles off. +@node Using GPG +@section Using GPG +@cindex using gpg + +Gnus has an ALPHA support to GPG that's provided by @file{gpg.el} and +@file{mml2015.el}. When viewing signed or encrypted messages, Gnus automatically +asks if you want to verify or decrypt them. + +To use this correctly with GPG, you'll need the following lisp code in your +@file{~/.emacs} or @file{~/.gnus}: + +@lisp +(setq mml2015-use 'gpg) +(setq gpg-temp-directory "~/.gnupg/tmp") +@end lisp + +The @code{gpg-temp-directory} need to point to a directory with permissions set +to 700, for your own safety. + +If you want to benefit of PGP2.6 compatibility, you might create a script named +@file{gpg-2comp} with these instructions: + +@code{ +#!/bin/sh +exec gpg --rfc1991 "$@@" +} + +If you don't want to use such compatibility, you can add the following line to +your @file{~/.emacs} or @file{~/.gnus}: + +@lisp +(setq gpg-command-default-alist (quote ((gpg . "gpg") (gpg-2comp . "gpg")))) +@end lisp + +To sign or encrypt your message you may choose to use the MML Security menu or +@kbd{M-m s p} to sign your message using PGP/MIME, @kbd{M-m s s} to sign your +message using S/MIME. There's also @kbd{M-m c p} to encrypt your message with +PGP/MIME and @kbd{M-m c s} to encrypt using S/MIME. + +Gnus will ask for your passphrase three times and then it will send your +message, if you've typed it correctly. + @node Select Methods @chapter Select Methods