changeset 5893:d3d073aceaea

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 18 Apr 2015 23:10:40 +0100
parents 053ef01b71a8 (diff) a0e751d6c3ad (current diff)
children 23178aa71f8b
files tests/ChangeLog tests/automated/lisp-tests.el
diffstat 5 files changed, 38 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Apr 18 23:00:14 2015 +0100
+++ b/lisp/ChangeLog	Sat Apr 18 23:10:40 2015 +0100
@@ -1,3 +1,17 @@
+2015-04-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule/mule-cmds.el (set-locale-for-language-environment):
+	Bind `position' as a local variable here, as was the original
+	intention.
+
+2015-04-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el:
+	* cl-macs.el (check-type):
+	Correct the sense of the type test here when PLACE is not
+	setf'able, something which gave confusing errors with literal
+	fixnums or, e.g., (+ 30 40).
+
 2015-04-04  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* gutter-items.el (append-progress-feedback):
--- a/lisp/cl-macs.el	Sat Apr 18 23:00:14 2015 +0100
+++ b/lisp/cl-macs.el	Sat Apr 18 23:10:40 2015 +0100
@@ -3034,8 +3034,10 @@
 	       (condition-case nil
 		   `(while (not ,test)
 		     ,(macroexpand `(setf ,place ,signal-error)))
+                 ;; Common Lisp requires that PLACE be setfable, but this is
+                 ;; never a restriction that this package has enforced.
 		 (error
-		  `(if ,test (progn ,signal-error nil))))))
+		  `(if (not ,test) (progn ,signal-error nil))))))
 	 (if (eq temp place) `(progn ,body nil)
 	   `(let ((,temp ,place)) ,body nil)))))
 
--- a/lisp/mule/mule-cmds.el	Sat Apr 18 23:00:14 2015 +0100
+++ b/lisp/mule/mule-cmds.el	Sat Apr 18 23:10:40 2015 +0100
@@ -1263,7 +1263,8 @@
                          (error nil))
                    (return msloc))))))))
     (if (eq system-type 'windows-nt)
-	(let ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv)))
+	(let* ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv))
+               (position (position ?_ (cdr ms-locale))))
 	  (when ms-locale
 	    ;; also need to set the clib locale.
 	    (or (set-current-locale
@@ -1285,7 +1286,7 @@
 		 ;; assume it's DEFAULT or NEUTRAL (or something else
 		 ;; without the language in it?) and prepend the
 		 ;; language.
-		 (if (setq position (position ?_ (cdr ms-locale)))
+		 (if position
                      (substitute ?\  ?_
                                  (substitute ?- ?_ (cdr ms-locale)
                                              :end (1+ position)))
--- a/tests/ChangeLog	Sat Apr 18 23:00:14 2015 +0100
+++ b/tests/ChangeLog	Sat Apr 18 23:10:40 2015 +0100
@@ -1,3 +1,8 @@
+2015-04-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el:
+	Check for a bug just fixed in cl-macs.el.
+
 2015-04-18  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/lisp-tests.el:
--- a/tests/automated/lisp-tests.el	Sat Apr 18 23:00:14 2015 +0100
+++ b/tests/automated/lisp-tests.el	Sat Apr 18 23:10:40 2015 +0100
@@ -3825,4 +3825,17 @@
 
 ;; No way to check from Lisp whether the data was actually nulled.
 
+;; Check that a bug in #'check-type with non-setfable PLACE (something not
+;; actually specified by Common Lisp) has been fixed.
+(Assert (prog1 t (check-type 300 fixnum))
+        "checking #'check-type OK, fixnum literal PLACE")
+(Check-Error wrong-type-argument
+             (check-type 300 (integer -1 100))
+             "checking #'check-type errors properly on fixnum literal PLACE")
+(Assert (prog1 t (check-type (+ 100 200) fixnum))
+        "checking #'check-type OK, non-setfable PLACE")
+(Check-Error wrong-type-argument
+             (check-type (+ 600 1000) (integer 0 20))
+             "checking #'check-type errors properly, non-setfable PLACE")
+
 ;;; end of lisp-tests.el