[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 67fbc7f 114/433: (mmm-match-region, mmm-ify): Caught error
From: |
Dmitry Gutov |
Subject: |
[elpa] master 67fbc7f 114/433: (mmm-match-region, mmm-ify): Caught errors from :match-submode. |
Date: |
Thu, 15 Mar 2018 19:43:46 -0400 (EDT) |
branch: master
commit 67fbc7ffe27bb74b942d67a6c4e5f519714d1895
Author: mas <mas>
Commit: mas <mas>
(mmm-match-region, mmm-ify): Caught errors from :match-submode.
---
mmm-class.el | 41 +++++++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/mmm-class.el b/mmm-class.el
index c54e9c0..00221bb 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.7 2000/07/11 02:38:08 mas Exp $
+;; Version: $Id: mmm-class.el,v 1.8 2000/07/21 00:51:40 mas Exp $
;;{{{ GPL
@@ -138,23 +138,29 @@ the rest of the arguments are for an actual class being
applied. See
(t
(mmm-save-all
(goto-char start)
- (loop for (beg end front-form back-form matched-submode) =
+ (loop for (beg end matched-front matched-back matched-submode) =
(apply #'mmm-match-region :start (point)
- (mmm-save-keywords front back stop
- save-matches front-offset back-offset front-verify
- back-verify front-form back-form match-submode))
+ (mmm-save-keywords
+ front back stop save-matches front-offset
+ back-offset front-verify back-verify front-form
+ back-form match-submode))
while beg
- while (/= beg end) ; Sanity check
- do
+ while (or (not end) (/= beg end)) ; Sanity check
+ if end do ; match-submode, if present, succeeded.
(condition-case nil
(mmm-make-region
(or matched-submode submode) beg end
- :face face :front front-form :back back-form
+ :front matched-front :back matched-back
:beg-sticky beg-sticky :end-sticky end-sticky
- :creation-hook creation-hook)
+ :face face :creation-hook creation-hook)
;; If our region is invalid, go back to the end of the front
;; match and continue on.
- (mmm-invalid-parent (goto-char (- beg front-offset)))))))))
+ (mmm-invalid-parent (goto-char (- beg front-offset))))
+ else do
+ ;; If match-submode was unable to find a match, go back
+ ;; to the end of the front match and continue on.
+ (goto-char (- beg front-offset))
+ )))))
;;}}}
;;{{{ Match Regions
@@ -163,14 +169,21 @@ the rest of the arguments are for an actual class being
applied. See
(&key front back start stop front-verify back-verify front-offset
back-offset save-matches front-form back-form match-submode)
"Find the first valid region between point and STOP.
-Return \(BEG END FRONT-FORM BACK-FORM SUBMODE) specifying the
-region. See `mmm-match-and-verify' for the valid values of FRONT and
-BACK \(markers, regexps, or functions)."
+Return \(BEG END FRONT-FORM BACK-FORM SUBMODE) 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."
(when (mmm-match-and-verify front start stop front-verify)
(let* ((beg (+ (match-end 0) front-offset))
(front-form (mmm-get-form front-form))
(submode (if match-submode
- (mmm-save-all (funcall match-submode front-form))
+ (condition-case nil
+ (mmm-save-all
+ (funcall match-submode front-form))
+ (mmm-no-matching-submode
+ (return-from
+ mmm-match-region
+ (values beg nil nil nil nil))))
nil)))
(when (mmm-match-and-verify (mmm-format-matches back save-matches)
beg stop back-verify)
- [elpa] master 447eb61 110/433: Wrote about changing key bindings and local variables., (continued)
- [elpa] master 447eb61 110/433: Wrote about changing key bindings and local variables., Dmitry Gutov, 2018/03/15
- [elpa] master d504cd7 134/433: (mmm-ify-by-class): Added completion on autoloaded classes. Excluded, Dmitry Gutov, 2018/03/15
- [elpa] master bb60f11 001/433: Initial revision, Dmitry Gutov, 2018/03/15
- [elpa] master da57a75 151/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master b59c78e 086/433: (mmm-update-mode-info): Used `mmm-make-temp-buffer'. Put font-lock, Dmitry Gutov, 2018/03/15
- [elpa] master 3c3042d 093/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master d367aa7 098/433: Added `version.texi' to step 3., Dmitry Gutov, 2018/03/15
- [elpa] master 9a94c1f 097/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master a64bc70 104/433: Added comment about `mmm-global-mode'., Dmitry Gutov, 2018/03/15
- [elpa] master e947f88 107/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master 67fbc7f 114/433: (mmm-match-region, mmm-ify): Caught errors from :match-submode.,
Dmitry Gutov <=
- [elpa] master 699645a 112/433: Allowed here-documents in any mode with :match-submode., Dmitry Gutov, 2018/03/15
- [elpa] master a2d04ab 128/433: # Removed another duplicate entry, Dmitry Gutov, 2018/03/15
- [elpa] master d1ed795 135/433: Added autoloading of submode classes., Dmitry Gutov, 2018/03/15
- [elpa] master 606c79e 132/433: # Updated, Dmitry Gutov, 2018/03/15
- [elpa] master 1834f4b 133/433: (mmm-classes-alist): Updated docstring for new offset values and, Dmitry Gutov, 2018/03/15
- [elpa] master 5b4b568 137/433: (mmm-get-class-spec): Implemented autoloaded submode classes., Dmitry Gutov, 2018/03/15
- [elpa] master 20deb97 138/433: # Updated, Dmitry Gutov, 2018/03/15
- [elpa] master ff7d773 136/433: (mmm-add-group): Made subclasses of a group private., Dmitry Gutov, 2018/03/15
- [elpa] master a9c086a 130/433: (mmm-ify, mmm-match-region, mmm-match->point): Added new values for, Dmitry Gutov, 2018/03/15
- [elpa] master 369d7e3 144/433: (mmm-ensure-fboundp): Created function., Dmitry Gutov, 2018/03/15