Hi Marcus,
This is necessary for mmm-mode to work in XEmacs with C-level multiple-value
support, something I hope to commit soon. See
http://mid.gmane.org/19073.42189.496305.702986@parhasard.net .
Best,
Aidan
xemacs-packages/mmm-mode/ChangeLog addition:
2009-08-13 Aidan Kehoe <kehoea(a)parhasard.net>
* mmm-cmds.el:
* mmm-cmds.el (mmm-destructuring-bind): New.
Macro that corresponds to `destructuring-bind', but that does not
error if the structures do not match.
* mmm-cmds.el (mmm-insert-by-key):
Use it, instead of `multiple-value-bind', to avoid unwanted
interactions with actual working multiple-value implementations.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/mmm-mode/mmm-cmds.el
Index: xemacs-packages/mmm-mode/mmm-cmds.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/mmm-mode/mmm-cmds.el,v
retrieving revision 1.3
diff -u -r1.3 mmm-cmds.el
--- xemacs-packages/mmm-mode/mmm-cmds.el 2008/12/22 14:02:24 1.3
+++ xemacs-packages/mmm-mode/mmm-cmds.el 2009/08/13 16:25:57
@@ -42,6 +42,10 @@
"Execute `body'."
`(progn ,@body))))
+(defmacro mmm-destructuring-bind (args expr &rest body)
+ "Like `destructuring-bind', but don't error if ARGS don't fit
EXPR."
+ `(loop for ,args = ,expr return (progn ,@body)))
+
;; APPLYING CLASSES
;;{{{ Applying Predefined Classes
@@ -272,7 +276,7 @@
symbols such as shift, control, etc. and BASIC-KEY is a character code
or a symbol such as tab, return, etc. Note that if there are no
MODIFIERS, the dotted list becomes simply BASIC-KEY."
- (multiple-value-bind (class skel str) (mmm-get-insertion-spec key)
+ (mmm-destructuring-bind (class skel str) (mmm-get-insertion-spec key)
(when skel
(let ((after-change-functions nil)
(old-undo buffer-undo-list) undo)
@@ -280,7 +284,7 @@
;; have to do it.
(if mmm-xemacs (setq skeleton-positions nil))
(skeleton-proxy-new skel str arg)
- (destructuring-bind (back end beg front) skeleton-positions
+ (mmm-destructuring-bind (back end beg front) skeleton-positions
;; TODO: Find a way to trap invalid-parent signals from
;; make-region and undo the skeleton insertion.
(let ((match-submode (plist-get class :match-submode))
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches