From 16fd2a4290b69dab0ed465ad710d184949411464 Mon Sep 17 00:00:00 2001 From: "Michael W. Olson" Date: Tue, 14 Aug 2007 22:28:15 -0400 Subject: [PATCH] Deal with nested tag, font-locking, and comment or directive edge case * lisp/muse.el (muse-goto-tag-end): Deal with case where we are font-locking and the end or beginning of a tag is in a comment or directive. --- ChangeLog | 4 ++++ lisp/muse.el | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c1a70c..b97a7b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,10 @@ muse-list-edit-minor-mode. (Development): Mention the MuseDevlopment page on emacswiki.org. + * lisp/muse.el (muse-goto-tag-end): Deal with case where we are + font-locking and the end or beginning of a tag is in a comment or + directive. + 2007-08-12 Michael Olson * lisp/muse-html.el (muse-html-strip-links): New function that diff --git a/lisp/muse.el b/lisp/muse.el index a079176..9fbfd18 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -839,9 +839,13 @@ may be nested inside of this tag, and skip past them." (match-found nil)) (while (and (> nesting 0) (setq match-found (re-search-forward tag-regexp nil t))) - (if (string-equal (match-string 2) "/") - (setq nesting (1- nesting)) - (setq nesting (1+ nesting)))) + ;; for the sake of font-locking code, skip matches in + ;; directives or comments + (unless (get-text-property (match-beginning 0) + 'muse-directive-or-comment) + (if (string-equal (match-string 2) "/") + (setq nesting (1- nesting)) + (setq nesting (1+ nesting))))) match-found))) ;;; muse.el ends here -- 2.11.4.GIT