+2000-10-31 Daiki Ueno <ueno@unixuser.org>
+
+ * mime-edit.el (mime-edit-insert-voice): Add text-property
+ `mime-edit-invisible'.
+ (mime-edit-insert-binary-file): Ditto.
+ (mime-edit-content-end): Check text-property `mime-edit-invisible'
+ instead of `invisible'.
+ (mime-edit-invisible-region): New function.
+ (mime-edit-invisible-p): New function.
+ (mime-edit-next-visible-point): New function.
+
2000-10-19 Takanori Saneto <sanewo@ba2.so-net.ne.jp>
* pgg-pgp.el (pgg-pgp-process-region): bind process-environment
(if (and (featurep 'xemacs)
(featurep 'menubar))
(delete-menu-item (list mime-edit-menu-title)))
- (end-of-invisible)
+ (disable-invisible)
(set-buffer-modified-p (buffer-modified-p))
(run-hooks 'mime-edit-exit-hook)
(message "Exit MIME editor mode.")))
(funcall mime-edit-voice-recorder encoding)
(progn
(insert "\n")
- (invisible-region (point-min)(point-max))
+ (mime-edit-invisible-region (point-min)(point-max))
(goto-char (point-max)))))))
(defun mime-edit-insert-signature (&optional arg)
nil ;Nothing is created.
)))
+(defun mime-edit-invisible-region (start end)
+ (invisible-region start end) ;`invisible-region' might be overridden
+ (static-if (featurep 'xemacs)
+ (if (save-excursion
+ (goto-char start)
+ (eq (following-char) ?\n))
+ (setq start (1+ start)))
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n))
+ (setq end (1- end))))
+ (put-text-property start end mime-edit-invisible t))
+
+(defun mime-edit-invisible-p (pos)
+ (static-when (featurep 'xemacs)
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n))
+ (setq pos (1+ pos))))
+ (get-text-property pos 'mime-edit-invisible))
+
+(defun mime-edit-next-visible-point (pos)
+ (static-if (featurep 'xemacs)
+ (save-excursion
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n))
+ (setq pos (1+ pos)))
+ (or (next-single-property-change pos 'mime-edit-invisible)
+ (point-max)))
+ (save-excursion
+ (goto-char (next-single-property-change pos 'mime-edit-invisible))
+ (if (eq (following-char) ?\n)
+ (forward-char))
+ (point))))
+
(defun mime-edit-insert-binary-file (file &optional encoding)
"Insert binary FILE at point.
Optional argument ENCODING specifies an encoding method such as base64."
(mime-insert-encoded-file file encoding)
(if hide-p
(progn
- (invisible-region (point-min) (point-max))
+ (mime-edit-invisible-region (point-min) (point-max))
(goto-char (point-max)))
(goto-char (point-max))))
(or hide-p
(if (mime-edit-goto-tag)
(progn
(goto-char (match-end 0))
- (if (invisible-p (point))
- (next-visible-point (point))
+ (if (mime-edit-invisible-p (point))
+ (mime-edit-next-visible-point (point))
;; Move to the end of this text.
(if (re-search-forward mime-edit-tag-regexp nil 'move)
;; Don't forget a multiline tag.