diff options
| author | Stefan Monnier | 2008-03-12 19:04:56 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-03-12 19:04:56 +0000 |
| commit | 3d2440b4323f995d39eadd9542889376a22596db (patch) | |
| tree | f31dbf936f4e382202a8e6c6ee32783472319435 | |
| parent | 456cace2bc9d6c62faf2bdd7b53a6ced7a04ac5c (diff) | |
| download | emacs-3d2440b4323f995d39eadd9542889376a22596db.tar.gz emacs-3d2440b4323f995d39eadd9542889376a22596db.zip | |
Use inhibit-read-only.
(mm-inline-text-html-render-with-w3, mm-inline-message): Use dolist.
(mm-pkcs7-signed-magic, mm-pkcs7-enveloped-magic): Use just string
or unibyte-string.
| -rw-r--r-- | lisp/gnus/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 71 |
2 files changed, 42 insertions, 42 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f985cc85491..91a52e87c40 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2008-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-03-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * mm-view.el: Use inhibit-read-only. | ||
| 4 | (mm-inline-text-html-render-with-w3, mm-inline-message): Use dolist. | ||
| 5 | (mm-pkcs7-signed-magic, mm-pkcs7-enveloped-magic): Use just string | ||
| 6 | or unibyte-string. | ||
| 7 | |||
| 3 | * mm-uu.el (mm-uu-copy-to-buffer): Preserve (uni/multi)byteness. | 8 | * mm-uu.el (mm-uu-copy-to-buffer): Preserve (uni/multi)byteness. |
| 4 | (mm-uu-yenc-extract): Use with-current-buffer. | 9 | (mm-uu-yenc-extract): Use with-current-buffer. |
| 5 | 10 | ||
| @@ -10,12 +15,12 @@ | |||
| 10 | (nnmh-request-list-1): Use mm-string-to-multibyte rather than | 15 | (nnmh-request-list-1): Use mm-string-to-multibyte rather than |
| 11 | mm-string-as-multibyte on the output of mm-encode-coding-string. | 16 | mm-string-as-multibyte on the output of mm-encode-coding-string. |
| 12 | 17 | ||
| 13 | * nnimap.el (nnimap-retrieve-headers-progress): Use a unibyte temp buffer. | 18 | * nnimap.el (nnimap-retrieve-headers-progress): Use a unibyte buffer. |
| 14 | (nnimap-request-move-article): Use with-current-buffer. | 19 | (nnimap-request-move-article): Use with-current-buffer. |
| 15 | 20 | ||
| 16 | * mm-decode.el (mm-with-part): Set the buffer to unibyte before inserting | 21 | * mm-decode.el (mm-with-part): Set the buffer to unibyte before |
| 17 | the handle-buffer's text, so the implicit multibyte->unibyte conversion | 22 | inserting the handle-buffer's text, so the implicit multibyte->unibyte |
| 18 | uses string-make-unibyte rather than string-as-unibyte. | 23 | conversion uses string-make-unibyte rather than string-as-unibyte. |
| 19 | 24 | ||
| 20 | * gnus-msg.el: Use with-current-buffer. | 25 | * gnus-msg.el: Use with-current-buffer. |
| 21 | 26 | ||
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 9e9414f8fe2..d91f0dafa2b 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -86,14 +86,14 @@ | |||
| 86 | 86 | ||
| 87 | (defun mm-inline-image-emacs (handle) | 87 | (defun mm-inline-image-emacs (handle) |
| 88 | (let ((b (point-marker)) | 88 | (let ((b (point-marker)) |
| 89 | buffer-read-only) | 89 | (inhibit-read-only t)) |
| 90 | (put-image (mm-get-image handle) b) | 90 | (put-image (mm-get-image handle) b) |
| 91 | (insert "\n\n") | 91 | (insert "\n\n") |
| 92 | (mm-handle-set-undisplayer | 92 | (mm-handle-set-undisplayer |
| 93 | handle | 93 | handle |
| 94 | `(lambda () | 94 | `(lambda () |
| 95 | (let ((b ,b) | 95 | (let ((b ,b) |
| 96 | buffer-read-only) | 96 | (inhibit-read-only t)) |
| 97 | (remove-images b b) | 97 | (remove-images b b) |
| 98 | (delete-region b (+ b 2))))))) | 98 | (delete-region b (+ b 2))))))) |
| 99 | 99 | ||
| @@ -102,12 +102,12 @@ | |||
| 102 | (insert "\n\n") | 102 | (insert "\n\n") |
| 103 | (forward-char -2) | 103 | (forward-char -2) |
| 104 | (let ((annot (make-annotation (mm-get-image handle) nil 'text)) | 104 | (let ((annot (make-annotation (mm-get-image handle) nil 'text)) |
| 105 | buffer-read-only) | 105 | (inhibit-read-only t)) |
| 106 | (mm-handle-set-undisplayer | 106 | (mm-handle-set-undisplayer |
| 107 | handle | 107 | handle |
| 108 | `(lambda () | 108 | `(lambda () |
| 109 | (let ((b ,(point-marker)) | 109 | (let ((b ,(point-marker)) |
| 110 | buffer-read-only) | 110 | (inhibit-read-only t)) |
| 111 | (delete-annotation ,annot) | 111 | (delete-annotation ,annot) |
| 112 | (delete-region (- b 2) b)))) | 112 | (delete-region (- b 2) b)))) |
| 113 | (set-extent-property annot 'mm t) | 113 | (set-extent-property annot 'mm t) |
| @@ -194,13 +194,12 @@ | |||
| 194 | (mm-handle-set-undisplayer | 194 | (mm-handle-set-undisplayer |
| 195 | handle | 195 | handle |
| 196 | `(lambda () | 196 | `(lambda () |
| 197 | (let (buffer-read-only) | 197 | (let ((inhibit-read-only t)) |
| 198 | ,@(if (functionp 'remove-specifier) | 198 | ,@(if (functionp 'remove-specifier) |
| 199 | '((mapcar (lambda (prop) | 199 | '((dolist (prop '(background background-pixmap foreground)) |
| 200 | (remove-specifier | 200 | (remove-specifier |
| 201 | (face-property 'default prop) | 201 | (face-property 'default prop) |
| 202 | (current-buffer))) | 202 | (current-buffer))))) |
| 203 | '(background background-pixmap foreground)))) | ||
| 204 | (delete-region ,(point-min-marker) | 203 | (delete-region ,(point-min-marker) |
| 205 | ,(point-max-marker))))))))) | 204 | ,(point-max-marker))))))))) |
| 206 | 205 | ||
| @@ -389,7 +388,7 @@ | |||
| 389 | (defun mm-inline-text-html (handle) | 388 | (defun mm-inline-text-html (handle) |
| 390 | (let* ((func (or mm-inline-text-html-renderer mm-text-html-renderer)) | 389 | (let* ((func (or mm-inline-text-html-renderer mm-text-html-renderer)) |
| 391 | (entry (assq func mm-text-html-renderer-alist)) | 390 | (entry (assq func mm-text-html-renderer-alist)) |
| 392 | buffer-read-only) | 391 | (inhibit-read-only t)) |
| 393 | (if entry | 392 | (if entry |
| 394 | (setq func (cdr entry))) | 393 | (setq func (cdr entry))) |
| 395 | (cond | 394 | (cond |
| @@ -399,7 +398,7 @@ | |||
| 399 | (apply (car func) handle (cdr func)))))) | 398 | (apply (car func) handle (cdr func)))))) |
| 400 | 399 | ||
| 401 | (defun mm-inline-text-vcard (handle) | 400 | (defun mm-inline-text-vcard (handle) |
| 402 | (let (buffer-read-only) | 401 | (let ((inhibit-read-only t)) |
| 403 | (mm-insert-inline | 402 | (mm-insert-inline |
| 404 | handle | 403 | handle |
| 405 | (concat "\n-- \n" | 404 | (concat "\n-- \n" |
| @@ -415,7 +414,7 @@ | |||
| 415 | (type (mm-handle-media-subtype handle)) | 414 | (type (mm-handle-media-subtype handle)) |
| 416 | (charset (mail-content-type-get | 415 | (charset (mail-content-type-get |
| 417 | (mm-handle-type handle) 'charset)) | 416 | (mm-handle-type handle) 'charset)) |
| 418 | buffer-read-only) | 417 | (inhibit-read-only t)) |
| 419 | (if (or (eq charset 'gnus-decoded) | 418 | (if (or (eq charset 'gnus-decoded) |
| 420 | ;; This is probably not entirely correct, but | 419 | ;; This is probably not entirely correct, but |
| 421 | ;; makes rfc822 parts with embedded multiparts work. | 420 | ;; makes rfc822 parts with embedded multiparts work. |
| @@ -437,15 +436,14 @@ | |||
| 437 | (goto-char (point-max)))) | 436 | (goto-char (point-max)))) |
| 438 | (save-restriction | 437 | (save-restriction |
| 439 | (narrow-to-region b (point)) | 438 | (narrow-to-region b (point)) |
| 440 | (when (or (equal type "enriched") | 439 | (when (member type '("enriched" "richtext")) |
| 441 | (equal type "richtext")) | 440 | (set-text-properties (point-min) (point-max) nil) |
| 442 | (set-text-properties (point-min) (point-max) nil) | ||
| 443 | (ignore-errors | 441 | (ignore-errors |
| 444 | (enriched-decode (point-min) (point-max)))) | 442 | (enriched-decode (point-min) (point-max)))) |
| 445 | (mm-handle-set-undisplayer | 443 | (mm-handle-set-undisplayer |
| 446 | handle | 444 | handle |
| 447 | `(lambda () | 445 | `(lambda () |
| 448 | (let (buffer-read-only) | 446 | (let ((inhibit-read-only t)) |
| 449 | (delete-region ,(point-min-marker) | 447 | (delete-region ,(point-min-marker) |
| 450 | ,(point-max-marker)))))))) | 448 | ,(point-max-marker)))))))) |
| 451 | 449 | ||
| @@ -458,9 +456,9 @@ | |||
| 458 | (mm-handle-set-undisplayer | 456 | (mm-handle-set-undisplayer |
| 459 | handle | 457 | handle |
| 460 | `(lambda () | 458 | `(lambda () |
| 461 | (let (buffer-read-only) | 459 | (let ((inhibit-read-only t)) |
| 462 | (delete-region ,(set-marker (make-marker) b) | 460 | (delete-region ,(copy-marker b) |
| 463 | ,(set-marker (make-marker) (point)))))))) | 461 | ,(copy-marker (point)))))))) |
| 464 | 462 | ||
| 465 | (defun mm-inline-audio (handle) | 463 | (defun mm-inline-audio (handle) |
| 466 | (message "Not implemented")) | 464 | (message "Not implemented")) |
| @@ -527,13 +525,12 @@ | |||
| 527 | (mm-handle-set-undisplayer | 525 | (mm-handle-set-undisplayer |
| 528 | handle | 526 | handle |
| 529 | `(lambda () | 527 | `(lambda () |
| 530 | (let (buffer-read-only) | 528 | (let ((inhibit-read-only t)) |
| 531 | (if (fboundp 'remove-specifier) | 529 | (if (fboundp 'remove-specifier) |
| 532 | ;; This is only valid on XEmacs. | 530 | ;; This is only valid on XEmacs. |
| 533 | (mapcar (lambda (prop) | 531 | (dolist (prop '(background background-pixmap foreground)) |
| 534 | (remove-specifier | 532 | (remove-specifier |
| 535 | (face-property 'default prop) (current-buffer))) | 533 | (face-property 'default prop) (current-buffer)))) |
| 536 | '(background background-pixmap foreground))) | ||
| 537 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) | 534 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) |
| 538 | 535 | ||
| 539 | (defun mm-display-inline-fontify (handle mode) | 536 | (defun mm-display-inline-fontify (handle mode) |
| @@ -605,22 +602,20 @@ | |||
| 605 | ;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) | 602 | ;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) |
| 606 | ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } | 603 | ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } |
| 607 | (defvar mm-pkcs7-signed-magic | 604 | (defvar mm-pkcs7-signed-magic |
| 608 | (mm-string-as-unibyte | 605 | (funcall (if (fboundp 'unibyte-string) 'unibyte-string 'string) |
| 609 | (mapconcat 'char-to-string | 606 | ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c |
| 610 | (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c | 607 | ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e |
| 611 | ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e | 608 | ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 |
| 612 | ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 | 609 | ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02)) |
| 613 | ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02) ""))) | ||
| 614 | 610 | ||
| 615 | ;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) | 611 | ;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) |
| 616 | ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } | 612 | ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } |
| 617 | (defvar mm-pkcs7-enveloped-magic | 613 | (defvar mm-pkcs7-enveloped-magic |
| 618 | (mm-string-as-unibyte | 614 | (funcall (if (fboundp 'unibyte-string) 'unibyte-string 'string) |
| 619 | (mapconcat 'char-to-string | 615 | ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c |
| 620 | (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c | 616 | ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e |
| 621 | ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e | 617 | ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 |
| 622 | ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 | 618 | ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03)) |
| 623 | ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03) ""))) | ||
| 624 | 619 | ||
| 625 | (defun mm-view-pkcs7-get-type (handle) | 620 | (defun mm-view-pkcs7-get-type (handle) |
| 626 | (mm-with-unibyte-buffer | 621 | (mm-with-unibyte-buffer |
| @@ -681,5 +676,5 @@ | |||
| 681 | 676 | ||
| 682 | (provide 'mm-view) | 677 | (provide 'mm-view) |
| 683 | 678 | ||
| 684 | ;;; arch-tag: b60e749a-d05c-47f2-bccd-bdaa59327cb2 | 679 | ;; arch-tag: b60e749a-d05c-47f2-bccd-bdaa59327cb2 |
| 685 | ;;; mm-view.el ends here | 680 | ;;; mm-view.el ends here |