(mm-archive-dissect-and-inline): Fix up the undisplayer.
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 9 Feb 2012 22:01:02 +0000 (23:01 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 9 Feb 2012 22:01:02 +0000 (23:01 +0100)
lisp/ChangeLog
lisp/mm-archive.el

index 905e6f5..2e3721c 100644 (file)
@@ -1,6 +1,7 @@
 2012-02-09  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * mm-archive.el (mm-archive-dissect-and-inline): New function.
+       (mm-archive-dissect-and-inline): Fix up the undisplayer.
 
        * gnus-compat.el: Define `timer-set-function'.
 
index 3f01735..5ca6616 100644 (file)
     handles))
 
 (defun mm-archive-dissect-and-inline (handle)
-  (dolist (handle (cddr (mm-dissect-archive handle)))
-    (mm-display-inline handle)))
+  (let ((start (point-marker)))
+    (save-restriction
+      (narrow-to-region (point) (point))
+      (dolist (handle (cddr (mm-dissect-archive handle)))
+       (goto-char (point-max))
+       (mm-display-inline handle))
+      (goto-char (point-max))
+      (mm-handle-set-undisplayer
+       handle
+       `(lambda ()
+         (let ((inhibit-read-only t)
+               (end ,(point-marker)))
+           (remove-images ,start end)
+           (delete-region ,start end)))))))
 
 (provide 'mm-archive)