comparison lisp/gnus/rfc2047.el @ 90601:a1a25ac6c88a

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 427-436) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 134-136) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-110
author Miles Bader <miles@gnu.org>
date Thu, 14 Sep 2006 09:24:00 +0000
parents c358d0861b16 709ee6c1e02a
children 53a222d8d8e8
comparison
equal deleted inserted replaced
90600:84dd84b43e1b 90601:a1a25ac6c88a
176 "Quote special characters with `\\'s in quoted strings. 176 "Quote special characters with `\\'s in quoted strings.
177 Quoting will not be done in a quoted string if it contains characters 177 Quoting will not be done in a quoted string if it contains characters
178 matching ENCODABLE-REGEXP." 178 matching ENCODABLE-REGEXP."
179 (goto-char (point-min)) 179 (goto-char (point-min))
180 (let ((tspecials (concat "[" ietf-drums-tspecials "]")) 180 (let ((tspecials (concat "[" ietf-drums-tspecials "]"))
181 beg) 181 beg end)
182 (with-syntax-table (standard-syntax-table) 182 (with-syntax-table (standard-syntax-table)
183 (while (search-forward "\"" nil t) 183 (while (search-forward "\"" nil t)
184 (unless (eq (char-before) ?\\) 184 (setq beg (match-beginning 0))
185 (setq beg (match-end 0)) 185 (unless (eq (char-before beg) ?\\)
186 (goto-char (match-beginning 0)) 186 (goto-char beg)
187 (setq beg (1+ beg))
187 (condition-case nil 188 (condition-case nil
188 (progn 189 (progn
189 (forward-sexp) 190 (forward-sexp)
190 (save-restriction 191 (setq end (1- (point)))
191 (narrow-to-region beg (1- (point))) 192 (goto-char beg)
192 (goto-char beg) 193 (if (and encodable-regexp
193 (unless (and encodable-regexp 194 (re-search-forward encodable-regexp end t))
194 (re-search-forward encodable-regexp nil t)) 195 (goto-char (1+ end))
196 (save-restriction
197 (narrow-to-region beg end)
195 (while (re-search-forward tspecials nil 'move) 198 (while (re-search-forward tspecials nil 'move)
196 (unless (and (eq (char-before) ?\\) ;; Already quoted. 199 (if (eq (char-before) ?\\)
197 (looking-at tspecials)) 200 (if (looking-at tspecials) ;; Already quoted.
201 (forward-char)
202 (insert "\\"))
198 (goto-char (match-beginning 0)) 203 (goto-char (match-beginning 0))
199 (unless (or (eq (char-before) ?\\) 204 (insert "\\")
200 (and rfc2047-encode-encoded-words 205 (forward-char))))
201 (eq (char-after) ??) 206 (forward-char)))
202 (eq (char-before) ?=)))
203 (insert "\\")))
204 (forward-char)))))
205 (error 207 (error
206 (goto-char beg)))))))) 208 (goto-char beg))))))))
207 209
208 (defvar rfc2047-encoding-type 'address-mime 210 (defvar rfc2047-encoding-type 'address-mime
209 "The type of encoding done by `rfc2047-encode-region'. 211 "The type of encoding done by `rfc2047-encode-region'.