Skip to content

Commit

Permalink
Beta 2.09
Browse files Browse the repository at this point in the history
  • Loading branch information
lborgman committed Oct 17, 2011
1 parent 9806e9b commit 4707107
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 54 deletions.
12 changes: 12 additions & 0 deletions nxhtml/nxhtml-mumamo.el
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ See also `mumamo-alt-php-tags-mode'."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'nxhtml-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)
;;(define-fictive-validation-header-toggle nxhtml-mumamo-mode t)
Expand All @@ -86,6 +87,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;###autoload
Expand All @@ -101,6 +103,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;###autoload
Expand All @@ -125,6 +128,7 @@ This covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'mason-nxhtml-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)
;;(mumamo-inherit-sub-chunk-family-locally 'mason-nxhtml-mumamo-mode 'mason-nxhtml-mumamo-mode)
Expand Down Expand Up @@ -169,6 +173,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -210,6 +215,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -223,6 +229,7 @@ This also covers inlined style and javascript."
(mumamo-chunk-xml-pi
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
;;mumamo-chunk-inlined-style
;;mumamo-chunk-inlined-script
mumamo-chunk-smarty-literal
Expand All @@ -244,6 +251,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -260,6 +268,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -277,6 +286,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -292,6 +302,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -329,6 +340,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;; Fix-me: This caused mumamo to loop during fontification since
Expand Down
80 changes: 27 additions & 53 deletions related/tt-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,51 +40,30 @@
"\\)\\b"))

(defvar tt-font-lock-keywords
(list
;; Fontify [& ... &] expressions
'("\\(\\[%[-+]?\\)\\(\\(.\\|\n\\)+?\\)\\([-+]?%\\]\\)"
(1 font-lock-string-face t)
(2 font-lock-variable-name-face t)
(4 font-lock-string-face t))
;; Look for keywords within those expressions
;;
;; Comment out whole directive tag
'("\\[%\\(#.*?\\)%\\]"
(1 font-lock-comment-face t))
;; Comments to end of line
;;; '("\\[%\\(?:.\\|\n\\)*\\(#.*\\)"
;;; (1 font-lock-comment-face t))
'("\\[% *\\([a-z_0-9]*\\) *%\\]"
(1 font-lock-constant-face t))
(list (concat
"\\(\\[%[-+]?\\|;\\)[ \n\t]*\\("
tt-keywords
"\\)")
2 font-lock-keyword-face t)
)
(list
;; Fontify [& ... &] expressions
'("\\(\\[%[-+]?\\)\\(\\(.\\|\n\\)+?\\)\\([-+]?%\\]\\)"
(1 font-lock-string-face t)
(2 font-lock-variable-name-face t)
(4 font-lock-string-face t))
;; Look for keywords within those expressions
;;
;; Comment out whole directive tag
'("\\[%\\(#.*?\\)%\\]"
(1 font-lock-comment-face t))
;; Comments to end of line
;; '("\\[%\\(?:.\\|\n\\)*\\(#.*\\)"
;; (1 font-lock-comment-face t))
'("\\[% *\\([a-z_0-9]*\\) *%\\]"
(1 font-lock-constant-face t))
(list (concat
"\\(\\[%[-+]?\\|;\\)[ \n\t]*\\("
tt-keywords
"\\)")
2 font-lock-keyword-face t)
)
"Expressions to font-lock in tt-mode.")

;; (defvar tt-font-lock-keywords
;; ;; Since this is used in a multi major mode we
;; (list
;; ;; Fontify [& ... &] expressions
;; ;;; '("^\\([-+]?\\)\\(\\(.\\|\n\\)+?\\)\\([-+]?\\)$"
;; ;;; (1 font-lock-string-face t)
;; ;;; (2 font-lock-variable-name-face t)
;; ;;; (4 font-lock-string-face t))
;; '("\\(#.*\\)$"
;; (1 font-lock-comment-face t))
;; '("^ *\\([a-z_0-9]*\\) *$"
;; (1 font-lock-constant-face t))
;; (list (concat
;; "^\\(?:[-+]?\\|;\\)[ \n\t]*\\("
;; tt-keywords
;; "\\)")
;; )
;; 1 font-lock-keyword-face t)
;; )
;; "Expressions to font-lock in tt-mode.")

(defvar tt-font-lock-defaults
'(tt-font-lock-keywords nil t))

Expand All @@ -94,23 +73,18 @@
(let* ((here (point))
(beg-is-ml (get-text-property beg 'font-lock-multiline))
tt-beg
tt-end
)
tt-end)
(when beg-is-ml
(let ((beg-ok (not (previous-single-property-change
here 'font-lock-multiline
nil (- here 1))))
)
nil (- here 1)))))
(when beg-ok
(goto-char beg)
(search-forward "%]" end t)
)
(search-forward "[%" end t)
))
(search-forward "%]" end t))
(search-forward "[%" end t)))
(when tt-end
(remove-list-of-text-properties here tt-beg '(font-lock-multiline))
(set-text-properties tt-beg tt-end '(font-lock-multiline t))))
)
(set-text-properties tt-beg tt-end '(font-lock-multiline t)))))


;;;###autoload
Expand Down
5 changes: 5 additions & 0 deletions util/mumamo-chunks.el
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ See `mumamo-possible-chunk-forward' for POS and MAX."
(mumamo-chunk-attr= pos max mumamo-onjs=-attr= t mumamo-onjs=-attr-regex
'javascript-mode))

;;;; href=\"javascript:"
(defun mumamo-chunk-hrefjs=(pos max)
"Find href=\"javascript:...\". Return range and 'javascript-mode."
(mumamo-quick-chunk-forward pos max "href=\"javascript:" "\"" 'borders 'javascript-mode))

;;;; py:somthing=\"python\"

(defconst mumamo-py:=-attr= "py:[a-z]+=")
Expand Down
15 changes: 15 additions & 0 deletions util/mumamo-fun.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ This covers inlined style and javascript and PHP."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'html-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)
(mumamo-inherit-sub-chunk-family 'html-mumamo-mode)
Expand All @@ -96,6 +97,7 @@ See also `mumamo-alt-php-tags-mode'."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'nxml-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)

Expand Down Expand Up @@ -126,6 +128,7 @@ This covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'mason-html-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)
(mumamo-inherit-sub-chunk-family-locally 'mason-html-mumamo-mode 'mason-html-mumamo-mode)
Expand All @@ -146,6 +149,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand All @@ -165,6 +169,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand All @@ -186,6 +191,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -203,6 +209,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand All @@ -217,6 +224,7 @@ This also covers inlined style and javascript."
(mumamo-chunk-xml-pi
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
;;mumamo-chunk-inlined-style
;;mumamo-chunk-inlined-script
mumamo-chunk-smarty-literal
Expand Down Expand Up @@ -246,6 +254,7 @@ This covers inlined style and javascript."
mumamo-chunk-ssjs-%
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(add-hook 'html-mumamo-mode-hook 'mumamo-define-html-file-wide-keys)
(mumamo-inherit-sub-chunk-family 'ssjs-html-mumamo-mode)
Expand All @@ -263,6 +272,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -279,6 +289,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand Down Expand Up @@ -319,6 +330,7 @@ information about <%% ... %%>, % and %%."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))

;;;###autoload
Expand Down Expand Up @@ -461,6 +473,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand All @@ -477,6 +490,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))


Expand Down Expand Up @@ -533,6 +547,7 @@ This also covers inlined style and javascript."
mumamo-chunk-inlined-script
mumamo-chunk-style=
mumamo-chunk-onjs=
mumamo-chunk-hrefjs=
)))
(mumamo-inherit-sub-chunk-family-locally 'mako-html-mumamo-mode 'mako-html-mumamo-mode)

Expand Down
10 changes: 9 additions & 1 deletion util/mumamo.el
Original file line number Diff line number Diff line change
Expand Up @@ -4021,9 +4021,17 @@ CHUNK-END-FUN should return the end of the chunk.
(setq chunk-major (nth 1 start-rec))
(setq parseable-by (nth 2 start-rec))
(goto-char start)
(when borders-fun
(let ((start-border (when start (unless (and (= 1 start)
(not chunk-major))
start))))
;;(msgtrc "poss-fw: %s %s %s %s" borders-fun start-border end-border chunk-major)
(setq borders (funcall borders-fun start-border nil chunk-major))
(goto-char (nth 0 borders))
))
;; Fix-me: There should mabye be a check here, calling
;; mumamo-end-in-code, but that is a bit of job.
(setq end (when (< start max) (funcall chunk-end-fun start max)))
(setq end (when (< (point) max) (funcall chunk-end-fun (point) max)))
(when borders-fun
(let ((start-border (when start (unless (and (= 1 start)
(not chunk-major))
Expand Down

0 comments on commit 4707107

Please sign in to comment.