From 9538f4f3bcc62ef62322ae5de2a4dbc9709f9999 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Wed, 22 Jun 2005 19:57:42 +0000 Subject: [PATCH] Try to make Muse play nice with outline minor mode. * lisp/muse-colors.el (muse-colors-emphasized, muse-colors-emphasized) (muse-colors-underlined, muse-use-font-lock, muse-link-properties): Use "muse" instead of "t" when adding invisibility to text or checking for invisibility. * lisp/muse.el (muse-add-to-invisibility-spec): New function that is a compatibility wrapper for `add-to-invisibility-spec'; XEmacs doesn't have this function. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-72 --- ChangeLog | 20 ++++++++++++++++++++ lisp/muse-colors.el | 15 ++++++++------- lisp/muse.el | 11 +++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 312b32a..a7e36df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,26 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-06-22 19:57:42 GMT Michael Olson patch-72 + + Summary: + Try to make Muse play nice with outline minor mode. + Revision: + muse--main--1.0--patch-72 + + * lisp/muse-colors.el (muse-colors-emphasized, muse-colors-emphasized) + (muse-colors-underlined, muse-use-font-lock, muse-link-properties): Use + "muse" instead of "t" when adding invisibility to text or checking for + invisibility. + + * lisp/muse.el (muse-add-to-invisibility-spec): New function that is a + compatibility wrapper for `add-to-invisibility-spec'; XEmacs doesn't have + this function. + + modified files: + ChangeLog lisp/muse-colors.el lisp/muse.el + + 2005-06-22 08:02:58 GMT Michael Olson patch-71 Summary: diff --git a/lisp/muse-colors.el b/lisp/muse-colors.el index 22e5524..b2cde28 100644 --- a/lisp/muse-colors.el +++ b/lisp/muse-colors.el @@ -185,7 +185,7 @@ whether progress messages should be displayed to the user." (e1 (match-end 0)) (leader (- e1 beg)) b2 e2 multiline) - (unless (get-text-property beg 'invisible) + (unless (eq (get-text-property beg 'invisible) 'muse) ;; check if it's a header (if (eq (char-after e1) ?\ ) (when (or (= beg (point-min)) @@ -214,12 +214,12 @@ whether progress messages should be displayed to the user." (not (eq leader (- e2 b2))) (eq (char-before b2) ?\ ) (not (eq (char-after b2) ?*))) - (add-text-properties beg e1 '(invisible t)) + (add-text-properties beg e1 '(invisible muse)) (add-text-properties e1 b2 (list 'face (cond ((= leader 1) 'italic) ((= leader 2) 'bold) ((= leader 3) 'bold-italic)))) - (add-text-properties b2 e2 '(invisible t)) + (add-text-properties b2 e2 '(invisible muse)) (when multiline (add-text-properties beg e2 '(font-lock-multiline t)))))))))) @@ -227,7 +227,7 @@ whether progress messages should be displayed to the user." (defun muse-colors-underlined () (let ((start (match-beginning 0)) multiline) - (unless (get-text-property start 'invisible) + (unless (eq (get-text-property start 'invisible) 'muse) ;; beginning of line or space or symbol (when (or (= start (point-min)) (memq (char-syntax (char-before start)) '(?\ ?\-)) @@ -242,11 +242,11 @@ whether progress messages should be displayed to the user." ;; or no '_' at end (unless (or (eq (char-before (point)) ?\ ) (not (eq (char-after (point)) ?_))) - (add-text-properties start (1+ start) '(invisible t)) + (add-text-properties start (1+ start) '(invisible muse)) (add-text-properties (1+ start) (point) '(face underline)) (add-text-properties (point) (min (1+ (point)) (point-max)) - '(invisible t)) + '(invisible muse)) (when multiline (add-text-properties start (min (1+ (point)) (point-max)) @@ -326,6 +326,7 @@ affect the match data results." (defvar font-lock-multiline nil)) (defun muse-use-font-lock () + (muse-add-to-invisibility-spec 'muse) (set (make-local-variable 'font-lock-multiline) 'undecided) (set (make-local-variable 'font-lock-defaults) `(nil t nil nil 'beginning-of-line @@ -504,7 +505,7 @@ Functions should not modify the contents of the buffer." (append (if face (list 'face face 'rear-nonsticky t muse-keymap-property muse-mode-local-map) - (list 'invisible t 'intangible t 'rear-nonsticky t + (list 'invisible 'muse 'intangible t 'rear-nonsticky t muse-keymap-property muse-mode-local-map)) (list 'mouse-face 'highlight 'help-echo help-str diff --git a/lisp/muse.el b/lisp/muse.el index f0d04dd..497416f 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -189,6 +189,17 @@ Other ARGS are ignored." (setq text (replace-match replacement nil t text))) text))) +(defun muse-add-to-invisibility-spec (element) + "Add ELEMENT to `buffer-invisibility-spec'. +See documentation for `buffer-invisibility-spec' for the kind of elements +that can be added." + (if (fboundp 'add-to-invisibility-spec) + (add-to-invisibility-spec element) + (if (eq buffer-invisibility-spec t) + (setq buffer-invisibility-spec (list t))) + (setq buffer-invisibility-spec + (cons element buffer-invisibility-spec)))) + (provide 'muse) ;;; muse.el ends here -- 2.11.4.GIT