CMUCL commit: src (3 files)

Raymond Toy rtoy at common-lisp.net
Sun Apr 18 18:47:37 CEST 2010


    Date: Sunday, April 18, 2010 @ 12:47:37
  Author: rtoy
    Path: /project/cmucl/cvsroot/src

   Added: bootfiles/20a/boot-2010-04-1.lisp
Modified: code/exports.lisp code/intl.lisp

>From Paul Foley.  Translatable strings are recorded only if
*TRANSLATIONS* is non-NIL.

Use boot-2010-04-1 to bootstrap this.

code/intl.lisp:
o Change default for *TRANSLATIONS* to NIL to disable translations. 
o Add TRANSLATION-ENABLE and TRANSLATION-DISABLE.

code/exports.lisp:
o Update exports list for new functions in INTL.
o Remove *TRANSLATABLE-DUMP-STREAM* which no longer exists. 

bootfiles/20a/boot-2010-04-1.lisp:
o New bootstrap file.


-----------------------------------+
 bootfiles/20a/boot-2010-04-1.lisp |    5 +++++
 code/exports.lisp                 |    6 +++---
 code/intl.lisp                    |   20 +++++++++++++++-----
 3 files changed, 23 insertions(+), 8 deletions(-)


Index: src/bootfiles/20a/boot-2010-04-1.lisp
diff -u /dev/null src/bootfiles/20a/boot-2010-04-1.lisp:1.1
--- /dev/null	Sun Apr 18 12:47:37 2010
+++ src/bootfiles/20a/boot-2010-04-1.lisp	Sun Apr 18 12:47:37 2010
@@ -0,0 +1,5 @@
+;; Bootstrap changes to intl, because the build scripts access
+;; functions that don't exist in the previous version of intl.  Just
+;; load the old bootstrap for simplicity instead of just defining the
+;; necessary functions.
+(load "target:bootfiles/20a/boot-2010-02-1")
\ No newline at end of file
Index: src/code/exports.lisp
diff -u src/code/exports.lisp:1.295 src/code/exports.lisp:1.296
--- src/code/exports.lisp:1.295	Wed Apr 14 12:39:51 2010
+++ src/code/exports.lisp	Sun Apr 18 12:47:37 2010
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /project/cmucl/cvsroot/src/code/exports.lisp,v 1.295 2010-04-14 16:39:51 rtoy Exp $")
+  "$Header: /project/cmucl/cvsroot/src/code/exports.lisp,v 1.296 2010-04-18 16:47:37 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -592,9 +592,9 @@
 
 (defpackage "INTL"
   (:use "COMMON-LISP")
-  (:export "*LOCALE-DIRECTORIES*" "*TRANSLATABLE-DUMP-STREAM*" "DGETTEXT" "DNGETTEXT"
+  (:export "*LOCALE-DIRECTORIES*" "DGETTEXT" "DNGETTEXT"
 	   "GETTEXT" "INSTALL" "NGETTEXT" "READ-TRANSLATABLE-STRING" "SETLOCALE"
-	   "TEXTDOMAIN"))
+	   "TEXTDOMAIN" "TRANSLATION-ENABLE" "TRANSLATION-DISABLE"))
 
 (defpackage "LISP"
   (:use "COMMON-LISP" "EXTENSIONS" "KERNEL" "SYSTEM" "DEBUG" "BIGNUM" "INTL")
Index: src/code/intl.lisp
diff -u src/code/intl.lisp:1.3 src/code/intl.lisp:1.4
--- src/code/intl.lisp:1.3	Wed Apr 14 12:39:52 2010
+++ src/code/intl.lisp	Sun Apr 18 12:47:37 2010
@@ -1,6 +1,6 @@
 ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: INTL -*-
 
-;;; $Revision: 1.3 $
+;;; $Revision: 1.4 $
 ;;; Copyright 1999-2010 Paul Foley (mycroft at actrix.gen.nz)
 ;;;
 ;;; Permission is hereby granted, free of charge, to any person obtaining
@@ -23,7 +23,7 @@
 ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 ;;; DAMAGE.
-(ext:file-comment "$Header: /project/cmucl/cvsroot/src/code/intl.lisp,v 1.3 2010-04-14 16:39:52 rtoy Exp $")
+(ext:file-comment "$Header: /project/cmucl/cvsroot/src/code/intl.lisp,v 1.4 2010-04-18 16:47:37 rtoy Exp $")
 
 (in-package "INTL")
 
@@ -558,18 +558,28 @@
 (defvar *translator-comment* nil)
 
 #-runtime
-(defvar *translations* (make-hash-table :test 'equal))
+(defvar *translations* nil)
+
+#-runtime
+(defun translation-enable ()
+  (setq *translations* (or *translations* (make-hash-table :test 'equal)))
+  t)
+
+#-runtime
+(defun translation-disable ()
+  (setq *translations* nil))
 
 #-runtime
 (defun note-translatable (domain string &optional plural)
-  (when domain
+  (when (and domain *translations*)
     (let* ((hash (or (gethash domain *translations*)
 		     (setf (gethash domain *translations*)
 			   (make-hash-table :test 'equal))))
 	   (key (if plural (cons string plural) string))
 	   (val (or (gethash key hash) (cons nil nil))))
       (pushnew *translator-comment* (car val) :test #'equal)
-      (pushnew (enough-namestring *compile-file-truename*) (cdr val) :test #'equal)
+      (pushnew (and *compile-file-truename* (enough-namestring *compile-file-truename*))
+	       (cdr val) :test #'equal)
       ;; FIXME: How does this happen?  Need to figure this out and get
       ;; rid of this!
       (unless key



More information about the cmucl-commit mailing list