From 91bc600198a281bb3acd040788d7ac92d390f926 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 22 Jan 2002 17:15:29 +0000 Subject: [PATCH] 2002-01-22 Lars Magne Ingebrigtsen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * nnheader.el (nnheader-parse-overview-file): New function. (nnheader-write-overview-file): New function. 2002-01-21 Lars Magne Ingebrigtsen * gnus.el (gnus-group-fast-parameter): Check better if expansion in wanted. * nnweb.el (nnweb-type-definition): Clean up. 2002-01-21 Alastair Burt * gnus-art.el (gnus-mm-display-part): Make sure that the summary buffer exists before jumping to it. 2002-01-21 Lars Magne Ingebrigtsen * gnus-art.el (gnus-article-wash-html-with-w3): Made into own function. (article-wash-html): Use it. (gnus-article-wash-function): New variable. (gnus-article-wash-html-with-w3m): New function. 2002-01-20 Björn Torkelsson * dgnushack.el (dgnushack-compile): Compile smiley-ems for XEmacs. 2002-01-20 John H. Palmieri * gnus-fun.el (gnus-convert-image-to-gray-x-face): More standard command line. --- lisp/ChangeLog | 35 +++++++++++++++++++++++++++++++++++ lisp/dgnushack.el | 2 +- lisp/gnus-art.el | 40 +++++++++++++++++++++++++++++----------- lisp/gnus-fun.el | 3 ++- lisp/gnus.el | 3 ++- lisp/mm-decode.el | 8 -------- lisp/mm-url.el | 17 +++++++++-------- lisp/nnheader.el | 16 ++++++++++++++++ lisp/nnmail.el | 6 +++--- lisp/nnweb.el | 20 ++------------------ 10 files changed, 99 insertions(+), 51 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8f56acfc7..86afab210 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,38 @@ +2002-01-22 Lars Magne Ingebrigtsen + + * nnheader.el (nnheader-parse-overview-file): New function. + (nnheader-write-overview-file): New function. + +2002-01-21 Lars Magne Ingebrigtsen + + * gnus.el (gnus-group-fast-parameter): Check better if expansion + in wanted. + + * nnweb.el (nnweb-type-definition): Clean up. + +2002-01-21 Alastair Burt + + * gnus-art.el (gnus-mm-display-part): Make sure that the summary + buffer exists before jumping to it. + +2002-01-21 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-article-wash-html-with-w3): Made into own + function. + (article-wash-html): Use it. + (gnus-article-wash-function): New variable. + (gnus-article-wash-html-with-w3m): New function. + +2002-01-20 Bj,Av(Brn Torkelsson + + * dgnushack.el (dgnushack-compile): Compile smiley-ems for + XEmacs. + +2002-01-20 John H. Palmieri + + * gnus-fun.el (gnus-convert-image-to-gray-x-face): More standard + command line. + 2002-01-21 Simon Josefsson * canlock.el (base64-encode-string): Autoload it from base64. diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index d37f23cd5..2eb50c468 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -249,7 +249,7 @@ Modify to suit your needs.")) (setq files (delete "nnrss.el" files)))) (dolist (file (if (featurep 'xemacs) - '("md5.el" "smiley-ems.el") + '("md5.el") '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el" "smiley.el"))) (setq files (delete file files))) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 4e9e29904..b397412fc 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1192,6 +1192,12 @@ It is a string, such as \"PGP\". If nil, ask user." :type 'string :group 'mime-security) +(defcustom gnus-article-wash-function 'gnus-article-wash-html-with-w3 + "Function used for converting HTML into text." + :type '(radio (function-item gnus-article-wash-html-with-w3) + (function-item gnus-article-wash-html-with-w3m)) + :group 'gnus-article) + ;;; Internal variables (defvar gnus-english-month-names @@ -2063,15 +2069,24 @@ If READ-CHARSET, ask for a coding system." (save-window-excursion (save-restriction (narrow-to-region (point) (point-max)) - (mm-setup-w3) - (let ((w3-strict-width (window-width)) - (url-standalone-mode t) - (w3-honor-stylesheets nil) - (w3-delay-image-loads t)) - (condition-case var - (w3-region (point-min) (point-max)) - (error)))))))) - + (funcall gnus-article-wash-function)))))) + +(defun gnus-article-wash-html-with-w3 () + "Wash the current buffer with w3." + (mm-setup-w3) + (let ((w3-strict-width (window-width)) + (url-standalone-mode t) + (w3-honor-stylesheets nil) + (w3-delay-image-loads t)) + (condition-case var + (w3-region (point-min) (point-max)) + (error)))) + +(defun gnus-article-wash-html-with-w3m () + "Wash the current buffer with w3m." + (shell-command-on-region + (point) (point-max) "w3m -T text/html" t t)) + (defun article-hide-list-identifiers () "Remove list identifies from the Subject header. The `gnus-list-identifiers' variable specifies what to do." @@ -3935,8 +3950,11 @@ If no internal viewer is available, use an external viewer." (let ((window (selected-window)) (mail-parse-charset gnus-newsgroup-charset) (mail-parse-ignored-charsets - (save-excursion (set-buffer gnus-summary-buffer) - gnus-newsgroup-ignored-charsets))) + (if (gnus-buffer-live-p gnus-summary-buffer) + (save-excursion + (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets) + nil))) (save-excursion (unwind-protect (let ((win (gnus-get-buffer-window (current-buffer) t)) diff --git a/lisp/gnus-fun.el b/lisp/gnus-fun.el index 000a26cd3..dc6c2d7f5 100644 --- a/lisp/gnus-fun.el +++ b/lisp/gnus-fun.el @@ -93,7 +93,8 @@ (insert (if (zerop (logand bits mask)) "0 " "1 "))) (shell-command-on-region (point-min) (point-max) - "pbmtoxbm | compface" + ;; the following is taken from xbmtoikon: + "pbmtoicon | sed '/^[ ]*[*\\\\/]/d; s/[ ]//g; s/,$//' | tr , '\\012' | sed 's/^0x//; s/^/0x/' | pr -l1 -t -w22 -3 -s, | sed 's/,*$/,/' | compface" (current-buffer) t) (push (buffer-string) x-faces)))) (dotimes (i (length x-faces)) diff --git a/lisp/gnus.el b/lisp/gnus.el index c978a7807..627c327d6 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1429,6 +1429,7 @@ slower." ("nnfolder" mail respool address) ("nngateway" post-mail address prompt-address physical-address) ("nnweb" none) + ("nngoogle" post) ("nnslashdot" post) ("nnultimate" none) ("nnrss" none) @@ -2918,7 +2919,7 @@ The function `gnus-group-find-parameter' will do that for you." symbol allow-list)) (when result ;; Expand if necessary. - (if (and (stringp result) (string-match "\\\\" result)) + (if (and (stringp result) (string-match "\\\\[0-9&]" result)) (setq result (gnus-expand-group-parameter (car head) result group))) ;; Exit the loop early. diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 54f61ec84..821ef9487 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -22,14 +22,6 @@ ;;; Commentary: -;; Jaap-Henk Hoepman (jhh@xs4all.nl): -;; -;; Added support for delayed destroy of external MIME viewers. All external -;; viewers for mime types in mm-keep-viewer-alive-types will remain active -;; after switching articles or groups, and will only be removed when exiting -;; gnus. -;; - ;;; Code: (require 'mail-parse) diff --git a/lisp/mm-url.el b/lisp/mm-url.el index 89072f7a5..5baa44d90 100644 --- a/lisp/mm-url.el +++ b/lisp/mm-url.el @@ -32,19 +32,20 @@ (eval-when-compile (require 'cl)) (require 'mm-util) +;;(require 'url) +(require 'w3) (eval-and-compile (autoload 'executable-find "executable") - (autoload 'url-insert-file-contents "url-handlers")) + ;;(autoload 'url-insert-file-contents "url-handlers") + (autoload 'url-insert-file-contents "url") + ) (defgroup mm-url nil "A wrapper of url package and external url command for Gnus." :group 'gnus) -(defcustom mm-url-use-external (not - (condition-case nil - (require 'url-handlers) - (error nil))) +(defcustom mm-url-use-external nil "*If not-nil, use external grab program `mm-url-program'." :type 'boolean :group 'mm-url) @@ -251,7 +252,7 @@ This is taken from RFC 2396.") (if (string-match "^file:/+" url) (insert-file-contents (substring url (1- (match-end 0)))) (mm-url-insert-file-contents-external url)) - (require 'url-handlers) + ;;(require 'url-handlers) (let ((name buffer-file-name)) (prog1 (url-insert-file-contents url) @@ -344,7 +345,7 @@ spaces. Die Die Die." (defun mm-url-fetch-form (url pairs) "Fetch a form from URL with PAIRS as the data using the POST method." - (require 'url-handlers) + ;;(require 'url-handlers) (let ((url-request-data (mm-url-encode-www-form-urlencoded pairs)) (url-request-method "POST") (url-request-extra-headers @@ -354,7 +355,7 @@ spaces. Die Die Die." t) (defun mm-url-fetch-simple (url content) - (require 'url-handlers) + ;;(require 'url-handlers) (let ((url-request-data content) (url-request-method "POST") (url-request-extra-headers diff --git a/lisp/nnheader.el b/lisp/nnheader.el index bbcc67293..c3491b34a 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -399,6 +399,22 @@ on your system, you could say something like: (delete-char 1)) (forward-line 1))) +(defun nnheader-parse-overview-file (file) + "Parse FILE and return a list of headers." + (mm-with-unibyte-buffer + (nnheader-insert-file-contents file) + (goto-char (point-min)) + (let (headers) + (while (not (eobp)) + (push (nnheader-parse-nov) headers) + (forward-line 1)) + (nreverse headers)))) + +(defun nnheader-write-overview-file (file headers) + "Write HEADERS to FILE." + (with-temp-file file + (mapcar 'nnheader-insert-nov headers))) + (defun nnheader-insert-header (header) (insert "Subject: " (or (mail-header-subject header) "(none)") "\n" diff --git a/lisp/nnmail.el b/lisp/nnmail.el index ca5d36fd3..8857595a5 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1022,8 +1022,8 @@ FUNC will be called with the group name to determine the article number." (or (funcall nnmail-split-methods) '("bogus")) (error - (nnheader-message 5 - "Error in `nnmail-split-methods'; using `bogus' mail group") + (nnheader-message + 5 "Error in `nnmail-split-methods'; using `bogus' mail group") (sit-for 1) '("bogus"))))) (setq split (gnus-remove-duplicates split)) @@ -1292,7 +1292,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (let ((value (nth 1 split))) (if (symbolp value) (setq value (cdr (assq value nnmail-split-abbrev-alist)))) - ;; Someone might want to do a \N sub on this match, so get the + ;; Someone might want to do a \N sub on this match, so get the ;; correct match positions. (re-search-backward value start-of-value)) (dolist (sp (nnmail-split-it (car split-rest))) diff --git a/lisp/nnweb.el b/lisp/nnweb.el index fe32198f4..4b31cee64 100644 --- a/lisp/nnweb.el +++ b/lisp/nnweb.el @@ -37,6 +37,7 @@ (require 'nnmail) (require 'mm-util) (require 'mm-url) +(require 'url) (autoload 'w3-parse-buffer "w3-parse") (nnoo-declare nnweb) @@ -50,13 +51,9 @@ Valid types include `google', `dejanews', `dejanewsold', `reference', and `altavista'.") (defvar nnweb-type-definition - '( - (google - ;;(article . nnweb-google-wash-article) - ;;(id . "http://groups.google.com/groups?as_umsgid=%s") + '((google (article . ignore) (id . "http://groups.google.com/groups?selm=%s&output=gplain") - ;;(reference . nnweb-google-reference) (reference . identity) (map . nnweb-google-create-mapping) (search . nnweb-google-search) @@ -73,19 +70,6 @@ and `altavista'.") (search . nnweb-google-search) (address . "http://groups.google.com/groups") (identifier . nnweb-google-identity)) -;;; (dejanews -;;; (article . ignore) -;;; (id . "http://search.dejanews.com/msgid.xp?MID=%s&fmt=text") -;;; (map . nnweb-dejanews-create-mapping) -;;; (search . nnweb-dejanews-search) -;;; (address . "http://www.deja.com/=dnc/qs.xp") -;;; (identifier . nnweb-dejanews-identity)) -;;; (dejanewsold -;;; (article . ignore) -;;; (map . nnweb-dejanews-create-mapping) -;;; (search . nnweb-dejanewsold-search) -;;; (address . "http://www.deja.com/dnquery.xp") -;;; (identifier . nnweb-dejanews-identity)) (reference (article . nnweb-reference-wash-article) (map . nnweb-reference-create-mapping) -- 2.25.1