branch: externals/cm-mode
commit 5b32f07660fd85621cb3cc900e2e11f104a55148
Merge: f3f6a07780 8a7e091112
Author: John Kitchin <[email protected]>
Commit: John Kitchin <[email protected]>

    Merge branch 'devel' to add nonascii matches.
---
 cm-mode.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/cm-mode.el b/cm-mode.el
index 4ea8080cbf..dc4fdc7e1d 100644
--- a/cm-mode.el
+++ b/cm-mode.el
@@ -98,19 +98,19 @@ The value is actually a list consisting of the text and a 
flag
 indicating whether the deletion was done with the backspace
 key.")
 
-(defvar cm-addition-regexp "\\(?:{\\+\\+[[:ascii:]]*?\\+\\+}\\)"
+(defvar cm-addition-regexp 
"\\(?:{\\+\\+\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\+\\+}\\)"
   "CriticMarkup addition regexp.")
 
-(defvar cm-deletion-regexp "\\(?:{--[[:ascii:]]*?--}\\)"
+(defvar cm-deletion-regexp "\\(?:{--\\([[:ascii:]]\\|[[:nonascii:]]\\)*?--}\\)"
   "CriticMarkup deletion regexp.")
 
-(defvar cm-substitution-regexp "\\(?:{~~[[:ascii:]]*?~>[[:ascii:]]*?~~}\\)"
+(defvar cm-substitution-regexp 
"\\(?:{~~\\([[:ascii:]]\\|[[:nonascii:]]\\)*?~>\\([[:ascii:]]\\|[[:nonascii:]]\\)*?~~}\\)"
   "CriticMarkup substitution regexp.")
 
-(defvar cm-comment-regexp "\\(?:{>>[[:ascii:]]*?<<}\\)"
+(defvar cm-comment-regexp "\\(?:{>>\\([[:ascii:]]\\|[[:nonascii:]]\\)*?<<}\\)"
   "CriticMarkup comment regexp.")
 
-(defvar cm-highlight-regexp "\\(?:{==[[:ascii:]]*?==}\\)"
+(defvar cm-highlight-regexp 
"\\(?:{==\\([[:ascii:]]\\|[[:nonascii:]]\\)*?==}\\)"
   "CriticMarkup highlight regexp.")
 
 (defvar cm-current-markup-overlay nil
@@ -239,7 +239,7 @@ it is added automatically."
     (add-to-list 'font-lock (mapconcat #'(lambda (elt) ; first we create the 
regexp to match
                                            (regexp-opt (list elt) t))
                                        markup
-                                       "[[:ascii:]]*?"))
+                                       "\\([[:ascii:]]\\|[[:nonascii:]]\\)*?"))
     (add-to-list 'font-lock `(0 ,face prepend) t) ; the highlighter for the 
entire change
     (dotimes (n (length markup))
       (add-to-list 'font-lock `(,(1+ n) '(face ,face read-only t)) t) ; make 
the tags read-only
@@ -323,8 +323,8 @@ details."
   (save-excursion
     (goto-char (point-min))
     (let ((delims-regexp (concat (regexp-opt (mapcar #'second cm-delimiters) t)
-                                 "[[:ascii:]]*?"
-                                 "\\(?:\\(~>\\)[[:ascii:]]*?\\)?"
+                                 "\\([[:ascii:]]\\|[[:nonascii:]]\\)*?"
+                                 
"\\(?:\\(~>\\)\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)?"
                                  (regexp-opt (mapcar #'cm-last1 cm-delimiters) 
t)))
           (inhibit-read-only t))
       (while (re-search-forward delims-regexp nil t)
@@ -701,7 +701,7 @@ outside of them. The latter counts as being AT a change."
   (let ((bdelim (regexp-quote (second (assq 'cm-comment cm-delimiters))))
         (edelim (regexp-quote (cm-last1 (assq 'cm-comment cm-delimiters))))
         (text (second change)))
-    (if (string-match (concat bdelim "\\([[:ascii:]]*?\\)" edelim) text)
+    (if (string-match (concat bdelim 
"\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)" edelim) text)
         (match-string 1 text))))
 
 (defun cm-extract-author (change)
@@ -712,7 +712,7 @@ CHANGE. The return value is the author tag without `@', or 
NIL if
 CHANGE has no comment part or a comment without an author."
   (let ((comment (cm-extract-comment change)))
     (if (and comment
-             (string-match "^@\\([^[:space:]]*\\)[[:ascii:]]*?$" comment))
+             (string-match 
"^@\\([^[:space:]]*\\)\\([[:ascii:]]\\|[[:nonascii:]]\\)*?$" comment))
         (match-string 1 comment))))
 
 (defun cm-has-current-author-p (change)
@@ -795,22 +795,22 @@ substitutions, `d' for comments and highlights."
      ((eq type 'cm-addition)
       (if (not action)
           ""
-        (string-match "{\\+\\+\\([[:ascii:]]*?\\)\\+\\+}" text)
+        (string-match 
"{\\+\\+\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)\\+\\+}" text)
         (match-string 1 text)))
      ((eq type 'cm-deletion)
       (if action
           ""
-        (string-match "{--\\([[:ascii:]]*?\\)--}" text)
+        (string-match "{--\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)--}" text)
         (match-string 1 text)))
      ((eq type 'cm-substitution)
-      (string-match "{~~\\([[:ascii:]]*?\\)~>\\([[:ascii:]]*?\\)~~}" text)
+      (string-match 
"{~~\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)~>\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)~~}"
 text)
       (match-string (if action 2 1) text))
      ((and (eq type 'cm-comment)
            (eq action ?d))
       "")
      ((and (eq type 'cm-highlight)
            (eq action ?d))
-      (string-match "{==\\([[:ascii:]]*?\\)==}" text)
+      (string-match "{==\\(\\([[:ascii:]]\\|[[:nonascii:]]\\)*?\\)==}" text)
       (match-string 1 text)))))
 
 (defun cm-accept/reject-all-changes ()

Reply via email to