From: ichikawa Date: Tue, 1 Sep 1998 13:52:05 +0000 (+0000) Subject: Sync up with pgnus-0.13 X-Git-Tag: pgnus-ichikawa-199811302358~236 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51a95163de7f879a2737c417cbed7132dec60703;p=elisp%2Fgnus.git- Sync up with pgnus-0.13 --- diff --git a/Makefile.in b/Makefile.in index 82fd420..b28cda9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,26 +10,26 @@ XEMACS = xemacs21 all: lick info lick: - cd lisp && $(MAKE) EMACS=$(EMACS) lispdir=$(lispdir) all + cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" all install: - cd lisp && $(MAKE) EMACS=$(EMACS) lispdir=$(lispdir) install - cd texi && $(MAKE) EMACS=$(EMACS) install + cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" install + cd texi && $(MAKE) EMACS="$(EMACS)" install # Rule for Lars and nobody else. some: - cd lisp && $(MAKE) EMACS=$(EMACS) some + cd lisp && $(MAKE) EMACS="$(EMACS)" some l: - cd lisp && $(MAKE) EMACS=$(EMACS) clever + cd lisp && $(MAKE) EMACS="$(EMACS)" clever info: - cd texi && $(MAKE) EMACS=$(EMACS) all + cd texi && $(MAKE) EMACS="$(EMACS)" all clean: rm -f */*.orig */*.rej *.orig *.rej xsome: - cd lisp && $(MAKE) EMACS=$(XEMACS) some + cd lisp && $(MAKE) EMACS="$(XEMACS)" some elclean: rm lisp/*.elc diff --git a/lisp/ChangeLog b/lisp/ChangeLog index acb8c2a..689cade 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,104 @@ +Tue Sep 1 10:29:33 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.13 is released. + +1998-09-01 09:14:33 Lars Magne Ingebrigtsen + + * gnus-util.el (gnus-strip-whitespace): Already defined. + Removed. + + * gnus-art.el (gnus-article-decode-charset): Strip whitespace. + + * gnus-util.el (gnus-strip-whitespace): New function. + + * mm-util.el (mm-content-type-charset): Downcase. + +1998-08-31 23:04:29 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-article-decode-charset): Accept a prefix. + (gnus-article-decode-charset): Don't fetch all headers. + + * mm-util.el (mm-read-coding-system): New function. + + * mm-bodies.el (mm-decode-body): Check the right charset. + + * gnus-sum.el (gnus-summary-mode-line-format): Ditto. + + * gnus-art.el (gnus-article-mode-line-format): Use short group + format. + +Mon Aug 31 23:03:13 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.12 is released. + +1998-08-31 22:39:36 Lars Magne Ingebrigtsen + + * mm-bodies.el (mm-decode-body): Don't do charset unless MULE. + + * gnus-art.el (gnus-article-decode-charset): Supply cte. + (gnus-article-decode-charset): Always run. + + * mm-bodies.el (mm-decode-body): Decode cte. + +Mon Aug 31 22:14:50 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.11 is released. + +1998-08-31 14:27:25 Lars Magne Ingebrigtsen + + * message.el (message-encode-message-body): Ditto. + + * gnus-art.el (gnus-article-decode-mime-words): New command and + keystroke. + (gnus-article-decode-charset): Ditto. + (gnus-article-decode-charset): Only work under MULE. + + * mm-util.el (mm-content-type-charset): New function. + + * nnmail.el (nnmail-delete-incoming): Changed to nil. + + * message.el (message-send-mail): Insert MIME headers. + (message-check-news-body-syntax): Don't warn for escape sequences. + (message-check-news-body-syntax): Insert MIME headers. + + * mm-bodies.el (mm-body-encoding): New function. + + * message.el (message-encode-message-body): New function. + + * mm-bodies.el: New file. + + * mm-util.el (mm-narrow-to-head): New function. + + * rfc2047.el (rfc2047-encode): Use it. + + * mm-util.el: Provide mm-encode-coding-region. + + * gnus-sum.el (gnus-summary-mode): Enable multibyte. + + * gnus-util.el (gnus-set-work-buffer): Enable multibyte. + + * mm-util.el (mm-enable-multibyte): New function. + + * message.el (message-set-work-buffer): Set multibyte. + + * gnus.el (gnus-continuum-version): Be valid forever and ever. + + * gnus-util.el (gnus-point-at-eol): Removed. + (gnus-point-at-bol): Ditto. + + * base64.el (base64-decode-region): Commented out messaging. + +1998-08-31 Didier Verna + + * gnus-msg.el (gnus-group-mail): make it behave like + gnus-group-post-news with regards to the prefix (this enables the + use of posting styles). + +1998-08-31 12:53:32 Lars Magne Ingebrigtsen + + * gnus.el (gnus-article-display-hook): Added + gnus-article-decode-rfc1522 to hook. + Mon Aug 31 12:43:46 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.10 is released. diff --git a/lisp/base64.el b/lisp/base64.el index b96e890..819f57b 100644 --- a/lisp/base64.el +++ b/lisp/base64.el @@ -116,7 +116,7 @@ base64-encoder-program.") (defun base64-decode-region (start end) (interactive "r") - (message "Decoding base64...") + ;;(message "Decoding base64...") (let ((work-buffer nil) (done nil) (counter 0) @@ -179,7 +179,8 @@ base64-encoder-program.") (insert-buffer-substring work-buffer) (delete-region (point) end)) (and work-buffer (kill-buffer work-buffer)))) - (message "Decoding base64... done")) + ;;(message "Decoding base64... done") + ) (defun base64-encode-region (start end) (interactive "r") diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index b88f1c1..c057755 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -36,6 +36,7 @@ (require 'browse-url) (require 'alist) (require 'mime-view) +(require 'mm-bodies) (defgroup gnus-article nil "Article display." @@ -410,7 +411,7 @@ beginning of a line." :type 'regexp :group 'gnus-article-various) -(defcustom gnus-article-mode-line-format "Gnus: %%b %S" +(defcustom gnus-article-mode-line-format "Gnus: %g %S" "*The format specification for the article mode line. See `gnus-summary-mode-line-format' for a closer description." :type 'string @@ -967,6 +968,73 @@ characters to translate to." default-mime-charset))) (eword-decode-header charset) ))) +;; Semi-gnus specific +;; + +;; - pgnus specific +(defun gnus-article-decode-mime-words () + "Decode all MIME-encoded words in the article." + (interactive) + (save-excursion + (set-buffer gnus-article-buffer) + (let ((inhibit-point-motion-hooks t) + buffer-read-only) + (rfc2047-decode-region (point-min) (point-max))))) + +(defun gnus-article-decode-charset (&optional prompt) + "Decode charset-encoded text in the article. +If PROMPT (the prefix), prompt for a coding system to use." + (interactive "P") + (save-excursion + (set-buffer gnus-article-buffer) + (let* ((inhibit-point-motion-hooks t) + (ct (message-fetch-field "Content-Type" t)) + (cte (message-fetch-field "Content-Transfer-Encoding" t)) + (charset (cond + (prompt + (mm-read-coding-system "Charset to decode: ")) + (ct + (mm-content-type-charset ct)) + (gnus-newsgroup-name + (gnus-group-find-parameter + gnus-newsgroup-name 'charset)))) + buffer-read-only) + (save-restriction + (goto-char (point-min)) + (search-forward "\n\n" nil 'move) + (narrow-to-region (point) (point-max)) + (mm-decode-body + charset (and cte (intern (downcase (gnus-strip-whitespace cte))))))))) + +(defalias 'gnus-decode-rfc1522 'article-decode-rfc1522) +(defalias 'gnus-article-decode-rfc1522 'article-decode-rfc1522) +(defun article-decode-rfc1522 () + "Remove QP encoding from headers." + (let ((inhibit-point-motion-hooks t) + (buffer-read-only nil)) + (save-restriction + (message-narrow-to-head) + (rfc2047-decode-region (point-min) (point-max))))) + +(defun article-de-quoted-unreadable (&optional force) + "Translate a quoted-printable-encoded article. +If FORCE, decode the article whether it is marked as quoted-printable +or not." + (interactive (list 'force)) + (save-excursion + (let ((buffer-read-only nil) + (type (gnus-fetch-field "content-transfer-encoding"))) + (gnus-article-decode-rfc1522) + (when (or force + (and type (string-match "quoted-printable" (downcase type)))) + (goto-char (point-min)) + (search-forward "\n\n" nil 'move) + (quoted-printable-decode-region (point) (point-max)))))) + +(defun article-mime-decode-quoted-printable-buffer () + "Decode Quoted-Printable in the current buffer." + (quoted-printable-decode-region (point-min) (point-max))) +;; - pgnus specific (defun article-hide-pgp (&optional arg) "Toggle hiding of any PGP headers and signatures in the current article. @@ -1908,8 +1976,7 @@ commands: (buffer-disable-undo (current-buffer)) (setq buffer-read-only t) (set-syntax-table gnus-article-mode-syntax-table) - (when (fboundp 'set-buffer-multibyte) - (set-buffer-multibyte t)) + (mm-enable-multibyte) (gnus-run-hooks 'gnus-article-mode-hook)) (defun gnus-article-setup-buffer () diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index a998d19..c1ed5b6 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -247,11 +247,20 @@ Thank you for your help in stamping out bugs. ;;; Post news commands of Gnus group mode and summary mode -(defun gnus-group-mail () - "Start composing a mail." - (interactive) - (gnus-setup-message 'message - (message-mail))) +(defun gnus-group-mail (&optional arg) + "Start composing a mail. +If ARG, use the group under the point to find a posting style. +If ARG is 1, prompt for a group name to find the posting style." + (interactive "P") + (let ((gnus-newsgroup-name + (if arg + (if (= 1 (prefix-numeric-value arg)) + (completing-read "Use style of group: " gnus-active-hashtb nil + (gnus-read-active-file-p)) + (gnus-group-group-name)) + ""))) + (gnus-setup-message 'message (message-mail)) + )) (defun gnus-group-post-news (&optional arg) "Start composing a news message. @@ -377,8 +386,7 @@ header line with the old Message-ID." (buffer-disable-undo gnus-article-copy) (save-excursion (set-buffer gnus-article-copy) - (when (fboundp 'set-buffer-multibyte) - (set-buffer-multibyte t))) + (mm-enable-multibyte)) (let ((article-buffer (or article-buffer gnus-article-buffer)) end beg) (if (not (and (get-buffer article-buffer) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 25ea873..2c23302 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -508,7 +508,7 @@ with some simple extensions. :group 'gnus-threading :type 'string) -(defcustom gnus-summary-mode-line-format "Gnus: %%b [%A] %Z" +(defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" "*The format specification for the summary mode line. It works along the same lines as a normal formatting string, with some simple extensions: @@ -1405,6 +1405,10 @@ increase the score of each group you read." "c" gnus-article-highlight-citation "s" gnus-article-highlight-signature) + (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) + "w" gnus-article-decode-mime-words + "c" gnus-article-decode-charset) + (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) "z" gnus-article-date-ut "u" gnus-article-date-ut @@ -1504,6 +1508,10 @@ increase the score of each group you read." ["Headers" gnus-article-highlight-headers t] ["Signature" gnus-article-highlight-signature t] ["Citation" gnus-article-highlight-citation t]) + ("MIME" + ["Words" gnus-article-decode-mime-words t] + ["Charset" gnus-article-decode-charset t] + ["QP" gnus-article-de-quoted-unreadable t]) ("Date" ["Local" gnus-article-date-local t] ["ISO8601" gnus-article-date-iso8601 t] @@ -1895,6 +1903,7 @@ The following commands are available: (make-local-hook 'pre-command-hook) (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) (gnus-run-hooks 'gnus-summary-mode-hook) + (mm-enable-multibyte) (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) (gnus-update-summary-mark-positions)) @@ -4569,10 +4578,9 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." number dependencies force-new)))) (push header headers)) (forward-line 1)) - ;(error - ; (gnus-error 4 "Strange nov line (%d)" - ; (count-lines (point-min) (point)))) - ) + (error + (gnus-error 4 "Strange nov line (%d)" + (count-lines (point-min) (point))))) (forward-line 1)) ;; A common bug in inn is that if you have posted an article and ;; then retrieves the active file, it will answer correctly -- diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index b6c04db..1cc28ce 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -109,33 +109,15 @@ (when (gnus-buffer-exists-p buf) (kill-buffer buf)))) -(cond - ((fboundp 'point-at-bol) - (fset 'gnus-point-at-bol 'point-at-bol)) - ((fboundp 'line-beginning-position) - (fset 'gnus-point-at-bol 'line-beginning-position)) - (t - (defun gnus-point-at-bol () - "Return point at the beginning of the line." - (let ((p (point))) - (beginning-of-line) - (prog1 - (point) - (goto-char p)))))) - -(cond - ((fboundp 'point-at-eol) - (fset 'gnus-point-at-eol 'point-at-eol)) - ((fboundp 'line-end-position) - (fset 'gnus-point-at-eol 'line-end-position)) - (t - (defun gnus-point-at-eol () - "Return point at the end of the line." - (let ((p (point))) - (end-of-line) - (prog1 - (point) - (goto-char p)))))) +(fset 'gnus-point-at-bol + (if (fboundp 'point-at-bol) + 'point-at-bol + 'line-beginning-position)) + +(fset 'gnus-point-at-eol + (if (fboundp 'point-at-eol) + 'point-at-eol + 'line-end-position)) (defun gnus-delete-first (elt list) "Delete by side effect the first occurrence of ELT as a member of LIST." @@ -553,7 +535,7 @@ Timezone package is used." (erase-buffer)) (set-buffer (gnus-get-buffer-create gnus-work-buffer)) (kill-all-local-variables) - (buffer-disable-undo (current-buffer)))) + (mm-enable-multibyte))) (defmacro gnus-group-real-name (group) "Find the real name of a foreign newsgroup." diff --git a/lisp/gnus.el b/lisp/gnus.el index ad333eb..97e17bb 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -253,10 +253,10 @@ is restarted, and sometimes reloaded." (defconst gnus-product-name "T-gnus" "Product name of this version of gnus.") -(defconst gnus-version-number "6.9.04" +(defconst gnus-version-number "6.9.07" "Version number for this version of gnus.") -(defconst gnus-original-version-number "0.10" +(defconst gnus-original-version-number "0.13" "Version number for this version of Gnus.") (defconst gnus-original-product-name "Pterodactyl Gnus" @@ -1358,11 +1358,15 @@ face." (defcustom gnus-article-display-hook (if (and (string-match "XEmacs" emacs-version) (featurep 'xface)) +;; '(gnus-article-decode-charset - comment out for Semi-gnus +;; gnus-article-decode-rfc1522 - comment out for Semi-gnus '(gnus-article-hide-headers-if-wanted gnus-article-hide-boring-headers gnus-article-treat-overstrike gnus-article-maybe-highlight gnus-article-display-x-face) +;; '(gnus-article-decode-charset - comment out for Semi-gnus +;; gnus-article-decode-rfc1522 - comment out for Semi-gnus '(gnus-article-hide-headers-if-wanted gnus-article-hide-boring-headers gnus-article-treat-overstrike @@ -1581,6 +1585,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") '(("info" Info-goto-node) ("pp" pp pp-to-string pp-eval-expression) ("qp" quoted-printable-decode-region quoted-printable-decode-string) + ("rfc2047" rfc2047-decode-region rfc2047-decode-string) ("ps-print" ps-print-preprint) ("mail-extr" mail-extract-address-components) ("browse-url" browse-url) @@ -1701,7 +1706,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") gnus-article-next-page gnus-article-prev-page gnus-request-article-this-buffer gnus-article-mode gnus-article-setup-buffer gnus-narrow-to-page - gnus-article-delete-invisible-text) + gnus-article-delete-invisible-text gnus-hack-decode-rfc1522) ("gnus-art" :interactive t gnus-article-hide-headers gnus-article-hide-boring-headers gnus-article-treat-overstrike gnus-article-word-wrap @@ -1713,7 +1718,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") gnus-article-date-original gnus-article-date-lapsed gnus-article-show-all-headers gnus-article-edit-mode gnus-article-edit-article - gnus-article-edit-done + gnus-article-edit-done gnus-decode-rfc1522 article-decode-rfc1522 gnus-start-date-timer gnus-stop-date-timer) ("gnus-int" gnus-request-type) ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1 @@ -2010,14 +2015,13 @@ If ARG, insert string at point." (string-to-number (if (zerop major) (format "%s00%02d%02d" - (cond - ((member alpha '("(ding)" "d")) "4.99") - ((member alpha '("September" "s")) "5.01") - ((member alpha '("Red" "r")) "5.03") - ((member alpha '("Quassia" "q")) "5.05") - ((member alpha '("Pterodactyl" "p")) "5.07") - ((member alpha '("o")) "5.09") - ((member alpha '("n")) "5.11")) + (if (member alpha '("(ding)" "d")) + "4.99" + (+ 5 (* 0.02 + (abs + (- (char-int (aref (downcase alpha) 0)) + (char-int ?t)))) + -0.01)) minor least) (format "%d.%02d%02d" major minor least)))))) diff --git a/lisp/message.el b/lisp/message.el index b1720fd..41a2149 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -46,6 +46,8 @@ (require 'mail-abbrevs) (require 'mailabbrev)) (require 'mime-edit) +(require 'rfc2047) +(require 'mm-bodies) (defgroup message '((user-mail-address custom-variable) (user-full-name custom-variable)) @@ -1181,7 +1183,7 @@ The cdr of ech entry is a function for applying the face to a region.") (erase-buffer)) (set-buffer (get-buffer-create " *message work*")) (kill-all-local-variables) - (buffer-disable-undo (current-buffer)))) + (mm-enable-multibyte))) (defun message-functionp (form) "Return non-nil if FORM is funcallable." @@ -1505,8 +1507,7 @@ C-c C-r message-caesar-buffer-body (rot13 the message body)." (setq adaptive-fill-first-line-regexp (concat "[ \t]*[-a-z0-9A-Z]*>+[ \t]*\\|" adaptive-fill-first-line-regexp)) - (when (fboundp 'set-buffer-multibyte) - (set-buffer-multibyte t)) + (mm-enable-multibyte) (run-hooks 'text-mode-hook 'message-mode-hook)) @@ -2197,8 +2198,10 @@ the user from the mailer." (let ((message-deletable-headers (if news nil message-deletable-headers))) (message-generate-headers message-required-mail-headers)) +;; (rfc2047-encode-message-header) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) +;; (message-encode-message-body) (unwind-protect (save-excursion (set-buffer tembuf) @@ -2398,8 +2401,10 @@ to find out how to use this." (message-narrow-to-headers) ;; Insert some headers. (message-generate-headers message-required-news-headers) +;; (rfc2047-encode-message-header) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) +;; (message-encode-message-body) (message-cleanup-headers) (if (not (message-check-news-syntax)) (progn @@ -2709,7 +2714,7 @@ to find out how to use this." (y-or-n-p "Empty article. Really post? ")))) ;; Check for control characters. (message-check 'control-chars - (if (re-search-forward "[\000-\007\013\015-\037\200-\237]" nil t) + (if (re-search-forward "[\000-\007\013\015-\032\034-\037\200-\237]" nil t) (y-or-n-p "The article contains control characters. Really post? ") t)) @@ -4496,6 +4501,32 @@ regexp varstr." (setq idx (1+ idx))) string)) +;;; +;;; MIME functions +;;; + +(defun message-encode-message-body () + "Examine the message body, encode it, and add the requisite headers." + (when (featurep 'mule) + (save-excursion + (save-restriction + (message-narrow-to-headers) + (message-remove-header + "^Content-Transfer-Encoding:\\|^Content-Type:\\|^Mime-Version:" t) + (goto-char (point-max)) + (widen) + (narrow-to-region (point) (point-max)) + (let* ((charset (mm-encode-body)) + (encoding (mm-body-encoding))) + (when (consp charset) + (error "Can't encode messages with multiple charsets (yet)")) + (widen) + (message-narrow-to-headers) + (goto-char (point-max)) + (mm-insert-rfc822-headers + (or charset (mm-mule-charset-to-mime-charset 'ascii)) + encoding)))))) + (run-hooks 'message-load-hook) (provide 'message) diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el new file mode 100644 index 0000000..5b33ac9 --- /dev/null +++ b/lisp/mm-bodies.el @@ -0,0 +1,101 @@ +;;; mm-bodies.el --- Functions for decoding MIME things +;; Copyright (C) 1998 Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen +;; MORIOKA Tomohiko +;; 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: + +;;; Code: + +(require 'mm-util) + +(defun mm-encode-body () + "Encode a body. +Should be called narrowed to the body that is to be encoded. +If there is more than one non-ASCII MULE charset, then list of found +MULE charsets are returned. +If successful, the MIME charset is returned. +If no encoding was done, nil is returned." + (save-excursion + (goto-char (point-min)) + (let ((charsets + (delq 'ascii (find-charset-region (point-min) (point-max)))) + charset) + (cond + ;; No encoding. + ((null charsets) + nil) + ;; Too many charsets. + ((> (length charsets) 1) + charsets) + ;; We encode. + (t + (let ((mime-charset (mm-mule-charset-to-mime-charset (car charsets))) + start) + (when (not (mm-coding-system-equal + mime-charset buffer-file-coding-system)) + (while (not (eobp)) + (if (eq (char-charset (following-char)) 'ascii) + (when start + (mm-encode-coding-region start (point) mime-charset) + (setq start nil)) + (unless start + (setq start (point)))) + (forward-char 1)) + (when start + (mm-encode-coding-region start (point) mime-charset) + (setq start nil))) + mime-charset)))))) + +(defun mm-body-encoding () + "Return the encoding of the current buffer." + (if (null (delq 'ascii (find-charset-region (point-min) (point-max)))) + '7bit + '8bit)) + +;;; +;;; Functions for decoding +;;; + +(defun mm-decode-body (charset encoding) + "Decode the current article that has been encoded with ENCODING. +The characters in CHARSET should then be decoded." + (save-excursion + (when encoding + (cond + ((eq encoding 'quoted-printable) + (quoted-printable-decode-region (point-min) (point-max))) + ((eq encoding 'base64) + (base64-decode-region (point-min) (point-max))) + ((memq encoding '(7bit 8bit binary)) + ) + (t + (error "Can't decode encoding %s" encoding)))) + (when (featurep 'mule) + (let (mule-charset) + (when (and charset + (setq mule-charset (mm-charset-to-coding-system charset)) + (not (mm-coding-system-equal + buffer-file-coding-system mule-charset))) + (mm-decode-coding-region (point-min) (point-max) mule-charset)))))) + +(provide 'mm-bodies) + +;; mm-bodies.el ends here diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index d6275aa..9d0a44b 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -1,4 +1,4 @@ -;;; mm-decode.el --- Function for decoding MIME things +;;; mm-decode.el --- Functions for decoding MIME things ;; Copyright (C) 1998 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 67018f4..48ad195 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -35,10 +35,25 @@ (fset 'mm-encode-coding-string (lambda (s a) s)))) (eval-and-compile + (if (fboundp 'encode-coding-region) + (fset 'mm-encode-coding-region 'encode-coding-region) + (fset 'mm-encode-coding-string 'ignore))) + +(eval-and-compile + (if (fboundp 'decode-coding-region) + (fset 'mm-decode-coding-region 'decode-coding-region) + (fset 'mm-decode-coding-string 'ignore))) + +(eval-and-compile (if (fboundp 'coding-system-list) (fset 'mm-coding-system-list 'coding-system-list) (fset 'mm-coding-system-list 'ignore))) +(eval-and-compile + (if (fboundp 'coding-system-equal) + (fset 'mm-coding-system-equal 'coding-system-equal) + (fset 'mm-coding-system-equal 'equal))) + (defvar mm-mime-mule-charset-alist '((us-ascii ascii) (iso-8859-1 latin-iso8859-1) @@ -139,6 +154,30 @@ used as the line break code type of the coding system." (setq idx (1+ idx))) string)) +(defun mm-enable-multibyte () + "Enable multibyte in the current buffer." + (when (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte t))) + +(defun mm-insert-rfc822-headers (charset encoding) + "Insert text/plain headers with CHARSET and ENCODING." + (insert "MIME-Version: 1.0\n") + (insert "Content-Type: text/plain; charset=\"" + (downcase (symbol-name charset)) "\"\n") + (insert "Content-Transfer-Encoding: " + (downcase (symbol-name encoding)) "\n")) + +(defun mm-content-type-charset (header) + "Return the charset parameter from HEADER." + (when (string-match "charset *= *\"? *\\([-0-9a-zA-Z_]+\\)\"? *$" header) + (intern (downcase (match-string 1 header))))) + +(defun mm-read-coding-system (prompt) + "Prompt the user for a coding system." + (completing-read + prompt (mapcar (lambda (s) (list (symbol-name (car s)))) + mm-mime-mule-charset-alist))) + (provide 'mm-util) ;;; mm-util.el ends here diff --git a/lisp/nnheader.el b/lisp/nnheader.el index bbeba0f..98da659 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -399,7 +399,6 @@ the line could be found." (unless (gnus-buffer-live-p nntp-server-buffer) (setq nntp-server-buffer (get-buffer-create " *nntpd*"))) (set-buffer nntp-server-buffer) - (buffer-disable-undo (current-buffer)) (erase-buffer) (kill-all-local-variables) (setq case-fold-search t) ;Should ignore case. diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 3124586..c4165d3 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -408,7 +408,7 @@ Example: :group 'nnmail-split :type '(repeat (cons :format "%v" symbol regexp))) -(defcustom nnmail-delete-incoming t +(defcustom nnmail-delete-incoming nil "*If non-nil, the mail backends will delete incoming files after splitting." :group 'nnmail-retrieve diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 81241c2..a85f6a5 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -184,10 +184,7 @@ Should be called narrowed to the head of the message." (downcase (symbol-name encoding)) "?"))) (save-restriction (narrow-to-region b e) - (insert - (prog1 - (mm-encode-coding-string (buffer-string) mime-charset) - (delete-region (point-min) (point-max)))) + (mm-encode-coding-region b e mime-charset) (funcall (cdr (assq encoding rfc2047-encoding-function-alist)) (point-min) (point-max)) (goto-char (point-min)) @@ -249,6 +246,7 @@ Should be called narrowed to the head of the message." (defun rfc2047-decode-string (string) "Decode the quoted-printable-encoded STRING and return the results." (with-temp-buffer + (mm-enable-multibyte) (insert string) (inline (rfc2047-decode-region (point-min) (point-max))) @@ -269,7 +267,7 @@ Return WORD if not." word))) (defun rfc2047-decode (charset encoding string) - "Decode STRING as an encoded text. + "Decode STRING that uses CHARSET with ENCODING. Valid ENCODINGs are \"B\" and \"Q\". If your Emacs implementation can't decode CHARSET, it returns nil." (let ((cs (mm-charset-to-coding-system charset))) diff --git a/texi/ChangeLog b/texi/ChangeLog index 335a4d4..e62f15e 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,6 +1,8 @@ 1998-08-31 11:46:57 Lars Magne Ingebrigtsen * gnus.texi (Mail Folders): Addition. + (Group Parameters): Addition. + (MIME Commands): New. 1998-08-27 07:29:17 Lars Magne Ingebrigtsen diff --git a/texi/gnus.texi b/texi/gnus.texi index b92f721..eb74232 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Semi-gnus 6.9.04 Manual +@settitle Semi-gnus 6.0.07 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -318,7 +318,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Semi-gnus 6.9.04 Manual +@title Semi-gnus 6.0.07 Manual @author by Lars Magne Ingebrigtsen @page @@ -361,7 +361,7 @@ internationalization/localization and multiscript features based on MULE API. So Semi-gnus does not discriminate various language communities. Oh, if you are a Klingon, please wait Unicode Next Generation. -This manual corresponds to Semi-gnus 6.9.04. +This manual corresponds to Semi-gnus 6.0.07. @end ifinfo @@ -2129,6 +2129,11 @@ Elements that look like @code{(comment . "This is a comment")} are arbitrary comments on the group. They are currently ignored by gnus, but provide a place for you to store information on particular groups. +@item charset +Elements that look like @code{(charset . iso-8859-1)} will make +@code{iso-8859-1} the default charset; that is, the charset that will be +used for all articles that do not specify a charset. + @item @var{(variable form)} You can use the group parameters to set variables local to the group you are entering. If you want to turn threading off in @samp{news.answers}, @@ -3203,6 +3208,7 @@ You can have as many summary buffers open as you wish. * Saving Articles:: Ways of customizing article saving. * Decoding Articles:: Gnus can treat series of (uu)encoded articles. * Article Treatment:: The article buffer can be mangled at will. +* MIME Commands:: Doing MIMEy things with the articles. * Article Commands:: Doing various things with the article buffer. * Summary Sorting:: Sorting the summary buffer in various ways. * Finding the Parent:: No child support? Get the parent. @@ -6761,6 +6767,31 @@ the regular expression @samp{^---*Forwarded article}, then it isn't a signature after all. +@node MIME Commands +@section MIME Commands +@cindex MIME decoding + +@table @kbd +@item W M w +@kindex W M w (Summary) +Decode RFC2047-encoded words in the article headers +(@code{gnus-article-decode-mime-words}). + +@item W M c +@kindex W M c (Summary) +Decode encoded article bodies as well as charsets +(@code{gnus-article-decode-charset}). + +This command looks in the @code{Content-Type} header to determine the +charset. If there is no such header in the article, you can give it a +prefix, which will prompt for the charset to decode as. In regional +groups where people post using some common encoding (but do not include +MIME headers), you can set the @code{charset} group/topic parameter to +the required charset (@pxref{Group Parameters}). + +@end table + + @node Article Commands @section Article Commands @@ -14359,7 +14390,8 @@ Do highlights in the group buffer. @item summary-highlight Do highlights in the summary buffer. @item article-highlight -Do highlights in the article buffer. +Do highlights according to @code{gnus-article-display-hook} in the +article buffer. @item highlight Turn on highlighting in all buffers. @item group-menu diff --git a/texi/message.texi b/texi/message.texi index 482b0d3..96122e7 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Pterodactyl Message 0.10 Manual +@settitle Pterodactyl Message 0.13 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -42,7 +42,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Pterodactyl Message 0.10 Manual +@title Pterodactyl Message 0.13 Manual @author by Lars Magne Ingebrigtsen @page @@ -83,7 +83,7 @@ Message mode buffers. * Key Index:: List of Message mode keys. @end menu -This manual corresponds to Pterodactyl Message 0.10. Message is +This manual corresponds to Pterodactyl Message 0.13. Message is distributed with the Gnus distribution bearing the same version number as this manual has.