From xemacs-m  Mon Aug 18 05:57:29 1997
Received: from dolphin.automatrix.com (dolphin.automatrix.com [198.69.29.254])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id FAA03080
	for <xemacs-beta@xemacs.org>; Mon, 18 Aug 1997 05:57:28 -0500 (CDT)
Received: (from skip@localhost) by dolphin.automatrix.com (8.8.5/8.8.3) id GAA15617; Mon, 18 Aug 1997 06:57:30 -0400 (EDT)
Date: Mon, 18 Aug 1997 06:57:30 -0400 (EDT)
Message-Id: <199708181057.GAA15617@dolphin.automatrix.com>
From: Skip Montanaro <skip@calendar.com>
To: xemacs-beta@xemacs.org
Subject: Re: Problems loading named keyboard macro from a file
Reply-to: skip@calendar.com (Skip Montanaro)
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/signed; protocol="application/pgp-signature";
 boundary="pgp-sign-Multipart_Mon_Aug_18_06:57:15_1997-1"; micalg=pgp-md5
Content-Transfer-Encoding: 7bit

--pgp-sign-Multipart_Mon_Aug_18_06:57:15_1997-1
Content-Type: text/plain; charset=US-ASCII

Yesterday I wrote:

    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

It looks like there was no way to parse a literal ^ in a defalias.  I tried
putting a backslash in front of it, isolating it, and entering it as \136.
I finally gave up and special-cased the appearance of ^.  If it is all by
itself, it is treated as a literal ^ instead of a control prefix.  Here's a
patch to edmacro.el for parsing.  A fix for dumping them still needs to be
found.  (I haven't looked yet.)

Also, let me know if this is the correct protocol for submitting patches,
as this is my first one (throw me a party, okay?).  The patch below is
against 20.3b16 (Budapest).

1997-08-18  Skip Montanaro  <skip@calendar.com>

	* utils/edmacro.el (edmacro-parse-word): allow parsing of isolated 
	^ characters in macro.

*** edmacro.el~	Sun Jul 13 18:41:55 1997
--- edmacro.el	Mon Aug 18 06:40:40 1997
***************
*** 536,542 ****
  	     ((string-match "^\\^" word)
  	      ;; ^X == C-x
! 	      (if (/= (length word) 2)
! 		  (error "^ must be followed by one character"))
! 	      `((control ,(aref word 1))))
  	     ((string-match "^M--?[0-9]+$" word)
  	      ;; Special case: M- followed by an optional hyphen and
--- 536,544 ----
  	     ((string-match "^\\^" word)
  	      ;; ^X == C-x
! 	      (if (= (length word) 1)
! 		  (mapcar conv-chars word)
! 		(if (/= (length word) 2)
! 		    (error "^ must be followed by one character"))
! 		`((control ,(aref word 1)))))
  	     ((string-match "^M--?[0-9]+$" word)
  	      ;; Special case: M- followed by an optional hyphen and


Skip Montanaro     | Musi-Cal Express - get your own private Musi-Cal
skip@calendar.com  | domain name! http://concerts.calendar.com/express.shtml
(518)372-5583      | WebFast - http://www.webfast.com/

--pgp-sign-Multipart_Mon_Aug_18_06:57:15_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM/gqmB+q0G630cGhAQEp3gP+MrgjjCi0VNhtBjQbcrC4UgGceTW17oB2
HHnwfX1KHoP3kJBe4XgVmcm4Ew00GKqZA4Wv+X/air7UyD2j+sZK2Q3G07FwKat/
/Wgjc1gd++B1B9TFzKW7D9TxSome6PNF5TFGVWQCYXVEC5TgByn6fN0mVdsSYXfo
C9/mEdsuql0=
=4zsJ
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Mon_Aug_18_06:57:15_1997-1--

