* mm-view.el: Require `gnus-mailcap' rather than `mailcap'.
* nnheader.el (mm-with-unibyte-buffer): Bind `default-mc-flag' instead of
`mc-flag'.
(nnheader-with-unibyte-current-buffer): New macro.
(mm-with-unibyte-current-buffer): Alias to
`nnheader-with-unibyte-current-buffer'.
(nnheader-guess-mime-charset): New macro.
(mm-guess-mime-charset): Alias to `nnheader-guess-mime-charset'.
(shell-command-to-string): New function for old Emacsen.
* lpath.el: Don't fbind `shell-command-to-string'.
+2002-02-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lisp/mm-view.el: Require `gnus-mailcap' rather than `mailcap'.
+
+ * lisp/nnheader.el (mm-with-unibyte-buffer): Bind `default-mc-flag'
+ instead of `mc-flag'.
+ (nnheader-with-unibyte-current-buffer): New macro.
+ (mm-with-unibyte-current-buffer): Alias to
+ `nnheader-with-unibyte-current-buffer'.
+ (nnheader-guess-mime-charset): New macro.
+ (mm-guess-mime-charset): Alias to `nnheader-guess-mime-charset'.
+ (shell-command-to-string): New function for old Emacsen.
+
+ * lisp/lpath.el: Don't fbind `shell-command-to-string'.
+
2002-02-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
* lisp/gnus-namazu.el (gnus-namazu/group-alist): Abolished.
\f
* Changes in Oort Gnus
+** gnus-default-charset
+
+The default value is determined from the current-language-environment
+variable, instead of 'iso-8859-1. Also the ".*" item in
+gnus-group-charset-alist is removed.
+
** gnus-posting-styles
Add a new format of match like
+2002-02-09 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-soup.el (gnus-soup-send-packet): Send news and mail
+ directly instead of calling message-send-mail.
+
+ * gnus-start.el (gnus-read-descriptions-file): Use
+ gnus-default-charset.
+
+ * mm-util.el (mm-guess-mime-charset): New function.
+
+ * gnus.el (gnus-default-charset): Use it.
+ (gnus-group-charset-alist): Remove .*, Let gnus-default-charset be
+ the default.
+
+2002-02-08 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-art.el (gnus-treat-display-grey-xface): New variable.
+ (article-display-x-face): Use it. Disable grey xface, if
+ uncompface is not found.
+
+ * message.el (message-mode): Don't enable multibyte on an indirect
+ buffer.
+
+ * nnrss.el (nnrss-content-function): New variable.
+ (nnrss-request-article): Use it.
+
+2002-02-08 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus.el: Add article-unsplit-urls.
+ * gnus-sum.el: Ditto.
+ * gnus-art.el (gnus-treat-strip-cr): New variable.
+ (gnus-treatment-function-alist): Use it.
+ (article-unsplit-urls): New function.
+ (gnus-article-make-menu-bar): Use it.
+ From: Michael Cook <michael.cook@cisco.com>
+
2002-02-08 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-agent.el (gnus-agent-braid-nov): Find the first article to
:group 'gnus-article-treat
:type gnus-article-treat-custom)
+(defcustom gnus-treat-unsplit-urls nil
+ "Remove newlines from within URLs.
+Valid values are nil, t, `head', `last', an integer or a predicate.
+See Info node `(gnus)Customizing Articles' for details."
+ :group 'gnus-article-treat
+ :type gnus-article-treat-custom)
+
(defcustom gnus-treat-leading-whitespace nil
"Remove leading whitespace in headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
"Internal variable used to say whether `smiley-mule' is loaded (whether
smiley functions are not overridden by `smiley').")
+(defcustom gnus-treat-display-grey-xface
+ (and (string-match "^0x" (shell-command-to-string "uncompface"))
+ t)
+ "Display grey X-Face headers.
+Valid values are nil, t."
+ :group 'gnus-article-treat
+ :version "21.3"
+ :type 'boolean)
+(put 'gnus-treat-display-grey-xface 'highlight t)
+
(defcustom gnus-treat-display-smileys
(if (or (and (featurep 'xemacs)
(featurep 'xpm))
(gnus-treat-fill-article gnus-article-fill-cited-article)
(gnus-treat-fill-long-lines gnus-article-fill-long-lines)
(gnus-treat-strip-cr gnus-article-remove-cr)
+ (gnus-treat-unsplit-urls gnus-article-unsplit-urls)
(gnus-treat-date-ut gnus-article-date-ut)
(gnus-treat-date-local gnus-article-date-local)
(gnus-treat-date-english gnus-article-date-english)
(set-buffer gnus-original-article-buffer))
(save-restriction
(mail-narrow-to-head)
- (while (gnus-article-goto-header "x-face\\(-[0-9]+\\)?")
- (when (match-beginning 2)
- (setq grey t))
- (push (mail-header-field-value) x-faces))
+ (let ((regexp
+ (if gnus-treat-display-grey-xface
+ "x-face\\(-[0-9]+\\)?"
+ "x-face")))
+ (while (gnus-article-goto-header regexp)
+ (when (match-beginning 2)
+ (setq grey t))
+ (push (mail-header-field-value) x-faces)))
(setq from (message-fetch-field "from"))))
(if grey
(let ((xpm (gnus-convert-gray-x-face-to-xpm x-faces))
(let ((buffer-read-only nil))
(rfc1843-decode-region (point-min) (point-max)))))
+(defun article-unsplit-urls ()
+ "Remove the newlines that some other mailers insert into URLs."
+ (interactive)
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^\\(\\(https?\\|ftp\\)://\\S-+\\)\n\\(\\S-+\\)" nil t)
+ (replace-match "\\1\\3" t)))))
+
(defun article-wash-html (&optional read-charset)
"Format an html article.
If READ-CHARSET, ask for a coding system."
article-de-base64-unreadable
article-decode-HZ
article-wash-html
+ article-unsplit-urls
article-hide-list-identifiers
article-hide-pgp
article-strip-banner
["Remove carriage return" gnus-article-remove-cr t]
["Remove leading whitespace" gnus-article-remove-leading-whitespace t]
["Treat html" gnus-article-wash-html t]
+ ["Remove newlines from within URLs" gnus-article-unsplit-urls t]
["Decode HZ" gnus-article-decode-HZ t]))
;; Note "Commands" menu is defined in gnus-sum.el for consistency
(match-beginning 1) (match-end 1)))))
(switch-to-buffer tmp-buf)
(erase-buffer)
+ (set-buffer-multibyte nil)
(insert-buffer-substring msg-buf beg end)
- (goto-char (point-min))
- (search-forward "\n\n")
- (forward-char -1)
- (insert mail-header-separator)
- (setq message-user-agent (gnus-extended-version))
(cond
((string= (gnus-soup-reply-kind (car replies)) "news")
(gnus-message 5 "Sending news message to %s..."
(mail-fetch-field "newsgroups"))
(sit-for 1)
(let ((message-syntax-checks
- 'dont-check-for-anything-just-trust-me))
- (funcall message-send-news-function)))
+ 'dont-check-for-anything-just-trust-me)
+ (method (if (message-functionp message-post-method)
+ (funcall message-post-method)
+ message-post-method))
+ result)
+ (run-hooks 'message-send-news-hook)
+ (gnus-open-server method)
+ (message "Sending news with %s..."
+ (gnus-server-string method))
+ (unless (let ((mail-header-separator ""))
+ (gnus-request-post method))
+ (message "Couldn't send message via news: %s"
+ (nnheader-get-report (car method))))))
((string= (gnus-soup-reply-kind (car replies)) "mail")
(gnus-message 5 "Sending mail to %s..."
(mail-fetch-field "to"))
(sit-for 1)
- (message-send-mail))
+ (let ((mail-header-separator ""))
+ (mm-with-unibyte-current-buffer
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function)))))
(t
(error "Unknown reply kind")))
(set-buffer msg-buf)
(name (symbol-name group))
(charset
(or (gnus-group-name-charset method name)
- (gnus-parameter-charset name))))
+ (gnus-parameter-charset name)
+ gnus-default-charset)))
(when (and str charset (featurep 'mule))
(setq str (decode-coding-string str charset)))
(set group str)))
"c" gnus-article-remove-cr
"Z" gnus-article-decode-HZ
"h" gnus-article-wash-html
+ "u" gnus-article-unsplit-urls
"f" gnus-article-display-x-face
"l" gnus-summary-stop-page-breaking
"r" gnus-summary-caesar-message
["Unfold headers" gnus-article-treat-unfold-headers t]
["Fold newsgroups" gnus-article-treat-fold-newsgroups t]
["Html" gnus-article-wash-html t]
+ ["URLs" gnus-article-unsplit-urls t]
["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
["HZ" gnus-article-decode-HZ t])
("Output"
("\\(^\\|:\\)han\\>" euc-kr)
("\\(^\\|:\\)alt.chinese.text.big5\\>" chinese-big5)
("\\(^\\|:\\)soc.culture.vietnamese\\>" vietnamese-viqr)
- ("\\(^\\|:\\)\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1)
- (".*" iso-8859-1))
+ ("\\(^\\|:\\)\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1))
:variable-document
"Alist of regexps (to match group names) and default charsets to be used when reading."
:variable-group gnus-charset
:group 'gnus-agent
:type 'boolean)
-(defcustom gnus-default-charset 'iso-8859-1
+(defcustom gnus-default-charset (mm-guess-mime-charset)
"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
gnus-article-display-x-face
gnus-article-decode-HZ
gnus-article-wash-html
+ gnus-article-unsplit-urls
gnus-article-hide-pgp
gnus-article-hide-pem gnus-article-hide-signature
gnus-article-strip-leading-blank-lines gnus-article-date-local
'((coding-system-get
coding-system-to-mime-charset compose-mail file-name-extension
find-coding-systems-for-charsets find-coding-systems-region
- function-max-args get-charset-property shell-command-to-string
- smiley-encode-buffer)))
+ function-max-args get-charset-property smiley-encode-buffer)))
(t
'((function-max-args smiley-encode-buffer))))))
(maybe-fbind (car functions-variables))
(let ((cs (mm-detect-coding-region start end)))
cs)))
+(defun mm-guess-mime-charset ()
+ "Guess the default MIME charset from the language environment."
+ (let ((language-info
+ (and (boundp 'current-language-environment)
+ (assoc current-language-environment
+ language-info-alist)))
+ item)
+ (cond
+ ((null language-info)
+ 'iso-8859-1)
+ ((setq item
+ (cadr
+ (or (assq 'coding-priority language-info)
+ (assq 'coding-system language-info))))
+ (if (fboundp 'coding-system-get)
+ (or (coding-system-get item 'mime-charset)
+ item)
+ item))
+ ((setq item (car (last (assq 'charset language-info))))
+ (if (eq item 'ascii)
+ 'iso-8859-1
+ (mm-mime-charset item)))
+ (t
+ 'iso-8859-1))))
+
(provide 'mm-util)
;;; mm-util.el ends here
(eval-when-compile (require 'cl))
(require 'mail-parse)
-(require 'mailcap)
+(require 'gnus-mailcap)
(require 'mm-bodies)
(require 'mm-decode)
(defmacro nnheader-with-unibyte-buffer (&rest forms)
"Create a temporary buffer, and evaluate FORMS there like `progn'.
Use unibyte mode for this."
- `(let (default-enable-multibyte-characters mc-flag)
+ `(let (default-enable-multibyte-characters default-mc-flag)
(with-temp-buffer ,@forms)))
(put 'nnheader-with-unibyte-buffer 'lisp-indent-function 0)
(put 'nnheader-with-unibyte-buffer 'edebug-form-spec '(body))
(put 'mm-with-unibyte-buffer 'lisp-indent-function 0)
(put 'mm-with-unibyte-buffer 'edebug-form-spec '(body))
- (defalias 'mm-with-unibyte-buffer 'nnheader-with-unibyte-buffer))
+ (defalias 'mm-with-unibyte-buffer 'nnheader-with-unibyte-buffer)
+
+ ;; Should keep track of `mm-with-unibyte-current-buffer' in mm-util.el.
+ (defmacro nnheader-with-unibyte-current-buffer (&rest forms)
+ "Evaluate FORMS with current current buffer temporarily made unibyte.
+Also bind `default-enable-multibyte-characters' to nil.
+Equivalent to `progn' in XEmacs"
+ (let ((multibyte (make-symbol "multibyte"))
+ (buffer (make-symbol "buffer")))
+ (cond ((featurep 'xemacs)
+ `(let (default-enable-multibyte-characters)
+ ,@forms))
+ ((boundp 'MULE)
+ `(let ((,multibyte mc-flag)
+ (,buffer (current-buffer)))
+ (unwind-protect
+ (let (default-enable-multibyte-characters default-mc-flag)
+ (setq mc-flag nil)
+ ,@forms)
+ (set-buffer ,buffer)
+ (setq mc-flag ,multibyte))))
+ (t
+ `(let ((,multibyte enable-multibyte-characters)
+ (,buffer (current-buffer)))
+ (unwind-protect
+ (let (default-enable-multibyte-characters)
+ (set-buffer-multibyte nil)
+ ,@forms)
+ (set-buffer ,buffer)
+ (set-buffer-multibyte ,multibyte)))))))
+ (put 'nnheader-with-unibyte-current-buffer 'lisp-indent-function 0)
+ (put 'nnheader-with-unibyte-current-buffer 'edebug-form-spec '(body))
+ (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0)
+ (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body))
+ (defalias 'mm-with-unibyte-current-buffer
+ 'nnheader-with-unibyte-current-buffer)
+
+ ;; Should keep track of `mm-guess-mime-charset' in mm-util.el.
+ (defun nnheader-guess-mime-charset ()
+ "Guess the default MIME charset from the language environment."
+ (let ((language-info
+ (and (boundp 'current-language-environment)
+ (assoc current-language-environment
+ language-info-alist)))
+ item)
+ (cond
+ ((null language-info)
+ 'iso-8859-1)
+ ((setq item
+ (cadr
+ (or (assq 'coding-priority language-info)
+ (assq 'coding-system language-info))))
+ (if (fboundp 'coding-system-get)
+ (or (coding-system-get item 'mime-charset)
+ item)
+ item))
+ ((setq item (car (last (assq 'charset language-info))))
+ (if (eq item 'ascii)
+ 'iso-8859-1
+ (charsets-to-mime-charset (list item))))
+ (t
+ 'iso-8859-1))))
+ (defalias 'mm-guess-mime-charset 'nnheader-guess-mime-charset))
;; mail-parse stuff.
(unless (featurep 'mail-parse)
(message "%s(Y/n) Yes" prompt)
t)))
+(defun-maybe shell-command-to-string (command)
+ "Execute shell command COMMAND and return its output as a string."
+ (with-output-to-string
+ (with-current-buffer
+ standard-output
+ (call-process shell-file-name nil t nil shell-command-switch command))))
+
(when (featurep 'xemacs)
(require 'nnheaderxm))
"Field name used for URL.
To use the description in headers, put this name into `nnmail-extra-headers'.")
+(defvar nnrss-content-function nil
+ "A function which is called in `nnrss-request-article'.
+The arguments are (ENTRY GROUP ARTICLE).
+ENTRY is the record of the current headline. GROUP is the group name.
+ARTICLE is the article number of the current headline.")
+
(nnoo-define-basics nnrss)
;;; Interface functions
(insert "\n\n")
(fill-region point (point))))
(if (nth 2 e)
- (insert (nth 2 e) "\n")))))
+ (insert (nth 2 e) "\n"))
+ (if nnrss-content-function
+ (funcall nnrss-content-function e group article)))))
(cond
(err
(nnheader-report 'nnrss err))
+2002-02-09 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus.texi (Group Parameters): Addition.
+ From: Steinar Bang <steinar@bang.priv.no>
+
+2002-02-08 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus.texi (Article Washing): Addition.
+ From: Michael Cook <michael.cook@cisco.com>
+
2002-02-06 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus.texi (Gnus Unplugged): Use (setq gnus-agent t).
@code{gnus-show-threads} \e$B$O!"$=$N35N,%P%C%U%!$NCf$N%m!<%+%kJQ?t$K$J$j!"\e(B
form \e$B$N\e(B @code{nil} \e$B$O$=$3$GI>2A$5$l$^$9!#\e(B
+@vindex gnus-list-identifiers
+\e$B$3$N5!G=$NMQES$N0l$D$O!"5-;v$NBjL>Ms$+$i%a!<%j%s%0%j%9%H$NI8<1%?%0$r$O$.\e(B
+\e$B<h$k$3$H$G$9!#$b$7%K%e!<%9%0%k!<\e(B
+\e$B%W\e(B @samp{nntp+news.gnus.org:gmane.text.docbook.apps} \e$B$,!"$9$Y$F$N5-;v$N\e(B
+\e$BBjL>$K\e(B @samp{DOC-BOOK-APPS:} \e$B$H$$$&%?%0$r;}$C$F$$$k$J$i$P!"$=$N%0%k!<%W\e(B
+\e$B$N%0%k!<%W%Q%i%a!<%?$K\e(B @code{(gnus-list-identifiers "DOCBOOK-APPS:")} \e$B$r\e(B
+\e$BF~$l$k$3$H$K$h$C$F!"$=$N%0%k!<%W$N35N,%P%C%U%!$KI=<($5$l$k5-;v$NBjL>$+$i\e(B
+\e$B%?%0$r$O$.<h$k$3$H$,$G$-$^$9!#\e(B
+
\e$B$3$l$O$b$7I,MW$G$"$l$P!"%0%k!<%WKh$N%U%C%/4X?t$H$7$F$b;HMQ$G$-$^$9!#$b$7\e(B
\e$B$"$k%0%k!<%W$KF~$C$?$H$-$K%S!<%W2;$rLD$i$7$?$1$l$P!"$=$N%0%k!<%W$N%Q%i%a!<\e(B
\e$B%?$K\e(B @code{(dummy-variable (ding))} \e$B$_$?$$$J$b$N$r=q$$$F$*$/$3$H$b$G$-$^\e(B
\e$B$K;H$o$l$k0lHLE*$JId9f$G$9!#$3$l$O\e(B @samp{~@{<:Ky2;S@{#,NpJ)l6HK!#~@}} \e$B$N\e(B
\e$B$h$&$JE57?E*$JJ8;zNs$r:n$j$^$9!#\e(B
+@item W u
+@kindex W u (Summary)
+@findex gnus-article-unsplit-urls
+URL \e$B$K4^$^$l$k2~9T$r:o=|$7$^$9!#$$$/$D$+$N%a%$%i!<$O!"9T$rC;$/$9$k$?$a$K\e(B
+\e$B=P$F$$$/%a!<%k$K2~9T$rA^F~$7$^$9$,!"$3$l$OD9$$\e(B URL \e$B$rJ#?t$N9T$KJ,3d$7$F\e(B
+\e$B$7$^$$$^$9!#2~9T$r:o=|$9$k$3$H$K$h$C$F!"$=$l$i$N\e(B URL \e$B$rI|5l$5$;$^\e(B
+\e$B$9\e(B (@code{gnus-article-unsplit-urls})\e$B!#\e(B
+
@item W h
@kindex W h (\e$B35N,\e(B)
@findex gnus-article-wash-html
@item gnus-treat-strip-pem (t, last, integer)
@item gnus-treat-strip-pgp (t, last, integer)
@item gnus-treat-strip-trailing-blank-lines (t, last, integer)
+@item gnus-treat-unsplit-urls (t, integer)
@xref{Article Washing}.
in the summary buffer you enter, and the form @code{nil} will be
@code{eval}ed there.
+@vindex gnus-list-identifiers
+A use for this feature, is to remove a mailing list identifier tag in
+the subject fields of articles. E.g. if the news group
+@samp{nntp+news.gnus.org:gmane.text.docbook.apps} has the tag
+@samp{DOC-BOOK-APPS:} in the subject of all articles, this tag can be
+removed from the article subjects in the summary buffer for the group by
+putting @code{(gnus-list-identifiers "DOCBOOK-APPS:")} into the group
+parameters for the group.
+
+
This can also be used as a group-specific hook function, if you'd like.
If you want to hear a beep when you enter a group, you could put
something like @code{(dummy-variable (ding))} in the parameters of that
common encoding employed when sending Chinese articles. It typically
makes strings look like @samp{~@{<:Ky2;S@{#,NpJ)l6HK!#~@}}.
+@item W u
+@kindex W u (Summary)
+@findex gnus-article-unsplit-urls
+Remove newlines from within URLs. Some mailers insert newlines into
+outgoing email messages to keep lines short. This reformatting can
+split long URLs onto multiple lines. Repair those URLs by removing
+the newlines (@code{gnus-article-unsplit-urls}).
+
@item W h
@kindex W h (Summary)
@findex gnus-article-wash-html
@item gnus-treat-strip-pem (t, last, integer)
@item gnus-treat-strip-pgp (t, last, integer)
@item gnus-treat-strip-trailing-blank-lines (t, last, integer)
+@item gnus-treat-unsplit-urls (t, integer)
@xref{Article Washing}.