For some unknown reason command-sequence is completely fucked up in
HEAD. The following patch should improve the situation.

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1910
diff -u -p -r1.1910 ChangeLog
--- src/ChangeLog	29 Apr 2004 15:25:55 -0000	1.1910
+++ src/ChangeLog	3 May 2004 16:36:22 -0000
@@ -1,3 +1,8 @@
+2004-05-03  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* lyxfunc.C (dispatch): 
+	(getStatus): fix handling of LFUN_SEQUENCE
+
 2004-04-29  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* debug.C (showLevel): do not forget the end-of-line marker
Index: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.616
diff -u -p -r1.616 lyxfunc.C
--- src/lyxfunc.C	29 Apr 2004 09:54:57 -0000	1.616
+++ src/lyxfunc.C	3 May 2004 16:36:22 -0000
@@ -437,6 +437,14 @@ FuncStatus LyXFunc::getStatus(FuncReques
 		break;
 	}
 
+	// this one is difficult to get right. As a half-baked
+	// solution, we consider only the first action of the sequence
+	case LFUN_SEQUENCE: {
+		// argument contains ';'-terminated commands
+		string const firstcmd = token(cmd.argument, ';', 0);
+		flag = getStatus(lyxaction.lookupFunc(firstcmd));
+	}
+
 	case LFUN_MENUNEW:
 	case LFUN_MENUNEWTMPLT:
 	case LFUN_WORDFINDFORWARD:
@@ -477,7 +485,6 @@ FuncStatus LyXFunc::getStatus(FuncReques
 	case LFUN_REPEAT:
 	case LFUN_EXPORT_CUSTOM:
 	case LFUN_PRINT:
-	case LFUN_SEQUENCE:
 	case LFUN_SAVEPREFERENCES:
 	case LFUN_SCREEN_FONT_UPDATE:
 	case LFUN_SET_COLOR:
@@ -1191,14 +1198,16 @@ void LyXFunc::dispatch(FuncRequest const
 			break;
 		}
 
-		case LFUN_SEQUENCE:
+		case LFUN_SEQUENCE: {
 			// argument contains ';'-terminated commands
-			while (!argument.empty()) {
+			string arg = argument;
+			while (!arg.empty()) {
 				string first;
-				string rest = split(argument, first, ';');
-				dispatch(lyxaction.lookupFunc(rest));
+				arg = split(arg, first, ';');
+				dispatch(lyxaction.lookupFunc(first));
 			}
 			break;
+		}
 
 		case LFUN_SAVEPREFERENCES: {
 			Path p(user_lyxdir());

Reply via email to