branch: externals/cm-mode
commit 91f04545ca2ec9f48a05fd3a0da605760b6c24a6
Author: Joost Kremers <[email protected]>
Commit: Joost Kremers <[email protected]>
Hardcode delimiters in cm-{forward|beginning|end}-* functions
The partial delimiters are hardcoded as well, so...
---
cm-mode.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/cm-mode.el b/cm-mode.el
index 5c5f610a82..94ee0c6973 100644
--- a/cm-mode.el
+++ b/cm-mode.el
@@ -211,14 +211,14 @@ If N is negative, move backward."
((> n 0)
(when (looking-at "\\+}")
(backward-char))
- (re-search-forward (third (assoc 'insertion cm-delimiter-regexps)) nil t
n))
+ (re-search-forward "\\+\\+}" nil t n))
(t
(when (and (looking-back "{" (1- (point)))
(looking-at "\\+\\+"))
(forward-char 2))
(when (looking-back "{\\+" (- (point) 2))
(forward-char))
- (re-search-backward (second (assoc 'insertion cm-delimiter-regexps)) nil t
(abs n)))))
+ (re-search-backward "{\\+\\+" nil t (abs n)))))
(defun cm-beginning-insertion ()
"Move to the beginning of an insertion."
@@ -240,14 +240,14 @@ If N is negative, move backward."
((> n 0)
(when (looking-at "-}")
(backward-char))
- (re-search-forward (third (assoc 'deletion cm-delimiter-regexps)) nil t n))
+ (re-search-forward "--}" nil t n))
(t
(when (and (looking-back "{" (1- (point)))
(looking-at "--"))
(forward-char 2))
(when (looking-back "{-" (- (point) 2))
(forward-char))
- (re-search-backward (second (assoc 'deletion cm-delimiter-regexps)) nil t
(abs n)))))
+ (re-search-backward "{--" nil t (abs n)))))
(defun cm-beginning-deletion ()
"Move to the beginning of an deletion."
@@ -269,14 +269,14 @@ If N is negative, move backward."
((> n 0)
(when (looking-at "~}")
(backward-char))
- (re-search-forward (third (assoc 'substitution cm-delimiter-regexps)) nil
t n))
+ (re-search-forward "~~}" nil t n))
(t
(when (and (looking-back "{" (1- (point)))
(looking-at "~~"))
(forward-char 2))
(when (looking-back "{~" (- (point) 2))
(forward-char))
- (re-search-backward (second (assoc 'substitution cm-delimiter-regexps))
nil t (abs n)))))
+ (re-search-backward "{~~" nil t (abs n)))))
(defun cm-beginning-substitution ()
"Move to the beginning of an substitution."
@@ -298,14 +298,14 @@ If N is negative, move backward."
((> n 0)
(when (looking-at "<}")
(backward-char))
- (re-search-forward (third (assoc 'comment cm-delimiter-regexps)) nil t n))
+ (re-search-forward "<<}" nil t n))
(t
(when (and (looking-back "{" (1- (point)))
(looking-at ">>"))
(forward-char 2))
(when (looking-back "{>" (- (point) 2))
(forward-char))
- (re-search-backward (second (assoc 'comment cm-delimiter-regexps)) nil t
(abs n)))))
+ (re-search-backward "{>>" nil t (abs n)))))
(defun cm-beginning-comment ()
"Move to the beginning of an comment."
@@ -325,12 +325,12 @@ If N is negative, move backward."
(or n (setq n 1))
(cond
((> n 0)
- (re-search-forward (third (assoc 'highlight cm-delimiter-regexps)) nil t
n))
+ (re-search-forward "}}" nil t n))
(t
(when (and (looking-back "{" (1- (point)))
(looking-at "{"))
(forward-char))
- (re-search-backward (second (assoc 'highlight cm-delimiter-regexps)) nil t
(abs n)))))
+ (re-search-backward "{{" nil t (abs n)))))
(defun cm-beginning-highlight ()
"Move to the beginning of an highlight."
@@ -344,7 +344,6 @@ If N is negative, move backward."
(put 'cm-highlight 'beginning-op 'cm-beginning-highlight)
(put 'cm-highlight 'end-op 'cm-end-highlight)
-
(provide 'cm-mode)
;;; cm-mode ends here