Commits

Anonymous committed f9f3c7b

Don't assume multiple values are lists, mmm-class.el

ChangeLog addition:

2010-02-07 Aidan Kehoe <kehoea@parhasard.net>

* mmm-class.el: Add compiler magic so code using multiple values
compiled on 21.4 works on 21.5.
(mmm-ify): Call #'multiple-value-bind here instead of assuming
#'values always returns a list; thanks for the bug report, Marcus.

Comments (0)

Files changed (2)

+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mmm-class.el: Add compiler magic so code using multiple values
+	compiled on 21.4 works on 21.5.
+	(mmm-ify): Call #'multiple-value-bind here instead of assuming
+	#'values always returns a list; thanks for the bug report, Marcus.
+
 2009-08-14  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.04 released.
 (require 'mmm-vars)
 (require 'mmm-region)
 
+(eval-when-compile (when (eq 'list (symbol-function 'values))
+                     (define-compiler-macro values (&rest args)
+                       `(list ,@args))
+		     (define-compiler-macro values-list (arg) arg)))
+
 ;;; CLASS SPECIFICATIONS
 ;;{{{ Get Class Specifications
 
    (t
     (mmm-save-all
      (goto-char start)
-     (loop for (beg end front-pos back-pos matched-front matched-back
-                    matched-submode matched-face matched-name
-                    invalid-resume ok-resume) =
-                    (apply #'mmm-match-region :start (point) all)
-           while beg
-           if end	       ; match-submode, if present, succeeded.
-           do
-           (condition-case nil
-               (progn
-                 (mmm-make-region
-		  (or matched-submode submode) beg end
-		  :face (or matched-face face)
-		  :front front-pos :back back-pos
-		  :evaporation 'front
-		  :match-front matched-front :match-back matched-back
-		  :beg-sticky beg-sticky :end-sticky end-sticky
-		  :name matched-name
-		  :delimiter-mode delimiter-mode
-		  :front-face front-face :back-face back-face
-		  :creation-hook creation-hook
-		  )
-		 (goto-char ok-resume))
-             ;; If our region is invalid, go back to the end of the
-             ;; front match and continue on.
-             (mmm-error (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 invalid-resume)
-           )))))
+     (multiple-value-bind
+         (beg end front-pos back-pos matched-front matched-back
+              matched-submode matched-face matched-name invalid-resume
+              ok-resume)
+         (apply #'mmm-match-region :start (point) all)
+       (loop
+         while beg
+         if end	       ; match-submode, if present, succeeded.
+         do
+         (condition-case nil
+             (progn
+               (mmm-make-region
+                (or matched-submode submode) beg end
+                :face (or matched-face face)
+                :front front-pos :back back-pos
+                :evaporation 'front
+                :match-front matched-front :match-back matched-back
+                :beg-sticky beg-sticky :end-sticky end-sticky
+                :name matched-name
+                :delimiter-mode delimiter-mode
+                :front-face front-face :back-face back-face
+                :creation-hook creation-hook
+                )
+               (goto-char ok-resume))
+           ;; If our region is invalid, go back to the end of the
+           ;; front match and continue on.
+           (mmm-error (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 invalid-resume)))))))
 
 ;;}}}
 ;;{{{ Match Regions