- (let (start)
- (while (setq start (text-property-any (point-min) (point-max)
- 'message-invisible t))
- (remove-text-properties start
- (or (text-property-not-all start (point-max)
- 'message-invisible t)
- (point-max))
- '(invisible nil message-invisible nil))))
- ;; Expose all invisible text.
- (message-check 'invisible-text
- (when (text-property-any (point-min) (point-max) 'invisible t)
- (put-text-property (point-min) (point-max) 'invisible nil)
- (unless (yes-or-no-p
- "Invisible text found and made visible; continue posting? ")
- (error "Invisible text found and made visible")))))
+ (let ((message-invisibles (message-find-invisible-regions)))
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible nil))
+ ;; Expose all invisible text.
+ (message-check 'invisible-text
+ (when (text-property-any (point-min) (point-max) 'invisible t)
+ (put-text-property (point-min) (point-max) 'invisible nil)
+ (unless (yes-or-no-p
+ "Invisible text found and made visible; continue posting? ")
+ (error "Invisible text found and made visible"))))
+ ;; Hide again all text with the property `message-invisible'.
+ ;; It is needed to make MIME-Edit find the MIME part boundaries.
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible t))))