+1999-12-14 23:37:44 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * rfc1843.el (rfc1843-decode-region): Use
+ buffer-substring-no-properties.
+ * gnus-art.el (article-decode-HZ): New function.
+
1999-12-14 22:07:26 Shenghuo ZHU <zsh@cs.rochester.edu>
* nnheader.el (nnheader-translate-file-chars): Only in full path.
(when charset
(mm-decode-body charset)))))))
+(eval-when-compile
+ (require 'rfc1843))
+
+(defun article-decode-HZ ()
+ "Translate a HZ-encoded article."
+ (interactive)
+ (require 'rfc1843)
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (rfc1843-decode-region (point-min) (point-max)))))
+
(defun article-hide-list-identifiers ()
"Remove list identifies from the Subject header.
The `gnus-list-identifiers' variable specifies what to do."
article-remove-cr
article-display-x-face
article-de-quoted-unreadable
+ article-decode-HZ
article-mime-decode-quoted-printable
article-hide-list-identifiers
article-hide-pgp
["Hide citation" gnus-article-hide-citation t]
["Treat overstrike" gnus-article-treat-overstrike t]
["Remove carriage return" gnus-article-remove-cr t]
- ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]))
+ ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
+ ["Decode HZ" gnus-article-decode-HZ t]))
;; Note "Commands" menu is defined in gnus-sum.el for consistency
["Add buttons to head" gnus-article-add-buttons-to-head t]
["Stop page breaking" gnus-summary-stop-page-breaking t]
["Verbose header" gnus-summary-verbose-headers t]
- ["Toggle header" gnus-summary-toggle-header t])
+ ["Toggle header" gnus-summary-toggle-header t]
+ ["HZ" gnus-article-decode-HZ t])
("Output"
["Save in default format" gnus-summary-save-article t]
["Save in file" gnus-summary-save-article-file t]
gnus-article-treat-overstrike
gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
gnus-article-display-x-face gnus-article-de-quoted-unreadable
+ gnus-article-decode-HZ
gnus-article-hide-pgp
gnus-article-hide-pem gnus-article-hide-signature
gnus-article-strip-leading-blank-lines gnus-article-date-local
(require 'mm-util)
(defvar rfc1843-word-regexp
- "~\\({\\([\041-\167][\041-\176]\\| \\)+\\(~}\\|$\\)")
+ "~\\({\\([\041-\167][\041-\176]\\| \\)+\\)\\(~}\\|$\\)")
(defvar rfc1843-word-regexp-strictly
- "~\\({\\([\041-\167][\041-\176]\\)+\\(~}\\|$\\)")
+ "~\\({\\([\041-\167][\041-\176]\\)+\\)\\(~}\\|$\\)")
(defvar rfc1843-hzp-word-regexp
"~\\({\\([\041-\167][\041-\176]\\| \\)+\\|\
(while (re-search-forward (if rfc1843-decode-hzp
rfc1843-hzp-word-regexp
rfc1843-word-regexp) (point-max) t)
- (setq str (match-string 1))
+ ;;; Text with extents may cause XEmacs crash
+ (setq str (buffer-substring-no-properties
+ (match-beginning 1)
+ (match-end 1)))
(setq firstc (aref str 0))
(insert (mm-decode-coding-string
(rfc1843-decode