From b2ab1e28d0b3dc668d1e9fe2726d1b3f52002aba Mon Sep 17 00:00:00 2001 From: Per Abrahamsen Date: Mon, 26 Nov 2001 13:35:16 +0000 Subject: [PATCH] 2001-11-21 Katsumi Yamaoka * message.el (message-tamago-not-in-use-p): New function. (message-strip-forbidden-properties): Use it. --- lisp/ChangeLog | 5 +++++ lisp/message.el | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 234941357..b77488a81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-11-21 Katsumi Yamaoka + + * message.el (message-tamago-not-in-use-p): New function. + (message-strip-forbidden-properties): Use it. + 2001-11-26 Didier Verna * gnus-start.el (gnus-check-first-time-used): only check for diff --git a/lisp/message.el b/lisp/message.el index 256ad5b50..b6256a9aa 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1623,9 +1623,9 @@ Point is left at the beginning of the narrowed-to region." Emacs has a number of special text properties which can break message composing in various ways. If this option is set, message will strip these properties from the message composition buffer. However, some -packages like Tamago requires these properties to be present in order -to work. If you use one of these packages, turn this option off, and -hope the message composition doesn't break too bad." +packages requires these properties to be present in order to work. +If you use one of these packages, turn this option off, and hope the +message composition doesn't break too bad." :group 'message-various :type 'boolean) @@ -1644,11 +1644,26 @@ hope the message composition doesn't break too bad." "Property list of with properties.forbidden in message buffers. The values of the properties are ignored, only the property names are used.") +(defun message-tamago-not-in-use-p (pos) + "Return t when tamago version 4 is not in use at the cursor position. +Tamago version 4 is a popular input method for writing Japanese text. +It uses the properties `intangible', `invisible', `modification-hooks' +and `read-only' when translating ascii or kana text to kanji text. +These properties are essential to work, so we should never strip them." + (not (and (boundp 'egg-modefull-mode) + (symbol-value 'egg-modefull-mode) + (or (memq (get-text-property pos 'intangible) + '(its-part-1 its-part-2)) + (get-text-property pos 'egg-end) + (get-text-property pos 'egg-lang) + (get-text-property pos 'egg-start))))) + (defun message-strip-forbidden-properties (begin end &optional old-length) "Strip forbidden properties between BEGIN and END, ignoring the third arg. This function is intended to be called from `after-change-functions'. See also `message-forbidden-properties'." - (when message-strip-special-text-properties + (when (and message-strip-special-text-properties + (message-tamago-not-in-use-p begin)) (remove-text-properties begin end message-forbidden-properties))) ;;;###autoload -- 2.25.1