[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/rfc2047.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/rfc2047.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:35:00 -0400 |
Index: emacs/lisp/gnus/rfc2047.el
diff -c emacs/lisp/gnus/rfc2047.el:1.10.8.1 emacs/lisp/gnus/rfc2047.el:1.10.8.2
*** emacs/lisp/gnus/rfc2047.el:1.10.8.1 Fri Apr 4 01:20:21 2003
--- emacs/lisp/gnus/rfc2047.el Tue Oct 14 19:34:51 2003
***************
*** 1,5 ****
;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages
! ;; Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <address@hidden>
;; MORIOKA Tomohiko <address@hidden>
--- 1,5 ----
;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages
! ;; Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <address@hidden>
;; MORIOKA Tomohiko <address@hidden>
***************
*** 39,45 ****
(autoload 'mm-body-7-or-8 "mm-bodies")
(defvar rfc2047-header-encoding-alist
! '(("Newsgroups" . nil)
("Message-ID" . nil)
("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|Reply-To\\|Sender\\)" .
address-mime)
--- 39,45 ----
(autoload 'mm-body-7-or-8 "mm-bodies")
(defvar rfc2047-header-encoding-alist
! '(("Newsgroups\\|Followup-To" . nil)
("Message-ID" . nil)
("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|Reply-To\\|Sender\\)" .
address-mime)
***************
*** 135,149 ****
(save-restriction
(rfc2047-narrow-to-field)
(if (not (rfc2047-encodable-p))
! (if (and (eq (mm-body-7-or-8) '8bit)
! (mm-multibyte-p)
! (mm-coding-system-p
! (car message-posting-charset)))
! ;; 8 bit must be decoded.
! ;; Is message-posting-charset a coding system?
! (mm-encode-coding-region
! (point-min) (point-max)
! (car message-posting-charset)))
;; We found something that may perhaps be encoded.
(setq method nil
alist rfc2047-header-encoding-alist)
--- 135,159 ----
(save-restriction
(rfc2047-narrow-to-field)
(if (not (rfc2047-encodable-p))
! (prog1
! (if (and (eq (mm-body-7-or-8) '8bit)
! (mm-multibyte-p)
! (mm-coding-system-p
! (car message-posting-charset)))
! ;; 8 bit must be decoded.
! (mm-encode-coding-region
! (point-min) (point-max)
! (mm-charset-to-coding-system
! (car message-posting-charset))))
! ;; No encoding necessary, but folding is nice
! (rfc2047-fold-region
! (save-excursion
! (goto-char (point-min))
! (skip-chars-forward "^:")
! (when (looking-at ": ")
! (forward-char 2))
! (point))
! (point-max)))
;; We found something that may perhaps be encoded.
(setq method nil
alist rfc2047-header-encoding-alist)
***************
*** 230,236 ****
(let ((start (point)) ; start of current token
end ; end of current token
;; Whether there's an encoded word before the current
! ;; tpken, either immediately or separated by space.
last-encoded)
(goto-char (point-min))
(condition-case nil ; in case of unbalanced quotes
--- 240,246 ----
(let ((start (point)) ; start of current token
end ; end of current token
;; Whether there's an encoded word before the current
! ;; token, either immediately or separated by space.
last-encoded)
(goto-char (point-min))
(condition-case nil ; in case of unbalanced quotes
***************
*** 240,246 ****
(while (not (eobp))
(setq start (point))
;; Skip whitespace.
! (unless (= 0 (skip-chars-forward " \t"))
(setq start (point)))
(cond
((not (char-after))) ; eob
--- 250,256 ----
(while (not (eobp))
(setq start (point))
;; Skip whitespace.
! (unless (= 0 (skip-chars-forward " \t\n"))
(setq start (point)))
(cond
((not (char-after))) ; eob
***************
*** 364,369 ****
--- 374,380 ----
(goto-char (point-min))
(let ((break nil)
(qword-break nil)
+ (first t)
(bol (save-restriction
(widen)
(mm-point-at-bol))))
***************
*** 372,378 ****
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
! (if (looking-at " \t")
(insert ?\n)
(insert "\n "))
(setq bol (1- (point)))
--- 383,389 ----
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
! (if (looking-at "[ \t]")
(insert ?\n)
(insert "\n "))
(setq bol (1- (point)))
***************
*** 392,398 ****
(forward-char 1))
((memq (char-after) '(? ?\t))
(skip-chars-forward " \t")
! (setq break (1- (point))))
((not break)
(if (not (looking-at "=\\?[^=]"))
(if (eq (char-after) ?=)
--- 403,412 ----
(forward-char 1))
((memq (char-after) '(? ?\t))
(skip-chars-forward " \t")
! (if first
! ;; Don't break just after the header name.
! (setq first nil)
! (setq break (1- (point)))))
((not break)
(if (not (looking-at "=\\?[^=]"))
(if (eq (char-after) ?=)
***************
*** 406,412 ****
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
! (if (looking-at " \t")
(insert ?\n)
(insert "\n "))
(setq bol (1- (point)))
--- 420,426 ----
(goto-char (or break qword-break))
(setq break nil
qword-break nil)
! (if (looking-at "[ \t]")
(insert ?\n)
(insert "\n "))
(setq bol (1- (point)))
***************
*** 426,439 ****
leading)
(forward-line 1)
(while (not (eobp))
! (looking-at "[ \t]*")
! (setq leading (- (match-end 0) (match-beginning 0)))
! (if (< (- (mm-point-at-eol) bol leading) 76)
! (progn
! (goto-char eol)
! (delete-region eol (progn
! (skip-chars-forward "[ \t\n\r]+")
! (1- (point)))))
(setq bol (mm-point-at-bol)))
(setq eol (mm-point-at-eol))
(forward-line 1)))))
--- 440,451 ----
leading)
(forward-line 1)
(while (not (eobp))
! (if (and (looking-at "[ \t]")
! (< (- (mm-point-at-eol) bol) 76))
! (delete-region eol (progn
! (goto-char eol)
! (skip-chars-forward "\r\n")
! (point)))
(setq bol (mm-point-at-bol)))
(setq eol (mm-point-at-eol))
(forward-line 1)))))
***************
*** 579,582 ****
--- 591,595 ----
(provide 'rfc2047)
+ ;;; arch-tag: a07fe3d4-22b5-4c4a-bd89-b1f82d5d36f6
;;; rfc2047.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/gnus/rfc2047.el [lexbind],
Miles Bader <=