From xemacs-m  Sun Sep  7 06:24:12 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id GAA26960
	for <xemacs-beta@xemacs.org>; Sun, 7 Sep 1997 06:24:08 -0500 (CDT)
Received: (from hniksic@localhost)
	by jagor.srce.hr (8.8.7/8.8.6) id NAA07798;
	Sun, 7 Sep 1997 13:24:00 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Problems loading named keyboard macro from a file
References: <199708172221.SAA06236@dolphin.automatrix.com>
X-Attribution: Hrvoje
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 07 Sep 1997 13:24:00 +0200
In-Reply-To: Skip Montanaro's message of "Sun, 17 Aug 1997 18:21:05 -0400 (EDT)"
Message-ID: <kig2031v033.fsf@jagor.srce.hr>
Lines: 75
X-Mailer: Gnus v5.4.63/XEmacs 20.3(beta13) - "Brussels"

Skip Montanaro <skip@calendar.com> writes:

> I defined a keyboard macro, named it using name-last-kbd-macro, inserted it
> into my .emacs file using insert-kbd-macro, then positioned point after the
> defalias that was inserted and tried to evaluate it using eval-last-sexp.  I
> got the following error message for my trouble:
> 
>     ^ must be followed by one character
> 
> I've MIME-attached a file with the macro.  This looks like it might be a bug
> to me.

It's a bug.  Here is the patch.  Please let me know if it fixes your
problem.

1997-09-07  Hrvoje Niksic  <hniksic@srce.hr>

	* utils/edmacro.el (edmacro-parse-word): Accept ^foo (would signal 
	error).
	(edmacro-format-1): Add SPC after ^.

--- lisp/utils/edmacro.el.orig	Sun Sep  7 13:06:55 1997
+++ lisp/utils/edmacro.el	Sun Sep  7 13:19:47 1997
@@ -5,7 +5,7 @@
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;;         Hrvoje Niksic <hniksic@srce.hr>  -- XEmacs port
 ;; Maintainer: Hrvoje Niksic <hniksic@srce.hr>
-;; Version: 3.17
+;; Version: 3.18
 ;; Keywords: abbrev
 
 ;; This file is part of XEmacs.
@@ -535,9 +535,9 @@
 	      (list (cdr abbr)))
 	     ((string-match "^\\^" word)
 	      ;; ^X == C-x
-	      (if (/= (length word) 2)
-		  (error "^ must be followed by one character"))
-	      `((control ,(aref word 1))))
+	      (if (= (length word) 2)
+		  `((control ,(aref word 1)))
+		(mapcar 'identity word)))
 	     ((string-match "^M--?[0-9]+$" word)
 	      ;; Special case: M- followed by an optional hyphen and
 	      ;; one or more digits
@@ -659,10 +659,7 @@
 	(start keys)
 	el)
     (while keys
-      (when (or (eq (car keys) ?-)
-		(eq (car keys) '-)
-		(eq (car keys) ?>)
-		(not (or togetherp (eq start keys))))
+      (when (not (or togetherp (eq start keys)))
 	(callf concat res " "))
       (if (> times 1)
 	  (setq res (concat (format "%d*" times) res)))
@@ -687,6 +684,10 @@
 		   my)))
 	      (t
 	       (cdr (edmacro-conv el t)))))
+      (and (cdr keys)
+	   (or (memq (car keys) '(?- '- ?> ?^))
+	       (not (or togetherp (eq start keys))))
+	   (callf concat res " "))
       (pop keys))
     (if command
 	(callf concat res


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
* Vi is the God of editors.
* Emacs is the editor of Gods.

