changeset 4793:8b50bee3c88c

Remove attempted support for 1996-era emacs without self-quoting keywords. lisp/ChangeLog addition: 2009-12-19 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (cl-do-arglist): * cl-compat.el (keyword-of): Remove support in our generated code for emacs versions where keywords are not self-quoting. src/ChangeLog addition: 2009-12-19 Aidan Kehoe <kehoea@parhasard.net> * symbols.c (reject_constant_symbols): Indicate that accepting attempted modification of keywords is a temporary thing.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 19 Dec 2009 18:10:20 +0000
parents e29fcfd8df5f
children 8484c6c76837
files lisp/ChangeLog lisp/cl-compat.el lisp/cl-macs.el src/ChangeLog src/symbols.c
diffstat 5 files changed, 30 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Dec 18 17:49:43 2009 +0000
+++ b/lisp/ChangeLog	Sat Dec 19 18:10:20 2009 +0000
@@ -1,3 +1,10 @@
+2009-12-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (cl-do-arglist):
+	* cl-compat.el (keyword-of): 
+	Remove support in our generated code for emacs versions where
+	keywords are not self-quoting.
+
 2009-12-18  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* alist.el (modify-alist): 
--- a/lisp/cl-compat.el	Fri Dec 18 17:49:43 2009 +0000
+++ b/lisp/cl-compat.el	Sat Dec 19 18:10:20 2009 +0000
@@ -57,7 +57,7 @@
   (list* 'defconst x (list 'quote x) (and doc (list doc))))
 
 (defun keyword-of (sym)
-  (or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
+  (or (keywordp sym) (keywordp (read (format ":%s" sym)))))
 
 ;;; Routines for parsing keyword arguments.
 
--- a/lisp/cl-macs.el	Fri Dec 18 17:49:43 2009 +0000
+++ b/lisp/cl-macs.el	Sat Dec 19 18:10:20 2009 +0000
@@ -440,12 +440,19 @@
 	(while (and args (not (memq (car args) lambda-list-keywords)))
 	  (let ((arg (pop args)))
 	    (or (consp arg) (setq arg (list arg)))
-	    (let* ((karg (if (consp (car arg)) (caar arg)
-			   (intern (format ":%s" (car arg)))))
+	    (let* ((karg (if (consp (car arg))
+			     ;; It's possible to use non-keywords here, as
+			     ;; in the KEYWORD-ARGUMENT-NAME-PACKAGE Common
+			     ;; Lisp issue:
+			     (caar arg)
+			   ;; Use read instead of intern in case we ever
+			   ;; actually get packages and keywords are no
+			   ;; longer in obarray:
+			   (read (concat ":" (symbol-name (car arg))))))
 		   (varg (if (consp (car arg)) (cadar arg) (car arg)))
 		   (def (if (cdr arg) (cadr arg)
 			  (or (car bind-defs) (cadr (assq varg bind-defs)))))
-		   (look (list 'memq (list 'quote karg) restarg)))
+		   (look (list 'memq (quote-maybe karg) restarg)))
 	      (and def bind-enquote (setq def (list 'quote def)))
 	      (if (cddr arg)
 		  (let* ((temp (or (nth 2 arg) (gensym)))
@@ -467,12 +474,7 @@
 					  'quote
 					  (list nil (cl-const-expr-val def)))
 				       (list 'list nil def))))))))
-	      (push karg keys)
-	      ;; XEmacs addition
-	      (if (= (aref (symbol-name karg) 0) ?:)
-		  (progn (set karg karg)
-			 (push (list 'setq karg (list 'quote karg))
-			       bind-inits)))))))
+	      (push karg keys)))))
       (setq keys (nreverse keys))
       (or (and (eq (car args) '&allow-other-keys) (pop args))
 	  (null keys) (= safety 0)
@@ -487,7 +489,7 @@
 				(list 'setq var (list 'cdr (list 'cdr var))))
 			  (list (list 'car
 				      (list 'cdr
-					    (list 'memq (cons 'quote allow)
+					    (list 'memq (car allow)
 						  restarg)))
 				(list 'setq var nil))
 			  (list t
--- a/src/ChangeLog	Fri Dec 18 17:49:43 2009 +0000
+++ b/src/ChangeLog	Sat Dec 19 18:10:20 2009 +0000
@@ -1,3 +1,9 @@
+2009-12-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (reject_constant_symbols): 
+	Indicate that accepting attempted modification of keywords is a
+	temporary thing. 
+
 2009-12-18  Jerry James  <james@xemacs.org>
 
 	* ppc.ldscript: Remove, obsolete.
--- a/src/symbols.c	Fri Dec 18 17:49:43 2009 +0000
+++ b/src/symbols.c	Sat Dec 19 18:10:20 2009 +0000
@@ -600,7 +600,10 @@
 !(unloading_module && UNBOUNDP(newval)) &&
 #endif
       (symbol_is_constant (sym, val)
-       || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym))))
+#ifndef NO_NEED_TO_HANDLE_21_4_CODE
+       || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym))
+#endif
+      ))
     signal_error_1 (Qsetting_constant,
 		    UNBOUNDP (newval) ? list1 (sym) : list2 (sym, newval));
 }