From: yamaoka Date: Sun, 16 Jan 2005 23:50:08 +0000 (+0000) Subject: (invisible-region): Don't advise it when noninteractive. X-Git-Tag: t-gnus-6_17_4-quimby-~590 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ac32dff0d47030286483fc928300051f1dc452;p=elisp%2Fgnus.git- (invisible-region): Don't advise it when noninteractive. --- diff --git a/ChangeLog b/ChangeLog index 8f5f67e..c6fe76b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-16 Katsumi Yamaoka + + * lisp/message.el (invisible-region): Don't advise it when + noninteractive. + 2005-01-11 Katsumi Yamaoka * lisp/gnus.el (gnus-user-agent): Default to diff --git a/lisp/message.el b/lisp/message.el index 3d1188d..2d6a8ae 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3966,24 +3966,25 @@ It should typically alter the sending method in some way or other." (put 'message-check 'edebug-form-spec '(form body)) ;; Advise the function `invisible-region'. -(let (current-load-list) - (eval - `(defadvice invisible-region (around add-mime-edit-invisible (start end) - activate) - "Advised by T-gnus Message. +(unless noninteractive + (let (current-load-list) + (eval + `(defadvice invisible-region (around add-mime-edit-invisible (start end) + activate) + "Advised by T-gnus Message. Add the text property `mime-edit-invisible' to an invisible text when the buffer's major mode is `message-mode'. The added property will be used to distinguish whether the invisible text is a MIME part or not." - ,(if (featurep 'xemacs) - '(if (eq ?\n (char-after start)) - (setq start (1+ start))) - '(if (eq ?\n (char-after (1- end))) - (setq end (1- end)))) - (setq ad-return-value - (if (eq 'message-mode major-mode) - (add-text-properties start end - '(invisible t mime-edit-invisible t)) - (put-text-property start end 'invisible t)))))) + ,(if (featurep 'xemacs) + '(if (eq ?\n (char-after start)) + (setq start (1+ start))) + '(if (eq ?\n (char-after (1- end))) + (setq end (1- end)))) + (setq ad-return-value + (if (eq 'message-mode major-mode) + (add-text-properties start end + '(invisible t mime-edit-invisible t)) + (put-text-property start end 'invisible t))))))) (defun message-text-with-property (prop &optional start end reverse) "Return a list of start and end positions where the text has PROP.