From: Glenn Morris Date: Wed, 27 Nov 2013 08:21:19 +0000 (-0800) Subject: Make bootstrap without generated uni-*.el files possible again X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~675 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20372d0c8914f0aafd6cd52a69356e93fbb09d09;p=emacs.git Make bootstrap without generated uni-*.el files possible again * lisp/loadup.el: Update command-line-args checking for unidata-gen. Add vc to load-path to allow loading vc-bzr when writing uni-*.el. * lisp/composite.el, lisp/international/characters.el: Handle unicode tables being undefined. * lisp/composite.el: Add (rough) FSF copyright years. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba680e2dc0a..50f587d1126 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2013-11-27 Glenn Morris + Make bootstrap without generated uni-*.el files possible again. + * loadup.el: Update command-line-args checking for unidata-gen. + Add vc to load-path to allow loading vc-bzr when writing uni-*.el. + * composite.el, international/characters.el: + Handle unicode tables being undefined. + Move ja-dic, quail, leim-list.el from ../leim to a leim subdirectory. * Makefile.in (setwins_for_subdirs): Skip leim/ directory. (compile-main): Depend on leim rule. diff --git a/lisp/composite.el b/lisp/composite.el index f2f4437cadb..7cf35c2af68 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -1,5 +1,7 @@ ;;; composite.el --- support character composition +;; Copyright (C) 2001-2013 Free Software Foundation, Inc. + ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ;; 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -669,13 +671,15 @@ All non-spacing characters have this function in (setq i (1+ i)))) gstring)))))) -(let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic] - [nil 0 compose-gstring-for-graphic]))) - (map-char-table - #'(lambda (key val) - (if (memq val '(Mn Mc Me)) - (set-char-table-range composition-function-table key elt))) - unicode-category-table)) +;; Allow for bootstrapping without uni-*.el. +(when unicode-category-table + (let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic] + [nil 0 compose-gstring-for-graphic]))) + (map-char-table + #'(lambda (key val) + (if (memq val '(Mn Mc Me)) + (set-char-table-range composition-function-table key elt))) + unicode-category-table))) (defun compose-gstring-for-terminal (gstring) "Compose glyph-string GSTRING for terminal display. diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 2195308737c..7632650b7f7 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -484,13 +484,16 @@ with L, LRE, or LRO Unicode bidi character type.") ;; Bidi categories -(map-char-table (lambda (key val) - (cond - ((memq val '(R AL RLO RLE)) - (modify-category-entry key ?R)) - ((memq val '(L LRE LRO)) - (modify-category-entry key ?L)))) - (unicode-property-table-internal 'bidi-class)) +;; If bootstrapping without generated uni-*.el files, table not defined. +(let ((table (unicode-property-table-internal 'bidi-class))) + (when table + (map-char-table (lambda (key val) + (cond + ((memq val '(R AL RLO RLE)) + (modify-category-entry key ?R)) + ((memq val '(L LRE LRO)) + (modify-category-entry key ?L)))) + table))) ;; Latin @@ -1332,15 +1335,15 @@ Setup char-width-table appropriate for non-CJK language environment." ;;; Setting unicode-category-table. -(setq unicode-category-table - (unicode-property-table-internal 'general-category)) -(map-char-table #'(lambda (key val) - (if (and val - (or (and (/= (aref (symbol-name val) 0) ?M) - (/= (aref (symbol-name val) 0) ?C)) - (eq val 'Zs))) - (modify-category-entry key ?.))) - unicode-category-table) +(when (setq unicode-category-table + (unicode-property-table-internal 'general-category)) + (map-char-table #'(lambda (key val) + (if (and val + (or (and (/= (aref (symbol-name val) 0) ?M) + (/= (aref (symbol-name val) 0) ?C)) + (eq val 'Zs))) + (modify-category-entry key ?.))) + unicode-category-table)) (optimize-char-table (standard-category-table)) @@ -1426,23 +1429,24 @@ This function updates the char-table `glyphless-char-display'." (glyphless-set-char-table-range glyphless-char-display #x80 #x9F method)) ((eq target 'format-control) - (map-char-table - #'(lambda (char category) - (if (eq category 'Cf) - (let ((this-method method) - from to) - (if (consp char) - (setq from (car char) to (cdr char)) - (setq from char to char)) - (while (<= from to) - (when (/= from #xAD) - (if (eq method 'acronym) - (setq this-method - (aref char-acronym-table from))) - (set-char-table-range glyphless-char-display - from this-method)) - (setq from (1+ from)))))) - unicode-category-table)) + (when unicode-category-table + (map-char-table + #'(lambda (char category) + (if (eq category 'Cf) + (let ((this-method method) + from to) + (if (consp char) + (setq from (car char) to (cdr char)) + (setq from char to char)) + (while (<= from to) + (when (/= from #xAD) + (if (eq method 'acronym) + (setq this-method + (aref char-acronym-table from))) + (set-char-table-range glyphless-char-display + from this-method)) + (setq from (1+ from)))))) + unicode-category-table))) ((eq target 'no-font) (set-char-table-extra-slot glyphless-char-display 0 method)) (t diff --git a/lisp/loadup.el b/lisp/loadup.el index dc284803c57..d31f02a39ad 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -51,8 +51,9 @@ ;; in deciding whether to modify it. (if (or (equal (nth 3 command-line-args) "bootstrap") (equal (nth 4 command-line-args) "bootstrap") - (equal (nth 3 command-line-args) "unidata-gen.el") - (equal (nth 4 command-line-args) "unidata-gen-files") + ;; FIXME this is irritatingly fragile. + (equal (nth 4 command-line-args) "unidata-gen.el") + (equal (nth 7 command-line-args) "unidata-gen-files") ;; In case CANNOT_DUMP. (string-match "src/bootstrap-emacs" (nth 0 command-line-args))) (let ((dir (car load-path))) @@ -62,7 +63,8 @@ (expand-file-name "emacs-lisp" dir) (expand-file-name "language" dir) (expand-file-name "international" dir) - (expand-file-name "textmodes" dir))))) + (expand-file-name "textmodes" dir) + (expand-file-name "vc" dir))))) (if (eq t purify-flag) ;; Hash consing saved around 11% of pure space in my tests.