[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9aa2af2 239/433: * mmm-class.el (mmm-match-region): Fixed
From: |
Dmitry Gutov |
Subject: |
[elpa] master 9aa2af2 239/433: * mmm-class.el (mmm-match-region): Fixed return values bug, so |
Date: |
Thu, 15 Mar 2018 19:44:11 -0400 (EDT) |
branch: master
commit 9aa2af2bd513e81622ff728a74426a5649d25531
Author: viritrilbia <viritrilbia>
Commit: viritrilbia <viritrilbia>
* mmm-class.el (mmm-match-region): Fixed return values bug, so
invalid regions don't interfere with later valid ones.
---
mmm-class.el | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/mmm-class.el b/mmm-class.el
index 024b30d..7e6638c 100644
--- a/mmm-class.el
+++ b/mmm-class.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-class.el,v 1.16 2001/04/26 22:27:36 viritrilbia Exp $
+;; Version: $Id: mmm-class.el,v 1.17 2001/07/05 06:15:11 viritrilbia Exp $
;;{{{ GPL
@@ -159,7 +159,8 @@ the rest of the arguments are for an actual class being
applied. See
(mmm-save-all
(goto-char start)
(loop for (beg end matched-front matched-back
- matched-submode matched-face back-to resume-at) =
+ matched-submode matched-face
+ invalid-resume ok-resume) =
(apply #'mmm-match-region :start (point) all)
while beg
if (and end ; match-submode, if present, succeeded.
@@ -170,13 +171,13 @@ the rest of the arguments are for an actual class being
applied. See
(apply #'mmm-make-region (or matched-submode submode)
beg end :front matched-front :back matched-back
:face (or matched-face face) all)
- (goto-char resume-at))
+ (goto-char ok-resume))
;; If our region is invalid, go back to the end of the
;; front match and continue on.
- (mmm-invalid-parent (goto-char back-to)))
+ (mmm-invalid-parent (goto-char invalid-resume)))
;; If match-submode was unable to find a match, go back to
;; the end of the front match and continue on.
- else do (goto-char back-to)
+ else do (goto-char invalid-resume)
)))))
;;}}}
@@ -189,15 +190,16 @@ the rest of the arguments are for an actual class being
applied. See
front-match back-match end-not-begin
&allow-other-keys)
"Find the first valid region between point and STOP.
-Return \(BEG END FRONT-FORM BACK-FORM SUBMODE FACE BACK-TO) specifying
-the region. See `mmm-match-and-verify' for the valid values of FRONT
-and BACK \(markers, regexps, or functions). A nil value for END means
-that MATCH-SUBMODE failed to find a valid submode. BACK-TO is the
-point at which the search should continue if the region is invalid."
+Return \(BEG END FRONT-FORM BACK-FORM SUBMODE FACE INVALID-RESUME OK-RESUME)
+specifying the region. See `mmm-match-and-verify' for the valid
+values of FRONT and BACK \(markers, regexps, or functions). A nil
+value for END means that MATCH-SUBMODE failed to find a valid submode.
+INVALID-RESUME is the point at which the search should continue if the
+region is invalid, and OK-RESUME if the region is valid."
(when (mmm-match-and-verify front start stop front-verify)
(let ((beg (mmm-match->point include-front front-offset
front-match back-match))
- (back-to (match-end front-match))
+ (invalid-resume (match-end front-match))
(front-form (mmm-get-form front-form)))
(let ((submode (if match-submode
(condition-case nil
@@ -206,7 +208,8 @@ point at which the search should continue if the region is
invalid."
(mmm-no-matching-submode
(return-from
mmm-match-region
- (values nil nil nil nil nil back-to))))
+ (values beg nil nil nil nil nil
+ invalid-resume nil))))
nil))
(face (cond ((functionp match-face)
(mmm-save-all
@@ -221,10 +224,11 @@ point at which the search should continue if the region
is invalid."
(let* ((end (mmm-match->point (not include-back) back-offset
front-match back-match))
(back-form (mmm-get-form back-form))
- (resume-at (if end-not-begin
+ (ok-resume (if end-not-begin
(match-end back-match)
end)))
- (values beg end front-form back-form submode face back-to
resume-at)))))))
+ (values beg end front-form back-form submode face
+ invalid-resume ok-resume)))))))
(defun mmm-match->point (beginp offset front-match back-match)
"Find a point of starting or stopping from the match data. If
- [elpa] master ecf2a75 257/433: Use correct variable name..., (continued)
- [elpa] master ecf2a75 257/433: Use correct variable name..., Dmitry Gutov, 2018/03/15
- [elpa] master cd85acc 266/433: Added file for building SRPMs, thanks to bishop, Dmitry Gutov, 2018/03/15
- [elpa] master 93e7a93 271/433: (mmm-save-local-variables): Add semantic stuff and, Dmitry Gutov, 2018/03/15
- [elpa] master c1a33b7 260/433: (mmm-define-key): Added optional keymap argument, Dmitry Gutov, 2018/03/15
- [elpa] master 821386c 283/433: Ignore .elc files, Dmitry Gutov, 2018/03/15
- [elpa] master 2cb7c99 189/433: Added multiple faces and optional levels of decoration., Dmitry Gutov, 2018/03/15
- [elpa] master 5321422 248/433: Updated docstrings and comments. Added primary mode hook., Dmitry Gutov, 2018/03/15
- [elpa] master 5f82799 276/433: * version.texi: Release 0.4.8., Dmitry Gutov, 2018/03/15
- [elpa] master fe07951 277/433: * mmm-myghty.el: New mode from Ben Bangert., Dmitry Gutov, 2018/03/15
- [elpa] master a71a299 207/433: # Updated, Dmitry Gutov, 2018/03/15
- [elpa] master 9aa2af2 239/433: * mmm-class.el (mmm-match-region): Fixed return values bug, so,
Dmitry Gutov <=
- [elpa] master a98405e 281/433: Make reference to var font-lock-defaults-alist conditional; var is obsolete in Emacs 24., Dmitry Gutov, 2018/03/15
- [elpa] master a7b8c55 296/433: Do syntax highlighting and indentation in ERB buffers, Dmitry Gutov, 2018/03/15
- [elpa] master 37f9a4b 183/433: Released 0.4.6, Dmitry Gutov, 2018/03/15
- [elpa] master 1e46c43 306/433: Fix #8, Dmitry Gutov, 2018/03/15
- [elpa] master ed0b781 310/433: Merge pull request #9 from dgutov/master, Dmitry Gutov, 2018/03/15
- [elpa] master e5fe9e7 261/433: Implemented a 'local to submode class' keymap binding, using a dummy overlay., Dmitry Gutov, 2018/03/15
- [elpa] master 955038c 302/433: Merge remote-tracking branch 'refs/remotes/dgutov/erb', Dmitry Gutov, 2018/03/15
- [elpa] master 7f9dbdb 292/433: Fix `mmm-insert-region' to not abort loop too soon, Dmitry Gutov, 2018/03/15
- [elpa] master 5289a0b 318/433: Save values of more cc-mode variables, Dmitry Gutov, 2018/03/15
- [elpa] master 034df4b 339/433: Revert c548593, for easier optimization, Dmitry Gutov, 2018/03/15