changeset 13211:76308c9753ab

(vip-record-kbd-macro): correctly escapes `.' and `[' now.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Sat, 14 Oct 1995 02:25:42 +0000
parents 8453192a1032
children 73b3decace33
files lisp/emulation/viper-macs.el
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/viper-macs.el	Sat Oct 14 02:21:19 1995 +0000
+++ b/lisp/emulation/viper-macs.el	Sat Oct 14 02:25:42 1995 +0000
@@ -395,7 +395,17 @@
 	      (vip-save-string-in-file 
 	       (format "\n(vip-record-kbd-macro %S '%S %s '%S)"
 		       (vip-display-macro macro-name)
-		       state macro-body scope) 
+		       state
+		       ;; if we don't let vector macro-body through %S,
+		       ;; the symbols `\.' `\[' etc will be converted into
+		       ;; characters, causing invalid read  error on recorded
+		       ;; macros in .vip.
+		       ;; I am not sure is macro-body can still be a string at
+		       ;; this point, but I am preserving this option anyway.
+		       (if (vectorp macro-body)
+			   (format "%S" macro-body)
+			 macro-body)
+		       scope) 
 	       vip-custom-file-name))
 	  
 	  (message msg)