Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

*** empty log message ***

  • Loading branch information...
commit 53fb4e6dde1447ef6845fa249c0ea31341b69814 1 parent 1736bf8
@larsmagne larsmagne authored
View
75 lisp/ChangeLog
@@ -1,3 +1,78 @@
+Sat Nov 21 09:57:01 1998 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
+
+ * gnus.el: Pterodactyl Gnus v0.53 is released.
+
+1998-11-21 05:54:19 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * mm-decode.el (mm-get-image): New function.
+ (mm-image-fit-p): New function.
+
+ * gnus-xmas.el (gnus-xmas-annotation-in-region-p): Ditto.
+
+ * gnus-util.el (gnus-annotation-in-region-p): New definition.
+
+ * gnus-art.el (gnus-article-insert-newline): New function.
+ (article-goto-body): New function.
+
+1998-11-20 10:34:04 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-mime-display-single): Insert blank line before
+ buttons.
+
+ * gnus-sum.el (gnus-summary-display-buttonized): New command and
+ keystroke.
+
+ * gnus-art.el (gnus-mime-display-single): Don't insert a blank
+ line between parts.
+
+ * message.el (message-remove-header): Go to end if wanted.
+
+1998-11-20 Karl Kleinpaste <karl@justresearch.com>
+
+ * gnus-art.el (gnus-mime-display-alternative): Avoid window
+ movement with save-window-excursion.
+
+Fri Nov 20 03:50:30 1998 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-art.el (gnus-mime-inline-part): Use argument as charset.
+
+Fri Nov 20 03:37:53 1998 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * mm-bodies.el (mm-decode-body): Remove buffer-file-coding-system.
+
+Fri Nov 20 01:20:38 1998 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): Use
+ gnus-newsgroup-coding-system.
+ (gnus-get-newsgroup-headers): Ditto.
+ (gnus-get-newsgroup-headers-xover): Ditto.
+ (gnus-set-global-variables): Ditto.
+ * gnus-art.el (article-decode-mime-words): Ditto.
+ (article-decode-charset): Ditto.
+ (article-decode-encoded-words): Ditto.
+ (article-de-quoted-unreadable): Ditto.
+ (gnus-mime-view-all-parts): Ditto.
+ (gnus-mime-externalize-part): Ditto.
+ (gnus-mm-display-part): Ditto.
+ (gnus-mime-display-alternative): Ditto.
+ (gnus-mime-display-single): Ditto.
+ * mm-view.el (mm-inline-text): Use default coding system.
+
+Fri Nov 20 00:54:37 1998 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-sum.el (gnus-newsgroup-coding-system-alist): New variable.
+ (gnus-newsgroup-iso-8859-1-forced-regexp): New variable.
+ (gnus-newsgroup-coding-system): New local variable.
+ (gnus-newsgroup-iso-8859-1-forced): New local variable.
+ (gnus-summary-local-variables): Add two new local variables.
+ (gnus-newsgroup-setup-coding-system): New function.
+ (gnus-select-newsgroup): Setup coding system.
+ * lpath.el: Add two new variables.
+ * mm-util.el (mm-charset-iso-8859-1-forced): New variable.
+ (mm-charset-to-coding-system): Use mm-charset-iso-8859-1-forced.
+ * gnus-cus.el (gnus-group-parameters): Customizable
+ iso-8859-1-forced.
+
Fri Nov 20 05:30:26 1998 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
* gnus.el: Pterodactyl Gnus v0.52 is released.
View
215 lisp/gnus-art.el
@@ -865,8 +865,7 @@ always hide."
FROM is a string of characters to translate from; to is a string of
characters to translate to."
(save-excursion
- (goto-char (point-min))
- (when (search-forward "\n\n" nil t)
+ (when (article-goto-body)
(let ((buffer-read-only nil)
(x (make-string 225 ?x))
(i -1))
@@ -882,8 +881,7 @@ characters to translate to."
"Translate all string in the body of the article according to MAP.
MAP is an alist where the elements are on the form (\"from\" \"to\")."
(save-excursion
- (goto-char (point-min))
- (when (search-forward "\n\n" nil t)
+ (when (article-goto-body)
(let ((buffer-read-only nil)
elem)
(while (setq elem (pop map))
@@ -895,8 +893,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
"Translate overstrikes into bold text."
(interactive)
(save-excursion
- (goto-char (point-min))
- (when (search-forward "\n\n" nil t)
+ (when (article-goto-body)
(let ((buffer-read-only nil))
(while (search-forward "\b" nil t)
(let ((next (char-after))
@@ -924,8 +921,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
(save-excursion
(let ((buffer-read-only nil))
(widen)
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(end-of-line 1)
(let ((paragraph-start "^[>|#:<;* ]*[ \t]*$")
(adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?")
@@ -1021,7 +1017,9 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
(save-excursion
(set-buffer gnus-article-buffer)
(let ((inhibit-point-motion-hooks t)
- buffer-read-only)
+ buffer-read-only
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(mail-decode-encoded-word-region (point-min) (point-max)))))
(defun article-decode-charset (&optional prompt)
@@ -1043,9 +1041,9 @@ 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))
- (gnus-newsgroup-name
- (gnus-group-find-parameter
- gnus-newsgroup-name 'charset))))
+ (t
+ gnus-newsgroup-coding-system)))
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)
buffer-read-only)
(goto-char (point-max))
(widen)
@@ -1061,7 +1059,9 @@ 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)
- (buffer-read-only nil))
+ buffer-read-only
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(save-restriction
(message-narrow-to-head)
(funcall gnus-decode-header-function (point-min) (point-max)))))
@@ -1073,16 +1073,18 @@ or not."
(interactive (list 'force))
(save-excursion
(let ((buffer-read-only nil)
- (type (gnus-fetch-field "content-transfer-encoding")))
+ (type (gnus-fetch-field "content-transfer-encoding"))
+ (charset
+ (or gnus-newsgroup-coding-system mm-default-coding-system))
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(when (or force
(and type (string-match "quoted-printable" (downcase type))))
- (goto-char (point-min))
- (search-forward "\n\n" nil 'move)
+ (article-goto-body)
(save-restriction
(narrow-to-region (point) (point-max))
(quoted-printable-decode-region (point-min) (point-max))
- (when mm-default-coding-system
- (mm-decode-body mm-default-coding-system)))))))
+ (when charset
+ (mm-decode-body charset)))))))
(defun article-hide-pgp (&optional arg)
"Toggle hiding of any PGP headers and signatures in the current article.
@@ -1169,12 +1171,19 @@ always hide."
(save-excursion
(let ((inhibit-point-motion-hooks t)
buffer-read-only)
- (goto-char (point-min))
- (when (search-forward "\n\n" nil t)
+ (when (article-goto-body)
(while (and (not (eobp))
(looking-at "[ \t]*$"))
(gnus-delete-line))))))
+(defun article-goto-body ()
+ "Place point at the start of the body."
+ (goto-char (point-min))
+ (if (search-forward "\n\n" nil t)
+ t
+ (goto-char (point-max))
+ nil))
+
(defun article-strip-multiple-blank-lines ()
"Replace consecutive blank lines with one empty line."
(interactive)
@@ -1182,15 +1191,13 @@ always hide."
(let ((inhibit-point-motion-hooks t)
buffer-read-only)
;; First make all blank lines empty.
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(while (re-search-forward "^[ \t]+$" nil t)
(unless (gnus-annotation-in-region-p
(match-beginning 0) (match-end 0))
(replace-match "" nil t)))
;; Then replace multiple empty lines with a single empty line.
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(while (re-search-forward "\n\n\n+" nil t)
(unless (gnus-annotation-in-region-p
(match-beginning 0) (match-end 0))
@@ -1202,8 +1209,7 @@ always hide."
(save-excursion
(let ((inhibit-point-motion-hooks t)
buffer-read-only)
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(while (re-search-forward "^[ \t]+" nil t)
(replace-match "" t t)))))
@@ -1220,8 +1226,7 @@ always hide."
(save-excursion
(let ((inhibit-point-motion-hooks t)
buffer-read-only)
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(while (re-search-forward "^[ \t]*\n" nil t)
(replace-match "" t t)))))
@@ -1571,8 +1576,7 @@ This format is defined by the `gnus-article-time-format' variable."
(props (append '(article-type emphasis)
gnus-hidden-properties))
regexp elem beg invisible visible face)
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(setq beg (point))
(while (setq elem (pop alist))
(goto-char beg)
@@ -1783,8 +1787,7 @@ The directory to save in defaults to `gnus-article-save-directory'."
(save-excursion
(save-restriction
(widen)
- (goto-char (point-min))
- (when (search-forward "\n\n" nil t)
+ (when (article-goto-body)
(narrow-to-region (point) (point-max)))
(gnus-output-to-file filename))))
filename)
@@ -2186,8 +2189,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
t)))
(gnus-set-mode-line 'article)
(gnus-configure-windows 'article)
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(set-window-point (get-buffer-window (current-buffer)) (point))
t))))))
@@ -2268,7 +2270,9 @@ If ALL-HEADERS is non-nil, no headers are hidden."
"View all the MIME parts."
(interactive)
(gnus-article-check-buffer)
- (let ((handles gnus-article-mime-handles))
+ (let ((handles gnus-article-mime-handles)
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(while handles
(mm-display-part (pop handles)))))
@@ -2312,9 +2316,9 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(normal-mode)
(goto-char (point-min))))
-(defun gnus-mime-inline-part ()
+(defun gnus-mime-inline-part (&optional charset)
"Insert the MIME part under point into the current buffer."
- (interactive)
+ (interactive "P") ; For compatible reason, not using "z".
(gnus-article-check-buffer)
(let* ((data (get-text-property (point) 'gnus-data))
(contents (mm-get-part data))
@@ -2324,6 +2328,10 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(if (mm-handle-undisplayer data)
(mm-remove-part data)
(forward-line 2)
+ (when charset
+ (unless (symbolp charset)
+ (setq charset (mm-read-coding-system "Charset: ")))
+ (setq contents (mm-decode-coding-string contents charset)))
(mm-insert-inline data contents)
(goto-char b))))
@@ -2333,7 +2341,9 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(gnus-article-check-buffer)
(let* ((handle (get-text-property (point) 'gnus-data))
(url-standalone-mode (not gnus-plugged))
- (mm-user-display-methods nil))
+ (mm-user-display-methods nil)
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(if (mm-handle-undisplayer handle)
(mm-remove-part handle)
(mm-display-part handle))))
@@ -2361,7 +2371,9 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(gnus-insert-mime-button
handle id (list (not (mm-handle-displayed-p handle))))
(prog1
- (let ((window (selected-window)))
+ (let ((window (selected-window))
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(save-excursion
(unwind-protect
(let ((win (get-buffer-window (current-buffer) t)))
@@ -2436,8 +2448,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(cdr handles)))
(unless ihandles
;; Clean up for mime parts.
- (goto-char (point-min))
- (search-forward "\n\n" nil t)
+ (article-goto-body)
(delete-region (point) (point-max)))
(if (stringp (car handles))
(if (equal (car handles) "multipart/alternative")
@@ -2491,73 +2502,58 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(while types
(when (string-match (pop types) type)
(throw 'found t)))))))
+ (gnus-article-insert-newline)
(gnus-insert-mime-button
handle id (list (or display
- (and (not not-attachment) text))))))
- (insert "\n\n")
+ (and (not not-attachment) text))))
+ (gnus-article-insert-newline)))
+ (gnus-article-insert-newline)
(cond
(display
(forward-line -2)
- (mm-display-part handle t)
+ (let ((rfc2047-default-charset gnus-newsgroup-coding-system)
+ (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)
(forward-line -2)
- (insert "\n")
+ (gnus-article-insert-newline)
(mm-insert-inline handle (mm-get-part handle))
(goto-char (point-max))))))))
+(defun gnus-article-insert-newline ()
+ "Insert a newline, but mark it as undeletable."
+ (gnus-put-text-property
+ (point) (progn (insert "\n") (point)) 'gnus-undeletable t))
+
(defun gnus-mime-display-alternative (handles &optional preferred ibegend id)
(let* ((preferred (or preferred (mm-preferred-alternative handles)))
(ihandles handles)
(point (point))
handle buffer-read-only from props begend not-pref)
- (save-restriction
- (when ibegend
- (narrow-to-region (car ibegend) (cdr ibegend))
- (delete-region (point-min) (point-max))
- (mm-remove-parts handles))
- (setq begend (list (point-marker)))
- ;; Do the toggle.
- (unless (setq not-pref (cadr (member preferred ihandles)))
- (setq not-pref (car ihandles)))
- (gnus-add-text-properties
- (setq from (point))
- (progn
- (insert (format "%d. " id))
- (point))
- `(gnus-callback
- (lambda (handles)
- (unless ,(not ibegend)
- (setq gnus-article-mime-handle-alist
- ',gnus-article-mime-handle-alist))
- (gnus-mime-display-alternative
- ',ihandles ',not-pref ',begend ,id))
- local-map ,gnus-mime-button-map
- ,gnus-mouse-face-prop ,gnus-article-mouse-face
- face ,gnus-article-button-face
- keymap ,gnus-mime-button-map
- gnus-part ,id
- gnus-data ,handle))
- (widget-convert-button 'link from (point)
- :action 'gnus-widget-press-button
- :button-keymap gnus-widget-button-keymap)
- ;; Do the handles
- (while (setq handle (pop handles))
+ (save-window-excursion
+ (save-restriction
+ (when ibegend
+ (narrow-to-region (car ibegend) (cdr ibegend))
+ (delete-region (point-min) (point-max))
+ (mm-remove-parts handles))
+ (setq begend (list (point-marker)))
+ ;; Do the toggle.
+ (unless (setq not-pref (cadr (member preferred ihandles)))
+ (setq not-pref (car ihandles)))
(gnus-add-text-properties
(setq from (point))
(progn
- (insert (format "[%c] %-18s"
- (if (equal handle preferred) ?* ? )
- (if (stringp (car handle))
- (car handle)
- (car (mm-handle-type handle)))))
+ (insert (format "%d. " id))
(point))
`(gnus-callback
(lambda (handles)
(unless ,(not ibegend)
(setq gnus-article-mime-handle-alist
',gnus-article-mime-handle-alist))
- (gnus-mime-display-alternative ',ihandles ',handle ',begend ,id))
+ (gnus-mime-display-alternative
+ ',ihandles ',not-pref ',begend ,id))
local-map ,gnus-mime-button-map
,gnus-mouse-face-prop ,gnus-article-mouse-face
face ,gnus-article-button-face
@@ -2567,14 +2563,44 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(widget-convert-button 'link from (point)
:action 'gnus-widget-press-button
:button-keymap gnus-widget-button-keymap)
- (insert " "))
- (insert "\n\n")
- (when preferred
- (if (stringp (car preferred))
- (gnus-display-mime preferred)
- (mm-display-part preferred)
- (goto-char (point-max)))
- (setcdr begend (point-marker))))
+ ;; Do the handles
+ (while (setq handle (pop handles))
+ (gnus-add-text-properties
+ (setq from (point))
+ (progn
+ (insert (format "[%c] %-18s"
+ (if (equal handle preferred) ?* ? )
+ (if (stringp (car handle))
+ (car handle)
+ (car (mm-handle-type handle)))))
+ (point))
+ `(gnus-callback
+ (lambda (handles)
+ (unless ,(not ibegend)
+ (setq gnus-article-mime-handle-alist
+ ',gnus-article-mime-handle-alist))
+ (gnus-mime-display-alternative
+ ',ihandles ',handle ',begend ,id))
+ local-map ,gnus-mime-button-map
+ ,gnus-mouse-face-prop ,gnus-article-mouse-face
+ face ,gnus-article-button-face
+ keymap ,gnus-mime-button-map
+ gnus-part ,id
+ gnus-data ,handle))
+ (widget-convert-button 'link from (point)
+ :action 'gnus-widget-press-button
+ :button-keymap gnus-widget-button-keymap)
+ (insert " "))
+ (insert "\n\n")
+ (when preferred
+ (if (stringp (car preferred))
+ (gnus-display-mime preferred)
+ (let ((rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced
+ gnus-newsgroup-iso-8859-1-forced))
+ (mm-display-part preferred)))
+ (goto-char (point-max))
+ (setcdr begend (point-marker)))))
(when ibegend
(goto-char point))))
@@ -3092,8 +3118,7 @@ groups."
(save-excursion
(save-restriction
(widen)
- (goto-char (point-min))
- (when (search-forward "\n\n" nil 1)
+ (when (article-goto-body)
(let ((lines (count-lines (point) (point-max)))
(length (- (point-max) (point)))
(case-fold-search t)
@@ -3386,9 +3411,7 @@ specified by `gnus-button-alist'."
'gnus-callback nil))
(set-marker marker nil)))
;; We skip the headers.
- (goto-char (point-min))
- (unless (search-forward "\n\n" nil t)
- (goto-char (point-max)))
+ (article-goto-body)
(setq beg (point))
(while (setq entry (pop alist))
(setq regexp (car entry))
View
4 lisp/gnus-cus.el
@@ -164,6 +164,10 @@ 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.")
)
"Alist of valid group parameters.
View
91 lisp/gnus-sum.el
@@ -797,6 +797,22 @@ which it may alter in any way.")
:group 'gnus-summary
:type 'regexp)
+(defcustom gnus-newsgroup-coding-system-alist
+ '(("^hk\\>\\|^tw\\>\\|\\<big5\\>" . cn-big5)
+ ("^cn\\>\\|\\<chinese\\>" . cn-gb-2312)
+ ("^fj\\>" . iso-2022-jp-2)
+ ("^relcom\\>" . koi8-r))
+ "Alist of Regexps (to match group names) and CODING-SYSTEMs to be applied."
+ :type '(repeat (cons (regexp :tag "Group")
+ (symbol :tag "Charset")))
+ :group 'gnus)
+
+(defcustom gnus-newsgroup-iso-8859-1-forced-regexp
+ "^tw\\>\\|^hk\\>\\|^cn\\>\\|\\<chinese\\>"
+ "Regexp of newsgroup in which ISO-8859-1 is forced to other charset."
+ :type 'regexp
+ :group 'gnus)
+
;;; Internal variables
(defvar gnus-article-mime-handles nil)
@@ -985,6 +1001,9 @@ variable (string, integer, character, etc).")
(defvar gnus-last-article nil)
(defvar gnus-newsgroup-history nil)
+(defvar gnus-newsgroup-coding-system nil)
+(defvar gnus-newsgroup-iso-8859-1-forced nil)
+
(defconst gnus-summary-local-variables
'(gnus-newsgroup-name
gnus-newsgroup-begin gnus-newsgroup-end
@@ -1015,7 +1034,8 @@ variable (string, integer, character, etc).")
(gnus-newsgroup-expunged-tally . 0)
gnus-cache-removable-articles gnus-newsgroup-cached
gnus-newsgroup-data gnus-newsgroup-data-reverse
- gnus-newsgroup-limit gnus-newsgroup-limits)
+ gnus-newsgroup-limit gnus-newsgroup-limits
+ gnus-newsgroup-coding-system gnus-newsgroup-iso-8859-1-forced)
"Variables that are buffer-local to the summary buffers.")
;; Byte-compiler warning.
@@ -1510,7 +1530,11 @@ increase the score of each group you read."
"h" gnus-summary-save-article-folder
"v" gnus-summary-save-article-vm
"p" gnus-summary-pipe-output
- "s" gnus-soup-add-article))
+ "s" gnus-soup-add-article)
+
+ (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map)
+ "b" gnus-summary-display-buttonized)
+ )
(defun gnus-summary-make-menu-bar ()
(gnus-turn-off-edit-menu 'summary)
@@ -2374,7 +2398,9 @@ marks of articles."
(original gnus-original-article-buffer)
(gac gnus-article-current)
(reffed gnus-reffed-article-number)
- (score-file gnus-current-score-file))
+ (score-file gnus-current-score-file)
+ (coding-system gnus-newsgroup-coding-system)
+ (iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(save-excursion
(set-buffer gnus-group-buffer)
(setq gnus-newsgroup-name name
@@ -2387,7 +2413,9 @@ marks of articles."
gnus-article-buffer article-buffer
gnus-original-article-buffer original
gnus-reffed-article-number reffed
- gnus-current-score-file score-file)
+ gnus-current-score-file score-file
+ gnus-newsgroup-coding-system coding-system
+ gnus-newsgroup-iso-8859-1-forced iso-8859-1-forced)
;; The article buffer also has local variables.
(when (gnus-buffer-live-p gnus-article-buffer)
(set-buffer gnus-article-buffer)
@@ -2462,7 +2490,9 @@ 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)))))
+ (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header))))
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(cond
((and to
gnus-ignored-from-addresses
@@ -3981,6 +4011,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-coding-system)
;; Adjust and set lists of article marks.
(when info
@@ -4491,7 +4522,9 @@ The resulting hash table is returned, or nil if no Xrefs were found."
(or dependencies
(save-excursion (set-buffer gnus-summary-buffer)
gnus-newsgroup-dependencies)))
- headers id end ref)
+ headers id end ref
+ (rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced))
(save-excursion
(set-buffer nntp-server-buffer)
;; Translate all TAB characters into SPACE characters.
@@ -4644,7 +4677,9 @@ 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 ((cur nntp-server-buffer)
+ (let ((rfc2047-default-charset gnus-newsgroup-coding-system)
+ (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)
+ (cur nntp-server-buffer)
(dependencies (or dependencies gnus-newsgroup-dependencies))
number headers header)
(save-excursion
@@ -9110,6 +9145,48 @@ save those articles instead."
(gnus-summary-exit))
buffers)))))
+(defun gnus-newsgroup-setup-coding-system ()
+ "Setup newsgroup default coding system."
+ (setq gnus-newsgroup-coding-system
+ (or (and gnus-newsgroup-name
+ (or (gnus-group-find-parameter
+ gnus-newsgroup-name 'charset)
+ (let ((alist gnus-newsgroup-coding-system-alist)
+ elem (charset nil))
+ (while alist
+ (if (string-match
+ (car (setq elem (pop alist)))
+ gnus-newsgroup-name)
+ (setq alist nil
+ charset (cdr elem))))
+ charset)))
+ rfc2047-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)
+ (string-match gnus-newsgroup-iso-8859-1-forced-regexp
+ gnus-newsgroup-name))))
+ (if (stringp gnus-newsgroup-coding-system)
+ (setq gnus-newsgroup-coding-system
+ (intern (downcase gnus-newsgroup-coding-system))))
+ (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-coding-system))))
+
+;;;
+;;; MIME Commands
+;;;
+
+(defun gnus-summary-display-buttonized (&optional arg)
+ "Display the current buffer fully MIME-buttonized."
+ (interactive "P")
+ (require 'gnus-art)
+ (let ((gnus-unbuttonized-mime-types nil))
+ (gnus-summary-show-article arg)))
+
(gnus-ems-redefine)
(provide 'gnus-sum)
View
5 lisp/gnus-util.el
@@ -929,6 +929,11 @@ ARG is passed to the first function."
(when win
(set-window-start win (or point (point))))))
+(defun gnus-annotation-in-region-p (b e)
+ (if (= b e)
+ (eq (cadr (memq 'gnus-undeletable (text-properties-at b))) t)
+ (text-property-any b e 'gnus-undeletable t)))
+
(provide 'gnus-util)
;;; gnus-util.el ends here
View
5 lisp/gnus-xmas.el
@@ -793,7 +793,10 @@ XEmacs compatibility workaround."
(gnus-splash)))
(defun gnus-xmas-annotation-in-region-p (b e)
- (map-extents (lambda (e u) t) nil b e nil nil 'mm t))
+ (or (map-extents (lambda (e u) t) nil b e nil nil 'mm t)
+ (if (= b e)
+ (eq (cadr (memq 'gnus-undeletable (text-properties-at b))) t)
+ (text-property-any b e 'gnus-undeletable t))))
(defun gnus-xmas-mime-button-menu (event)
"Construct a context-sensitive menu of MIME commands."
View
3  lisp/gnus.el
@@ -254,7 +254,7 @@ is restarted, and sometimes reloaded."
:link '(custom-manual "(gnus)Exiting Gnus")
:group 'gnus)
-(defconst gnus-version-number "0.52"
+(defconst gnus-version-number "0.53"
"Version number for this version of Gnus.")
(defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
@@ -292,7 +292,6 @@ be set in `.emacs' instead."
(defalias 'gnus-deactivate-mark 'deactivate-mark)
(defalias 'gnus-window-edges 'window-edges)
(defalias 'gnus-key-press-event-p 'numberp)
- (defalias 'gnus-annotation-in-region-p 'ignore)
(defalias 'gnus-decode-rfc1522 'ignore))
;; We define these group faces here to avoid the display
View
2  lisp/lpath.el
@@ -45,6 +45,8 @@
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-coding-system
+ gnus-newsgroup-iso-8859-1-forced
mail-mode-hook enable-multibyte-characters
adaptive-fill-first-line-regexp adaptive-fill-regexp
url-current-mime-headers buffer-file-coding-system)))
View
2  lisp/message.el
@@ -1139,7 +1139,7 @@ Return the number of headers removed."
(forward-line 1)
(if (re-search-forward "^[^ \t]" nil t)
(goto-char (match-beginning 0))
- (point-max))))
+ (goto-char (point-max)))))
number))
(defun message-narrow-to-headers ()
View
4 lisp/mm-bodies.el
@@ -137,7 +137,9 @@ The characters in CHARSET should then be decoded."
(let (mule-charset)
(when (and charset
(setq mule-charset (mm-charset-to-coding-system charset))
- buffer-file-coding-system
+ ;; buffer-file-coding-system
+ ;Article buffer is nil coding system
+ ;in XEmacs
enable-multibyte-characters
(or (not (eq mule-charset 'ascii))
(setq mule-charset rfc2047-default-charset)))
View
32 lisp/mm-decode.el
@@ -46,10 +46,14 @@
`(nth 5 ,handle))
(defvar mm-inline-media-tests
- '(("image/jpeg" mm-inline-image (featurep 'jpeg))
- ("image/png" mm-inline-image (featurep 'png))
- ("image/gif" mm-inline-image (featurep 'gif))
- ("image/tiff" mm-inline-image (featurep 'tiff))
+ '(("image/jpeg" mm-inline-image
+ (and (featurep 'jpeg) (mm-image-fit-p handle)))
+ ("image/png" mm-inline-image
+ (and (featurep 'png) (mm-image-fit-p handle)))
+ ("image/gif" mm-inline-image
+ (and (featurep 'gif) (mm-image-fit-p handle)))
+ ("image/tiff" mm-inline-image
+ (and (featurep 'tiff) (mm-image-fit-p handle)))
("image/xbm" mm-inline-image (and (fboundp 'device-type)
(eq (device-type) 'x)))
("image/xpm" mm-inline-image (featurep 'xpm))
@@ -493,6 +497,26 @@ This overrides entries in the mailcap file."
"Return the handle(s) referred to by ID."
(cdr (assoc id mm-content-id-alist)))
+(defun mm-get-image (handle)
+ "Return an image instance based on HANDLE."
+ (let ((type (cadr (split-string (car (mm-handle-type handle)) "/"))))
+ (mm-with-unibyte-buffer
+ (insert-buffer-substring (mm-handle-buffer handle))
+ (mm-decode-content-transfer-encoding
+ (mm-handle-encoding handle)
+ (car (mm-handle-type handle)))
+ (make-image-specifier
+ (vector (intern type) :data (buffer-string))))))
+
+(defun mm-image-fit-p (handle)
+ "Say whether the image in HANDLE will fit the current window."
+ (or t
+ (let ((image (make-image-instance (mm-get-image handle))))
+ (and (< (image-instance-width image)
+ (window-pixel-width))
+ (< (image-instance-height image)
+ (window-pixel-height))))))
+
(provide 'mm-decode)
;; mm-decode.el ends here
View
6 lisp/mm-util.el
@@ -116,6 +116,9 @@
dest)
"Charset/coding system alist.")
+;;;Internal variable
+(defvar mm-charset-iso-8859-1-forced nil)
+
(defun mm-mule-charset-to-mime-charset (charset)
"Return the MIME charset corresponding to MULE CHARSET."
(let ((alist mm-mime-mule-charset-alist)
@@ -134,6 +137,9 @@ 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))
View
21 lisp/mm-view.el
@@ -33,19 +33,11 @@
;;;
(defun mm-inline-image (handle)
- (let ((type (cadr (split-string (car (mm-handle-type handle)) "/")))
- buffer-read-only image)
- (mm-with-unibyte-buffer
- (insert-buffer-substring (mm-handle-buffer handle))
- (mm-decode-content-transfer-encoding
- (mm-handle-encoding handle)
- (car (mm-handle-type handle)))
- (setq image (make-image-specifier
- (vector (intern type) :data (buffer-string)))))
- (let ((annot (make-annotation image nil 'text)))
- (mm-insert-inline handle ".\n")
- (set-extent-property annot 'mm t)
- (set-extent-property annot 'duplicable t))))
+ (let ((annot (make-annotation (mm-get-image handle) nil 'text))
+ buffer-read-only)
+ (mm-insert-inline handle ".\n")
+ (set-extent-property annot 'mm t)
+ (set-extent-property annot 'duplicable t)))
(defun mm-inline-text (handle)
(let ((type (cadr (split-string (car (mm-handle-type handle)) "/")))
@@ -64,8 +56,7 @@
(narrow-to-region b (point))
(let ((charset (mail-content-type-get
(mm-handle-type handle) 'charset)))
- (when charset
- (mm-decode-body charset nil)))
+ (mm-decode-body charset nil))
(mm-handle-set-undisplayer
handle
`(lambda ()
View
6 texi/gnus.texi
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@setfilename gnus
-@settitle Pterodactyl Gnus 0.52 Manual
+@settitle Pterodactyl Gnus 0.53 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.52 Manual
+@title Pterodactyl Gnus 0.53 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.52.
+This manual corresponds to Pterodactyl Gnus 0.53.
@end ifinfo
View
6 texi/message.texi
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@setfilename message
-@settitle Pterodactyl Message 0.52 Manual
+@settitle Pterodactyl Message 0.53 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.52 Manual
+@title Pterodactyl Message 0.53 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.52. Message is
+This manual corresponds to Pterodactyl Message 0.53. Message is
distributed with the Gnus distribution bearing the same version number
as this manual.
Please sign in to comment.
Something went wrong with that request. Please try again.