From c971b856674f06a000b973ef6ac5e5e7134cd705 Mon Sep 17 00:00:00 2001 From: ichikawa Date: Sun, 17 Jan 1999 11:26:12 +0000 Subject: [PATCH 1/1] Importing pgnus-0.71 --- lisp/ChangeLog | 58 +++++++++ lisp/gnus-agent.el | 2 +- lisp/gnus-art.el | 347 ++++++++++++++++++++++++++++++++++++++++++---------- lisp/gnus-cus.el | 7 +- lisp/gnus-msg.el | 25 ++++ lisp/gnus-picon.el | 6 +- lisp/gnus-start.el | 20 +-- lisp/gnus-sum.el | 114 ++++++----------- lisp/gnus-uu.el | 3 +- lisp/gnus.el | 79 ++++-------- lisp/lpath.el | 3 +- lisp/mail-parse.el | 1 + lisp/mail-prsvr.el | 34 +++++ lisp/message.el | 16 ++- lisp/mm-bodies.el | 10 +- lisp/mm-util.el | 34 ++--- lisp/mm-view.el | 3 +- lisp/nnmail.el | 3 +- lisp/rfc2047.el | 28 ++--- lisp/smiley.el | 2 +- texi/gnus.texi | 10 +- texi/message.texi | 6 +- 22 files changed, 525 insertions(+), 286 deletions(-) create mode 100644 lisp/mail-prsvr.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b98090..2b73d3f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,61 @@ +Sat Jan 16 03:15:57 1999 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.71 is released. + +1999-01-16 00:13:31 Lars Magne Ingebrigtsen + + * mm-view.el (mm-inline-image): Don't add a dot. + + * gnus-art.el (gnus-treat-article): New function. + + * gnus.el (gnus-article-display-hook): Removed. + + * gnus-art.el (gnus-article-treat-custom): New variable. + + * gnus-start.el (gnus-ignored-newsgroups-has-to-p): Removed. + + * gnus-msg.el (gnus-setup-posting-charset): Allow variables and + functions. + + * message.el (message-posting-charset): New variable. + (message-send-mail): Use it. + + * gnus-msg.el (gnus-group-posting-charset-alist): Moved here. + (gnus-setup-posting-charset): New function. + (gnus-setup-message): Use it. + + * message.el (message-encode-message-body): Just look for + Content-Type before inserting a new one. + +1999-01-15 23:08:47 Lars Magne Ingebrigtsen + + * rfc2047.el (rfc2047-default-charset): Removed. + + * mail-prsvr.el: New file. + (mail-parse-charset): New variable. + + * gnus-sum.el (gnus-newsgroup-charset): Changed name. + Changed name. + + * gnus.el (gnus-charset): New group. + + * nnmail.el (nnmail-pathname-coding-system): Default to binary. + + * gnus-sum.el (gnus-default-charset): Default to nil. + (gnus-newsgroup-iso-8859-1-forced-regexp): Removed. + (gnus-newsgroup-iso-8859-1-forced): Removed. + + * mm-util.el (mm-known-charsets): Removed. + (mm-default-coding-system): Removed. + (mm-default-charset): Removed. + (mm-read-charset): New function. + + * message.el (message-default-charset): Removed. + + * rfc2047.el (rfc2047-default-charset): Default to nil. + + * mm-util.el (mm-charset-iso-8859-1-forced): Removed. + Fri Jan 15 20:50:38 1999 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.70 is released. diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index b27acb4..cd3d647 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -333,7 +333,7 @@ agent minor mode in all Gnus buffers." (gnus-request-create-group "queue" '(nndraft "")) (let ((gnus-level-default-subscribed 1)) (gnus-subscribe-group "nndraft:queue" nil '(nndraft ""))) - (gnus-group-set-parameter "nndraft:queue" 'charset "nil") + (gnus-group-set-parameter "nndraft:queue" 'charset nil) (gnus-group-set-parameter "nndraft:queue" 'gnus-dummy '((gnus-draft-mode))))) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 993230e..e19fc39 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -45,6 +45,11 @@ :link '(custom-manual "(gnus)The Article Buffer") :group 'gnus) +(defgroup gnus-article-treat nil + "Treating article parts." + :link '(custom-manual "(gnus)Article Hiding") + :group 'gnus-article) + (defgroup gnus-article-hiding nil "Hiding article parts." :link '(custom-manual "(gnus)Article Hiding") @@ -582,26 +587,194 @@ displayed by the first non-nil matching CONTENT face." :group 'gnus-article-mime :type '(repeat regexp)) -(defcustom gnus-treat-body-highlight-signature t - "Highlight the signature." - :group 'gnus-article - :type '(choice (const :tag "Off" nil) - (const :tag "On" t) - (const :tag "Last" last) - (integer :tag "Less") - (sexp :tag "Predicate"))) - (defcustom gnus-article-mime-part-function nil - "Function called with a MIME handle as the argument." + "Function called with a MIME handle as the argument. +This is meant for people who want to do something automatic based +on parts -- for instance, adding Vcard info to a database." :group 'gnus-article-mime :type 'function) +;;; +;;; The treatment variables +;;; + +(defvar gnus-article-treat-custom + '(choice (const :tag "Off" nil) + (const :tag "On" t) + (const :tag "Header" head) + (const :tag "Last" last) + (integer :tag "Less") + (sexp :tag "Predicate"))) + +(defvar gnus-article-treat-types '("text/plain") + "Parts to treat.") + +(defvar gnus-inhibit-treatment nil + "Whether to inhibit treatment.") + +(defcustom gnus-treat-highlight-signature 'last + "Highlight the signature." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-buttonize t + "Add buttons." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-buttonize-head 'head + "Add buttons to the head." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-emphasize t + "Emphasize text." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-cr nil + "Remove carriage returns." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-hide-headers 'head + "Hide headers." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-hide-boring-headers nil + "Hide boring headers." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-hide-signature nil + "Hide the signature." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-fill-article nil + "Fill the article." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-hide-citation nil + "Hide cited text." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-pgp t + "Strip PGP signatures." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-pem nil + "Strip PEM signatures." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-highlight-headers 'head + "Highlight the headers." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-highlight-citation t + "Highlight cited text." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-date-ut nil + "Display the Date in UT (GMT)." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-date-local nil + "Display the Date in the local timezone." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-date-lapsed nil + "Display the Date header in a way that says how much time has elapsed." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-date-original nil + "Display the date in the original timezone." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-trailing-blank-lines nil + "Strip trailing blank lines." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-leading-blank-lines nil + "Strip leading blank lines." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-multiple-blank-lines nil + "Strip multiple blank lines." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-strip-blank-lines nil + "Strip all blank lines." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-overstrike t + "Treat overstrike highlighting." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-display-xface (if gnus-xemacs 'head nil) + "Display X-Face headers." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-display-smileys (if gnus-xemacs t nil) + "Display smileys." + :group 'gnus-article-treat + :type gnus-article-treat-custom) + +(defcustom gnus-treat-display-picons (if gnus-xemacs 'head nil) + "Display picons." + :group 'gnus-article + :type gnus-article-treat-custom) + ;;; Internal variables (defvar gnus-article-mime-handle-alist-1 nil) (defvar gnus-treatment-function-alist - '((gnus-treat-body-highlight-signature gnus-article-highlight-signature nil) - )) + '((gnus-treat-highlight-signature gnus-article-highlight-signature) + (gnus-treat-buttonize gnus-article-add-buttons) + (gnus-treat-buttonize-head gnus-article-add-buttons-to-head) + (gnus-treat-emphasize gnus-article-emphasize) + (gnus-treat-fill-article gnus-article-fill-cited-article) + (gnus-treat-strip-cr gnus-article-remove-cr) + (gnus-treat-hide-headers gnus-article-hide-headers) + (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers) + (gnus-treat-hide-signature gnus-article-hide-signature) + (gnus-treat-hide-citation gnus-article-hide-citation) + (gnus-treat-strip-pgp gnus-article-hide-pgp) + (gnus-treat-strip-pem gnus-article-hide-pem) + (gnus-treat-highlight-headers gnus-article-highlight-headers) + (gnus-treat-highlight-citation gnus-article-highlight-citation) + (gnus-treat-highlight-signature gnus-article-highlight-signature) + (gnus-treat-date-ut gnus-article-date-ut) + (gnus-treat-date-local gnus-article-date-local) + (gnus-treat-date-lapsed gnus-article-date-lapsed) + (gnus-treat-date-original gnus-article-date-original) + (gnus-treat-strip-trailing-blank-lines + gnus-article-remove-trailing-blank-lines) + (gnus-treat-strip-leading-blank-lines + gnus-article-strip-leading-blank-lines) + (gnus-treat-strip-multiple-blank-lines + gnus-article-strip-multiple-blank-lines) + (gnus-treat-strip-blank-lines gnus-article-strip-blank-lines) + (gnus-treat-overstrike gnus-article-treat-overstrike) + (gnus-treat-display-xface gnus-article-display-x-face) + (gnus-treat-display-smileys gnus-smiley-display))) (defvar gnus-article-mime-handle-alist nil) (defvar article-lapsed-timer nil) @@ -1084,8 +1257,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (set-buffer gnus-article-buffer) (let ((inhibit-point-motion-hooks t) buffer-read-only - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (mail-decode-encoded-word-region (point-min) (point-max))))) (defun article-decode-charset (&optional prompt) @@ -1107,8 +1279,7 @@ If PROMPT (the prefix), prompt for a coding system to use." (mm-read-coding-system "Charset to decode: ")) (ctl (mail-content-type-get ctl 'charset)))) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced) + (mail-parse-charset gnus-newsgroup-charset) buffer-read-only) (goto-char (point-max)) (widen) @@ -1125,8 +1296,7 @@ If PROMPT (the prefix), prompt for a coding system to use." (defun article-decode-encoded-words () "Remove encoded-word encoding from headers." (let ((inhibit-point-motion-hooks t) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced) + (mail-parse-charset gnus-newsgroup-charset) buffer-read-only) (save-restriction (message-narrow-to-head) @@ -1140,9 +1310,7 @@ or not." (save-excursion (let ((buffer-read-only nil) (type (gnus-fetch-field "content-transfer-encoding")) - (charset - (or gnus-newsgroup-default-charset mm-default-coding-system)) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (charset gnus-newsgroup-charset)) (when (or force (and type (string-match "quoted-printable" (downcase type)))) (article-goto-body) @@ -2291,9 +2459,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-run-hooks 'gnus-tmp-internal-hook) (gnus-run-hooks 'gnus-article-prepare-hook) (when gnus-display-mime-function - (funcall gnus-display-mime-function)) - ;; Perform the article display hooks. - (gnus-run-hooks 'gnus-article-display-hook))) + (funcall gnus-display-mime-function)))) ;;; ;;; Gnus MIME viewing functions @@ -2365,8 +2531,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (save-current-buffer (set-buffer gnus-article-buffer) (let ((handles (or handles gnus-article-mime-handles)) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (if (stringp (car handles)) (gnus-mime-view-all-parts (cdr handles)) (mapcar 'mm-display-part handles))))) @@ -2441,8 +2606,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (let* ((handle (or handle (get-text-property (point) 'gnus-data))) (mm-user-display-methods nil) (mm-all-images-fit t) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) @@ -2454,8 +2618,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (let* ((handle (or handle (get-text-property (point) 'gnus-data))) (mm-user-display-methods '((".*" . inline))) (mm-all-images-fit t) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) @@ -2517,16 +2680,24 @@ If ALL-HEADERS is non-nil, no headers are hidden." handle id (list (not (mm-handle-displayed-p handle)))) (prog1 (let ((window (selected-window)) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (save-excursion (unwind-protect - (let ((win (get-buffer-window (current-buffer) t))) - (if win - (select-window win)) + (let ((win (get-buffer-window (current-buffer) t)) + (beg (point))) + (when win + (select-window win)) (goto-char point) (forward-line) - (mm-display-part handle)) + (if (mm-handle-displayed-p handle) + (mm-display-part handle) + (save-restriction + (narrow-to-region (point) (1+ (point))) + (mm-display-part handle) + (gnus-treat-article + nil id + (1- (length gnus-article-mime-handles)) + (car (mm-handle-type handle)))))) (select-window window)))) (goto-char point)))) @@ -2594,7 +2765,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-article-press-button)) (defun gnus-display-mime (&optional ihandles) - "Insert MIME buttons in the buffer." + "Display the MIME parts." (save-excursion (save-selected-window (let ((window (get-buffer-window gnus-article-buffer)) @@ -2614,14 +2785,25 @@ If ALL-HEADERS is non-nil, no headers are hidden." ;; We allow users to glean info from the handles. (when gnus-article-mime-part-function (gnus-mime-part-function handles))) - (when (and handles - (or (not (stringp (car handles))) - (cdr handles))) - (unless ihandles - ;; Clean up for mime parts. + (if (and handles + (or (not (stringp (car handles))) + (cdr handles))) + (progn + (unless ihandles + ;; Clean up for mime parts. + (article-goto-body) + (delete-region (point) (point-max))) + (gnus-mime-display-part handles)) + (save-restriction (article-goto-body) - (delete-region (point) (point-max))) - (gnus-mime-display-part handles)))))) + (narrow-to-region (point) (point-max)) + (gnus-treat-article nil 1 1))) + ;; Highlight the headers. + (save-excursion + (save-restriction + (article-goto-body) + (narrow-to-region (point-min) (point)) + (gnus-treat-article 'head))))))) (defvar gnus-mime-display-multipart-as-mixed nil) @@ -2686,21 +2868,28 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-article-insert-newline) (gnus-article-insert-newline) (setq move t))) - (cond - (display - (when move - (forward-line -2)) - (let ((rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced - gnus-newsgroup-iso-8859-1-forced)) - (mm-display-part handle t)) - (goto-char (point-max))) - ((and text not-attachment) - (when move - (forward-line -2)) - (gnus-article-insert-newline) - (mm-insert-inline handle (mm-get-part handle)) - (goto-char (point-max)))))))) + (let ((beg (point))) + (cond + (display + (when move + (forward-line -2)) + (let ((mail-parse-charset gnus-newsgroup-charset)) + (mm-display-part handle t)) + (goto-char (point-max))) + ((and text not-attachment) + (when move + (forward-line -2)) + (gnus-article-insert-newline) + (mm-insert-inline handle (mm-get-part handle)) + (goto-char (point-max)))) + ;; Do highlighting. + (save-excursion + (save-restriction + (narrow-to-region beg (point)) + (gnus-treat-article + nil (length gnus-article-mime-handle-alist) + (1- (length gnus-article-mime-handles)) + (car (mm-handle-type handle)))))))))) (defun gnus-unbuttonized-mime-type-p (type) "Say whether TYPE is to be unbuttonized." @@ -2792,9 +2981,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (when preferred (if (stringp (car preferred)) (gnus-display-mime preferred) - (let ((rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced - gnus-newsgroup-iso-8859-1-forced)) + (let ((mail-parse-charset gnus-newsgroup-charset)) (mm-display-part preferred))) (goto-char (point-max)) (setcdr begend (point-marker))))) @@ -2971,8 +3158,7 @@ Argument LINES specifies lines to be scrolled down." (defun gnus-article-describe-briefly () "Describe article mode commands briefly." (interactive) - (gnus-message 6 - (substitute-command-keys "\\\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) + (gnus-message 6 (substitute-command-keys "\\\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) (defun gnus-article-summary-command () "Execute the last keystroke in the summary buffer." @@ -3958,6 +4144,39 @@ For example: (while xlist (funcall (pop xlist) (point-min) (point-max)))))) +;;; +;;; Treatment top-level handling. +;;; + +(defun gnus-treat-article (condition &optional part-number total-parts type) + (let ((length (- (point-max) (point-min))) + (alist gnus-treatment-function-alist) + val elem) + (when (or (not type) + (catch 'found + (let ((list gnus-article-treat-types)) + (while list + (when (string-match (pop list) type) + (throw 'found t)))))) + (while (setq elem (pop alist)) + (setq val (symbol-value (car elem))) + (when (cond + (condition + (eq condition val)) + ((null val) + nil) + ((eq val t) + t) + ((eq val 'head) + nil) + ((eq val 'last) + (eq part-number total-parts)) + ((numberp val) + (< length val)) + (t + (eval val))) + (funcall (cadr elem))))))) + (gnus-ems-redefine) (provide 'gnus-art) diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index 3fca44b..712d022 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -163,12 +163,7 @@ Always display this group, even when there are no unread articles in it..") (charset (string :tag "Charset") "\ -The default charset to use in the group.") - - (iso-8859-1-forced (const :tag "Force ISO 8859-1 to default charset" - t)"\ -Force ISO 8859-1 to default charset in the group.") -) +The default charset to use in the group.")) "Alist of valid group parameters. Each entry has the form (NAME TYPE DOC), where NAME is the parameter diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 5022055..9bc80d5 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -108,6 +108,16 @@ the second with the current group name.") (name . user-full-name)) "*Mapping from style parameters to variables.") +(defcustom gnus-group-posting-charset-alist + '(("^no\\." iso-8859-1) + (".*" iso-8859-1) + (message-this-is-mail nil) + ) + "Alist of regexps (to match group names) and default charsets to be unencoded when posting." + :type '(repeat (list (regexp :tag "Group") + (symbol :tag "Charset"))) + :group 'gnus-charset) + ;;; Internal variables. (defvar gnus-inhibit-posting-styles nil @@ -201,11 +211,26 @@ Thank you for your help in stamping out bugs. (set (make-local-variable 'gnus-message-group-art) (cons ,group ,article)) (set (make-local-variable 'gnus-newsgroup-name) ,group) + (set (make-local-variable 'message-posting-charset) + (gnus-setup-posting-charset ,group)) (gnus-run-hooks 'gnus-message-setup-hook)) (gnus-add-buffer) (gnus-configure-windows ,config t) (set-buffer-modified-p nil)))) +(defun gnus-setup-posting-charset (group) + (let ((alist gnus-group-posting-charset-alist) + elem) + (catch 'found + (while (setq elem (pop alist)) + (when (or (and (stringp (car alist)) + (string-match (car alist) group)) + (and (gnus-functionp (car alist)) + (funcall (car alist) group)) + (and (symbolp (car alist)) + (symbol-value (car alist)))) + (throw 'found (cadr alist))))))) + (defun gnus-inews-add-send-actions (winconf buffer article) (make-local-hook 'message-sent-hook) (add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t) diff --git a/lisp/gnus-picon.el b/lisp/gnus-picon.el index 5117140..baf4f6d 100644 --- a/lisp/gnus-picon.el +++ b/lisp/gnus-picon.el @@ -36,10 +36,8 @@ (defgroup picons nil "Show pictures of people, domains, and newsgroups (XEmacs). -For this to work, you must add gnus-group-display-picons to the -gnus-summary-display-hook or to the gnus-article-display-hook -depending on what gnus-picons-display-where is set to. You must -also add gnus-article-display-picons to gnus-article-display-hook." +For this to work, you must switch on the `gnus-treat-display-picons' +variable." :group 'gnus-visual) (defcustom gnus-picons-display-where 'picons diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 1ace315..c24f762 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -721,7 +721,7 @@ prompt the user for the name of an NNTP server to use." (unless (gnus-gethash "nndraft:drafts" gnus-newsrc-hashtb) (let ((gnus-level-default-subscribed 1)) (gnus-subscribe-group "nndraft:drafts" nil '(nndraft ""))) - (gnus-group-set-parameter "nndraft:drafts" 'charset "nil") + (gnus-group-set-parameter "nndraft:drafts" 'charset nil) (gnus-group-set-parameter "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode))))) @@ -1711,12 +1711,6 @@ newsgroup." (gnus-message 5 "%sdone" mesg)))))) (setq methods (cdr methods)))))) -(defun gnus-ignored-newsgroups-has-to-p () - "Non-nil iff gnus-ignored-newsgroups includes \"^to\\\\.\" as an element." - ;; note this regexp is the same as: - ;; (concat (regexp-quote "^to\\.") "\\($\\|" (regexp-quote "\\|") "\\)") - (string-match "\\^to\\\\\\.\\($\\|\\\\|\\)" gnus-ignored-newsgroups)) - ;; Read an active file and place the results in `gnus-active-hashtb'. (defun gnus-active-to-gnus-format (&optional method hashtb ignore-errors real-active) @@ -1734,13 +1728,11 @@ newsgroup." (gnus-make-hashtable 4096))))))) ;; Delete unnecessary lines. (goto-char (point-min)) - (cond ((gnus-ignored-newsgroups-has-to-p) - (delete-matching-lines gnus-ignored-newsgroups)) - ((string= gnus-ignored-newsgroups "") - (delete-matching-lines "^to\\.")) - (t - (delete-matching-lines (concat "^to\\.\\|" - gnus-ignored-newsgroups)))) + (cond + ((string= gnus-ignored-newsgroups "") + (delete-matching-lines "^to\\.")) + (t + (delete-matching-lines (concat "^to\\.\\|" gnus-ignored-newsgroups)))) ;; Make the group names readable as a lisp expression even if they ;; contain special characters. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index c754177..1e959d5 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -797,24 +797,16 @@ which it may alter in any way.") :group 'gnus-summary :type 'regexp) -(defcustom gnus-default-charset 'iso-8859-1 - "Default charset assumed to be used when viewing non-ASCII characters.") - -(defcustom gnus-newsgroup-default-charset-alist - '(("^hk\\>\\|^tw\\>\\|\\" . cn-big5) - ("^cn\\>\\|\\" . cn-gb-2312) - ("^fj\\>\\|^japan\\>" . iso-2022-jp-2) - ("^relcom\\>" . koi8-r)) - "Alist of Regexps (to match group names) and default charsets to be applied." - :type '(repeat (cons (regexp :tag "Group") +(defcustom gnus-group-charset-alist + '(("^hk\\>\\|^tw\\>\\|\\" cn-big5) + ("^cn\\>\\|\\" cn-gb-2312) + ("^fj\\>\\|^japan\\>" iso-2022-jp-2) + ("^relcom\\>" koi8-r) + (".*" iso-8859-1)) + "Alist of regexps (to match group names) and default charsets to be used." + :type '(repeat (list (regexp :tag "Group") (symbol :tag "Charset"))) - :group 'gnus) - -(defcustom gnus-newsgroup-iso-8859-1-forced-regexp - "^tw\\>\\|^hk\\>\\|^cn\\>\\|\\" - "Regexp of newsgroup in which ISO-8859-1 is forced to other charset." - :type 'regexp - :group 'gnus) + :group 'gnus-charset) ;;; Internal variables @@ -1004,9 +996,7 @@ variable (string, integer, character, etc).") (defvar gnus-have-all-headers nil) (defvar gnus-last-article nil) (defvar gnus-newsgroup-history nil) - -(defvar gnus-newsgroup-default-charset gnus-default-charset) -(defvar gnus-newsgroup-iso-8859-1-forced nil) +(defvar gnus-newsgroup-charset nil) (defconst gnus-summary-local-variables '(gnus-newsgroup-name @@ -1039,7 +1029,7 @@ variable (string, integer, character, etc).") gnus-cache-removable-articles gnus-newsgroup-cached gnus-newsgroup-data gnus-newsgroup-data-reverse gnus-newsgroup-limit gnus-newsgroup-limits - gnus-newsgroup-default-charset gnus-newsgroup-iso-8859-1-forced) + gnus-newsgroup-charset) "Variables that are buffer-local to the summary buffers.") ;; Byte-compiler warning. @@ -2413,8 +2403,7 @@ marks of articles." (gac gnus-article-current) (reffed gnus-reffed-article-number) (score-file gnus-current-score-file) - (default-charset gnus-newsgroup-default-charset) - (iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (default-charset gnus-newsgroup-charset)) (save-excursion (set-buffer gnus-group-buffer) (setq gnus-newsgroup-name name @@ -2428,8 +2417,7 @@ marks of articles." gnus-original-article-buffer original gnus-reffed-article-number reffed gnus-current-score-file score-file - gnus-newsgroup-default-charset default-charset - gnus-newsgroup-iso-8859-1-forced iso-8859-1-forced) + gnus-newsgroup-charset default-charset) ;; The article buffer also has local variables. (when (gnus-buffer-live-p gnus-article-buffer) (set-buffer gnus-article-buffer) @@ -2505,8 +2493,7 @@ marks of articles." (defun gnus-summary-from-or-to-or-newsgroups (header) (let ((to (cdr (assq 'To (mail-header-extra header)))) (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (cond ((and to gnus-ignored-from-addresses @@ -3672,7 +3659,7 @@ Unscored articles will be counted as having a score of zero." (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) (defun gnus-thread-total-score (thread) - ;; This function find the total score of THREAD. + ;; This function find the total score of THREAD. (cond ((null thread) 0) ((consp thread) @@ -4025,7 +4012,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq gnus-newsgroup-name group) (setq gnus-newsgroup-unselected nil) (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) - (gnus-newsgroup-setup-default-charset) + (gnus-summary-setup-default-charset) ;; Adjust and set lists of article marks. (when info @@ -4553,8 +4540,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (save-excursion (set-buffer gnus-summary-buffer) gnus-newsgroup-dependencies))) headers id end ref - (rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) + (mail-parse-charset gnus-newsgroup-charset)) (save-excursion (set-buffer nntp-server-buffer) ;; Translate all TAB characters into SPACE characters. @@ -4707,8 +4693,7 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." ;; Get the Xref when the users reads the articles since most/some ;; NNTP servers do not include Xrefs when using XOVER. (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) - (let ((rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced) + (let ((mail-parse-charset gnus-newsgroup-charset) (cur nntp-server-buffer) (dependencies (or dependencies gnus-newsgroup-dependencies)) number headers header) @@ -5514,8 +5499,7 @@ in." (defun gnus-summary-describe-briefly () "Describe summary mode commands briefly." (interactive) - (gnus-message 6 - (substitute-command-keys "\\\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) + (gnus-message 6 (substitute-command-keys "\\\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) ;; Walking around group mode buffer from summary mode. @@ -6822,7 +6806,6 @@ Optional argument BACKWARD means do search for backward. (require 'gnus-async) (require 'gnus-art) (let ((gnus-select-article-hook nil) ;Disable hook. - (gnus-article-display-hook nil) (gnus-mark-article-hook nil) ;Inhibit marking as read. (gnus-use-article-prefetch nil) (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. @@ -7005,7 +6988,6 @@ article massaging functions being run." (require 'gnus-art) ;; Bind the article treatment functions to nil. (let ((gnus-have-all-headers t) - gnus-article-display-hook gnus-article-prepare-hook gnus-article-decode-hook gnus-display-mime-function @@ -7055,10 +7037,12 @@ If ARG is a negative number, hide the unwanted header lines." (goto-char (point-min)) (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) (insert-buffer-substring gnus-original-article-buffer 1 e) - (let ((article-inhibit-hiding t)) - (gnus-run-hooks 'gnus-article-display-hook)) - (when (or (not hidden) (and (numberp arg) (< arg 0))) - (gnus-article-hide-headers))))) + (narrow-to-region (point-min) (point)) + (if (or (not hidden) (and (numberp arg) (< arg 0))) + (let ((gnus-treat-hide-headers nil) + (gnus-treat-hide-boring-headers nil)) + (gnus-treat-article 'head)) + (gnus-treat-article 'head))))) (defun gnus-summary-show-all-headers () "Make all header lines visible." @@ -7588,7 +7572,8 @@ groups." (unless no-highlight (save-excursion (set-buffer gnus-article-buffer) - (gnus-run-hooks 'gnus-article-display-hook) + ;;;!!! Fix this -- article should be rehighlighted. + ;;;(gnus-run-hooks 'gnus-article-display-hook) (set-buffer gnus-original-article-buffer) (gnus-request-article (cdr gnus-article-current) @@ -9180,44 +9165,25 @@ save those articles instead." (gnus-summary-exit)) buffers))))) -(defun gnus-newsgroup-setup-default-charset () +(defun gnus-summary-setup-default-charset () "Setup newsgroup default charset." - (let ((name (and gnus-newsgroup-name - (string-match "[^:]+$" gnus-newsgroup-name) - (match-string 0 gnus-newsgroup-name)))) - (setq gnus-newsgroup-default-charset + (let ((name (and gnus-newsgroup-name + (gnus-group-real-name gnus-newsgroup-name)))) + (setq gnus-newsgroup-charset (or (and gnus-newsgroup-name - (or (gnus-group-find-parameter - gnus-newsgroup-name 'charset) - (let ((alist gnus-newsgroup-default-charset-alist) + (or (gnus-group-find-parameter gnus-newsgroup-name 'charset) + (let ((alist gnus-group-charset-alist) elem (charset nil)) - (while alist - (if (and name - (string-match - (car (setq elem (pop alist))) - name)) - (setq alist nil - charset (cdr elem)))) + (while (setq elem (pop alist)) + (when (and name + (string-match (car elem) name)) + (setq alist nil + charset (cadr elem)))) charset))) - gnus-default-charset)) - (setq gnus-newsgroup-iso-8859-1-forced - (and gnus-newsgroup-name - (or (gnus-group-find-parameter - gnus-newsgroup-name 'iso-8859-1-forced) - (and name - (string-match gnus-newsgroup-iso-8859-1-forced-regexp - name)))))) - (if (stringp gnus-newsgroup-default-charset) - (setq gnus-newsgroup-default-charset - (intern (downcase gnus-newsgroup-default-charset)))) - (setq gnus-newsgroup-iso-8859-1-forced - (if (stringp gnus-newsgroup-iso-8859-1-forced) - (intern (downcase gnus-newsgroup-iso-8859-1-forced)) - (and gnus-newsgroup-iso-8859-1-forced - gnus-newsgroup-default-charset)))) + gnus-default-charset)))) ;;; -;;; MIME Commands +;;; Mime Commands ;;; (defun gnus-summary-display-buttonized (&optional show-all-parts) diff --git a/lisp/gnus-uu.el b/lisp/gnus-uu.el index d01d3a9..f510e5b 100644 --- a/lisp/gnus-uu.el +++ b/lisp/gnus-uu.el @@ -1204,9 +1204,10 @@ didn't work, and overwrite existing files. Otherwise, ask each time." &optional sloppy limit no-errors) (let ((state 'first) (gnus-asynchronous nil) + (gnus-inhibit-treatment t) has-been-begin article result-file result-files process-state gnus-summary-display-article-function - gnus-article-display-hook gnus-article-prepare-hook + gnus-article-prepare-hook article-series files) (while (and articles diff --git a/lisp/gnus.el b/lisp/gnus.el index bb9b31e..2ec4515 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -41,6 +41,11 @@ :group 'news :group 'mail) +(defgroup gnus-charset nil + "Group character set issues." + :link '(custom-manual "(gnus)Charsets") + :group 'gnus) + (defgroup gnus-cache nil "Cache interface." :group 'gnus) @@ -254,7 +259,7 @@ is restarted, and sometimes reloaded." :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) -(defconst gnus-version-number "0.70" +(defconst gnus-version-number "0.71" "Version number for this version of Gnus.") (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number) @@ -1407,59 +1412,6 @@ face." :group 'gnus-visual :type 'face) -(defcustom gnus-article-display-hook - (if (and (string-match "XEmacs" emacs-version) - (featurep 'xface)) - '(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-hide-headers-if-wanted - gnus-article-hide-boring-headers - gnus-article-treat-overstrike - gnus-article-maybe-highlight)) - "*Controls how the article buffer will look. - -If you leave the list empty, the article will appear exactly as it is -stored on the disk. The list entries will hide or highlight various -parts of the article, making it easier to find the information you -want." - :group 'gnus-article-highlight - :group 'gnus-visual - :type 'hook - :options '(gnus-article-add-buttons - gnus-article-add-buttons-to-head - gnus-article-emphasize - gnus-article-fill-cited-article - gnus-article-remove-cr - gnus-article-de-quoted-unreadable - gnus-summary-stop-page-breaking - ;; gnus-summary-caesar-message - ;; gnus-summary-verbose-headers - gnus-article-hide - gnus-article-hide-headers - gnus-article-hide-boring-headers - gnus-article-hide-signature - gnus-article-hide-citation - gnus-article-hide-pgp - gnus-article-hide-pem - gnus-article-highlight - gnus-article-highlight-headers - gnus-article-highlight-citation - gnus-article-highlight-signature - gnus-article-date-ut - gnus-article-date-local - gnus-article-date-lapsed - gnus-article-date-original - gnus-article-remove-trailing-blank-lines - gnus-article-strip-leading-blank-lines - gnus-article-strip-multiple-blank-lines - gnus-article-strip-blank-lines - gnus-article-treat-overstrike - gnus-article-display-x-face - gnus-smiley-display)) - (defcustom gnus-article-save-directory gnus-directory "*Name of the directory articles will be saved in (default \"~/News\")." :group 'gnus-article-saving @@ -1468,6 +1420,23 @@ want." (defvar gnus-plugged t "Whether Gnus is plugged or not.") +(defcustom gnus-default-charset 'iso-8859-1 + "Default charset assumed to be used when viewing non-ASCII characters. +This variable is overridden on a group-to-group basis by the +gnus-group-charset-alist variable and is only used on groups not +covered by that variable." + :type 'symbol + :group 'gnus-charset) + +(defcustom gnus-default-posting-charset nil + "Default charset assumed to be used when posting non-ASCII characters. +This variable is overridden on a group-to-group basis by the +gnus-group-posting-charset-alist variable and is only used on groups not +covered by that variable. +If nil, no default charset is assumed when posting." + :type 'symbol + :group 'gnus-charset) + ;;; Internal variables @@ -1755,7 +1724,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-treat-article) ("gnus-art" :interactive t gnus-article-hide-headers gnus-article-hide-boring-headers gnus-article-treat-overstrike gnus-article-word-wrap diff --git a/lisp/lpath.el b/lisp/lpath.el index 01e2d2b..864149a 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -45,8 +45,7 @@ mouse-selection-click-count-buffer buffer-display-table font-lock-defaults user-full-name user-login-name gnus-newsgroup-name gnus-article-x-face-too-ugly - gnus-newsgroup-default-charset - gnus-newsgroup-iso-8859-1-forced + gnus-newsgroup-charset mail-mode-hook enable-multibyte-characters adaptive-fill-first-line-regexp adaptive-fill-regexp url-current-mime-headers buffer-file-coding-system diff --git a/lisp/mail-parse.el b/lisp/mail-parse.el index 6b5d412..d9caac1 100644 --- a/lisp/mail-parse.el +++ b/lisp/mail-parse.el @@ -36,6 +36,7 @@ ;;; Code: +(require 'mail-prsvr) (require 'ietf-drums) (require 'rfc2231) (require 'rfc2047) diff --git a/lisp/mail-prsvr.el b/lisp/mail-prsvr.el new file mode 100644 index 0000000..f59b1ff --- /dev/null +++ b/lisp/mail-prsvr.el @@ -0,0 +1,34 @@ +;;; mail-prsvr.el --- Interface variables for parsing mail +;; Copyright (C) 1999 Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen +;; 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: + +(defvar mail-parse-charset nil + "Default charset used by low-level libraries. +This variable should never be set. Instead, it should be bound by +functions that wish to call mail-parse functions and let them know +what the desired charset is to be.") + +(provide 'mail-prsvr) + +;;; mail-prsvr.el ends here diff --git a/lisp/message.el b/lisp/message.el index c6d5c31..6a03d9e 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -886,10 +886,6 @@ The cdr of ech entry is a function for applying the face to a region.") (t nil)) "Coding system to compose mail.") -(defvar message-default-charset 'iso-8859-1 - "Default charset assumed to be used when viewing non-ASCII characters. -This variable is used only in non-Mule Emacsen.") - ;;; Internal variables. (defvar message-buffer-list nil) @@ -897,6 +893,7 @@ This variable is used only in non-Mule Emacsen.") (defvar message-this-is-mail nil) (defvar message-draft-article nil) (defvar message-mime-part nil) +(defvar message-posting-charset nil) ;; Byte-compiler warning (defvar gnus-active-hashtb) @@ -2111,7 +2108,8 @@ the user from the mailer." (let ((message-deletable-headers (if news nil message-deletable-headers))) (message-generate-headers message-required-mail-headers)) - (mail-encode-encoded-word-buffer) + (let ((mail-parse-charset message-posting-charset)) + (mail-encode-encoded-word-buffer)) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) (unwind-protect @@ -2285,7 +2283,8 @@ to find out how to use this." (message-narrow-to-headers) ;; Insert some headers. (message-generate-headers message-required-news-headers) - (mail-encode-encoded-word-buffer) + (let ((mail-parse-charset message-posting-charset)) + (mail-encode-encoded-word-buffer)) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) (message-cleanup-headers) @@ -4213,8 +4212,7 @@ TYPE is the MIME type to use." type (prin1-to-string file)))) (defun message-encode-message-body () - (let ((mm-default-charset message-default-charset) - lines multipart-p content-type-p) + (let (lines multipart-p content-type-p) (message-goto-body) (save-restriction (narrow-to-region (point) (point-max)) @@ -4239,7 +4237,7 @@ TYPE is the MIME type to use." (re-search-backward "^Content-Type: multipart/" nil t)) (goto-char (point-max)) (setq content-type-p - (re-search-backward "^Content-Type: multipart/" nil t))) + (re-search-backward "^Content-Type:" nil t))) (save-restriction (message-narrow-to-headers-or-head) (message-remove-first-header "Content-Type") diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 3ac1aa2..a67b60b 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -51,7 +51,7 @@ If no encoding was done, nil is returned." (save-excursion (goto-char (point-min)) (if (re-search-forward "[^\x0-\x7f]" nil t) - mm-default-charset + (mm-read-charset "Charset used in the article: ") ;; The logic in `mml-generate-mime-1' confirms that it's OK ;; to return nil here. nil)) @@ -152,7 +152,7 @@ If no encoding was done, nil is returned." (defun mm-decode-body (charset &optional encoding type) "Decode the current article that has been encoded with ENCODING. The characters in CHARSET should then be decoded." - (setq charset (or charset rfc2047-default-charset)) + (setq charset (or charset mail-parse-charset)) (save-excursion (when encoding (mm-decode-content-transfer-encoding encoding type)) @@ -165,12 +165,12 @@ The characters in CHARSET should then be decoded." ;in XEmacs enable-multibyte-characters (or (not (eq mule-charset 'ascii)) - (setq mule-charset rfc2047-default-charset))) + (setq mule-charset mail-parse-charset))) (mm-decode-coding-region (point-min) (point-max) mule-charset)))))) (defun mm-decode-string (string charset) "Decode STRING with CHARSET." - (setq charset (or charset rfc2047-default-charset)) + (setq charset (or charset mail-parse-charset)) (or (when (featurep 'mule) (let (mule-charset) @@ -178,7 +178,7 @@ The characters in CHARSET should then be decoded." (setq mule-charset (mm-charset-to-coding-system charset)) enable-multibyte-characters (or (not (eq mule-charset 'ascii)) - (setq mule-charset rfc2047-default-charset))) + (setq mule-charset mail-parse-charset))) (mm-decode-coding-string string mule-charset)))) string)) diff --git a/lisp/mm-util.el b/lisp/mm-util.el index aaae62d..aa22040 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -46,18 +46,6 @@ (t nil)) "100% text coding system, for removing ^M.") -(defvar mm-default-coding-system nil - "The default coding system to use.") - -(defvar mm-known-charsets '(iso-8859-1) - "List of known charsets. -Use this under non-Mule Emacsen to specify which charsets your Emacs -can display. Also see `mm-default-charset'.") - -(defvar mm-default-charset 'iso-8859-1 - "Default charset assumed to be used when viewing non-ASCII characters. -This variable is used only in non-Mule Emacsen.") - (defvar mm-mime-mule-charset-alist '((us-ascii ascii) (iso-8859-1 latin-iso8859-1) @@ -145,8 +133,9 @@ This variable is used only in non-Mule Emacsen.") dest) "Charset/coding system alist.") -;;;Internal variable -(defvar mm-charset-iso-8859-1-forced nil) +;;; Internal variables: + +;;; Functions: (defun mm-mule-charset-to-mime-charset (charset) "Return the MIME charset corresponding to MULE CHARSET." @@ -166,9 +155,6 @@ If optional argument LBT (`unix', `dos' or `mac') is specified, it is used as the line break code type of the coding system." (when (stringp charset) (setq charset (intern (downcase charset)))) - (if (and mm-charset-iso-8859-1-forced - (eq charset 'iso-8859-1)) - (setq charset mm-charset-iso-8859-1-forced)) (setq charset (or (cdr (assq charset mm-charset-coding-system-alist)) charset)) @@ -176,9 +162,7 @@ used as the line break code type of the coding system." (setq charset (intern (format "%s-%s" charset lbt)))) (cond ;; Running in a non-MULE environment. - ((and (null (mm-get-coding-system-list)) - (or (eq charset mm-default-charset) - (memq charset mm-known-charsets))) + ((null (mm-get-coding-system-list)) charset) ;; ascii ((eq charset 'us-ascii) @@ -216,12 +200,6 @@ used as the line break code type of the coding system." (defun mm-mime-charset (charset b e) (if (fboundp 'coding-system-get) (or - (and - mm-default-coding-system - (let ((safe (coding-system-get mm-default-coding-system - 'safe-charsets))) - (or (eq safe t) (memq charset safe))) - (coding-system-get mm-default-coding-system 'mime-charset)) (coding-system-get (get-charset-property charset 'prefered-coding-system) 'mime-charset) @@ -290,6 +268,10 @@ See also `with-temp-file' and `with-output-to-string'." '(ascii) (list 'ascii (car (last (assq 'charset entry))))))))))) +(defun mm-read-charset (prompt) + "Return a charset." + (completing-read prompt mm-mime-mule-charset-alist nil t)) + (provide 'mm-util) ;;; mm-util.el ends here diff --git a/lisp/mm-view.el b/lisp/mm-view.el index e7db1ca..cde7ba6 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -35,7 +35,7 @@ (defun mm-inline-image (handle) (let ((annot (make-annotation (mm-get-image handle) nil 'text)) buffer-read-only) - (mm-insert-inline handle ".\n") + (mm-insert-inline handle "\n") (set-extent-property annot 'mm t) (set-extent-property annot 'duplicable t))) @@ -94,6 +94,7 @@ (insert (mm-decode-string text charset)) (save-restriction (narrow-to-region b (point)) + (set-text-properties (point-min) (point-max) nil) (mm-handle-set-undisplayer handle `(lambda () diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 83fd3e8..72250a2 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -524,8 +524,7 @@ parameter. It should return nil, `warn' or `delete'." t) (file-error nil)))) -(defvar nnmail-pathname-coding-system - 'iso-8859-1 +(defvar nnmail-pathname-coding-system 'binary "*Coding system for pathname.") (defun nnmail-group-pathname (group dir &optional file) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 5d44dc3..ceb45c4 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -32,9 +32,7 @@ (require 'qp) (require 'mm-util) (require 'ietf-drums) - -(defvar rfc2047-default-charset 'iso-8859-1 - "Default MIME charset -- does not need encoding.") +(require 'mail-prsvr) (defvar rfc2047-header-encoding-alist '(("Newsgroups" . nil) @@ -130,16 +128,16 @@ Should be called narrowed to the head of the message." ;; Hm. (t)))) (goto-char (point-max))))) - (when rfc2047-default-charset + (when mail-parse-charset (encode-coding-region (point-min) (point-max) - rfc2047-default-charset))))) + mail-parse-charset))))) (defun rfc2047-encodable-p () "Say whether the current (narrowed) buffer contains characters that need encoding." (let ((charsets (mapcar 'mm-mule-charset-to-mime-charset (mm-find-charset-region (point-min) (point-max)))) - (cs (list 'us-ascii rfc2047-default-charset)) + (cs (list 'us-ascii mail-parse-charset)) found) (while charsets (unless (memq (pop charsets) cs) @@ -268,13 +266,13 @@ Should be called narrowed to the head of the message." (prog1 (match-string 0) (delete-region (match-beginning 0) (match-end 0))))) - (when (and (mm-multibyte-p) rfc2047-default-charset) - (mm-decode-coding-region b e rfc2047-default-charset)) + (when (and (mm-multibyte-p) mail-parse-charset) + (mm-decode-coding-region b e mail-parse-charset)) (setq b (point))) (when (and (mm-multibyte-p) - rfc2047-default-charset - (not (eq rfc2047-default-charset 'us-ascii))) - (mm-decode-coding-region b (point-max) rfc2047-default-charset)))))) + mail-parse-charset + (not (eq mail-parse-charset 'us-ascii))) + (mm-decode-coding-region b (point-max) mail-parse-charset)))))) (defun rfc2047-decode-string (string) "Decode the quoted-printable-encoded STRING and return the results." @@ -305,11 +303,11 @@ Return WORD if not." "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 (let ((mm-default-charset rfc2047-default-charset)) - (mm-charset-to-coding-system charset)))) + (let ((cs (mm-charset-to-coding-system charset))) (when cs - (when (eq cs 'ascii) - (setq cs rfc2047-default-charset)) + (when (and (eq cs 'ascii) + mail-parse-charset) + (setq cs mail-parse-charset)) (mm-decode-coding-string (cond ((equal "B" encoding) diff --git a/lisp/smiley.el b/lisp/smiley.el index fd42472..cb02147 100644 --- a/lisp/smiley.el +++ b/lisp/smiley.el @@ -31,7 +31,7 @@ ;; To use: ;; (require 'smiley) -;; (add-hook 'gnus-article-display-hook 'gnus-smiley-display t) +;; (setq gnus-treat-display-smileys t) ;; The smilies were drawn by Joe Reiss . diff --git a/texi/gnus.texi b/texi/gnus.texi index 6e785aa..c7c41a8 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Pterodactyl Gnus 0.70 Manual +@settitle Pterodactyl Gnus 0.71 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 Pterodactyl Gnus 0.70 Manual +@title Pterodactyl Gnus 0.71 Manual @author by Lars Magne Ingebrigtsen @page @@ -354,7 +354,7 @@ can be gotten by any nefarious means you can think of---@sc{nntp}, local spool or your mbox file. All at the same time, if you want to push your luck. -This manual corresponds to Pterodactyl Gnus 0.70. +This manual corresponds to Pterodactyl Gnus 0.71. @end ifinfo @@ -18475,6 +18475,10 @@ A spec for the group line format to display the number of agent-downloaded articles in the group. @item +Some nntp servers never respond when posting, so there should be a +timeout for all commands. + +@item Solve the halting problem. @c TODO diff --git a/texi/message.texi b/texi/message.texi index ad86c62..7e831f0 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Pterodactyl Message 0.70 Manual +@settitle Pterodactyl Message 0.71 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.70 Manual +@title Pterodactyl Message 0.71 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.70. Message is +This manual corresponds to Pterodactyl Message 0.71. Message is distributed with the Gnus distribution bearing the same version number as this manual. -- 1.7.10.4