diff options
author | Richard M. Stallman <rms@gnu.org> | 2011-07-06 18:43:46 -0400 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2011-07-06 18:43:46 -0400 |
commit | 354cf0ba0b20108c9776be1d868458893bc2cd54 (patch) | |
tree | 2e51a199f4ab086515cf27d989a3273b8ef2c165 /lisp | |
parent | a821a23b32d376979c30396e62aece1994f0c460 (diff) | |
download | emacs-354cf0ba0b20108c9776be1d868458893bc2cd54.tar.gz |
Rmail mime: Use markers for positions in entities.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 7 | ||||
-rw-r--r-- | lisp/mail/rmailmm.el | 23 |
2 files changed, 19 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26e8bec7937..700a2b1f512 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-07-06 Richard Stallman <rms@gnu.org> + + * mail/rmailmm.el (rmail-mime-process): Use markers for buf positions. + (rmail-mime-insert-bulk, rmail-mime-insert-text): + Treat markers like ints. + (rmail-mime-entity): Doc fix. + 2011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org> * mail/smtpmail.el (smtpmail-default-smtp-server): Made into a diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 6f1bce03ee9..597068562b5 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -193,8 +193,8 @@ has these values: raw: displayed by the raw MIME data (for the header and body only) HEADER and BODY are vectors [BEG END DISPLAY-FLAG], where BEG and -END specify the region of the header or body lines in RMAIL's -data (mbox) buffer, and DISPLAY-FLAG non-nil means that the +END are markers that specify the region of the header or body lines +in RMAIL's data (mbox) buffer, and DISPLAY-FLAG non-nil means that the header or body is, by default, displayed by the decoded presentation form. @@ -547,7 +547,7 @@ HEADER is a header component of a MIME-entity object (see (beg (point)) (segment (rmail-mime-entity-segment (point) entity))) - (or (integerp (aref body 0)) + (or (integerp (aref body 0)) (markerp (aref body 0)) (let ((data (buffer-string))) (aset body 0 data) (delete-region (point-min) (point-max)))) @@ -704,7 +704,7 @@ directly." (segment (rmail-mime-entity-segment (point) entity)) beg data size) - (if (integerp (aref body 0)) + (if (or (integerp (aref body 0)) (markerp (aref body 0))) (setq data entity size (car bulk-data)) (if (stringp (aref body 0)) @@ -1129,9 +1129,10 @@ modified." (if parse-tag (let* ((is-inline (string= (car content-disposition) "inline")) - (header (vector (point-min) end nil)) + (hdr-end (copy-marker end)) + (header (vector (point-min-marker) hdr-end nil)) (tagline (vector parse-tag (cons nil nil) t)) - (body (vector end (point-max) is-inline)) + (body (vector hdr-end (point-max-marker) is-inline)) (new (vector (aref header 2) (aref tagline 2) (aref body 2))) children handler entity) (cond ((string-match "multipart/.*" (car content-type)) @@ -1180,11 +1181,11 @@ modified." ;; Hide headers and handle the part. (put-text-property (point-min) (point-max) 'rmail-mime-entity (rmail-mime-entity - content-type content-disposition - content-transfer-encoding - (vector (vector 'raw nil 'raw) (vector 'raw nil 'raw)) - (vector nil nil 'raw) (vector "" (cons nil nil) nil) - (vector nil nil 'raw) nil nil)) + content-type content-disposition + content-transfer-encoding + (vector (vector 'raw nil 'raw) (vector 'raw nil 'raw)) + (vector nil nil 'raw) (vector "" (cons nil nil) nil) + (vector nil nil 'raw) nil nil)) (save-restriction (cond ((string= (car content-type) "message/rfc822") (narrow-to-region end (point-max))) |