changeset 5166:b50624d3ae55

open-database.message
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 26 Mar 2010 15:06:28 +0000
parents 17fe69fff7fa
children be6e5ea38dda
files lisp/ChangeLog lisp/descr-text.el
diffstat 2 files changed, 24 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Mar 23 17:36:18 2010 +0000
+++ b/lisp/ChangeLog	Fri Mar 26 15:06:28 2010 +0000
@@ -1,3 +1,10 @@
+2010-03-26  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* descr-text.el (describe-char-display):
+	Behave better on builds without database support, and for
+	characters where no font is available. Especially relevant on
+	Win32.
+
 2010-03-23  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* x-win-xfree86.el (x-win-init-xfree86):
--- a/lisp/descr-text.el	Tue Mar 23 17:36:18 2010 +0000
+++ b/lisp/descr-text.el	Fri Mar 26 15:06:28 2010 +0000
@@ -257,14 +257,6 @@
 		 file))
 
 ;; XEmacs additions, from here until `describe-char-unicode-data'
-(defcustom describe-char-use-cache t
-  "Whether `describe-char' should use a DBM or Berkeley DB cache.
-This speeds up navigation of `describe-char-unicodedata-file', and makes
-navigation of `describe-char-unihan-file' reasonable."
-  :group 'mule
-  :type '(choice (const :tag "None" nil)
-		 file))
-
 (defcustom describe-char-unihan-file nil
   "Location of Unihan file.
 This the Unihan.txt file from the Unicode Consortium, used for diagnostics.
@@ -290,6 +282,14 @@
       (and (featurep 'berkeley-db) 'berkeley-db))
   "The DB format to use for the `describe-char' cache, or nil if no cache.")
 
+(defcustom describe-char-use-cache (not (null unidata-database-format))
+  "Whether `describe-char' should use a DBM or Berkeley DB cache.
+This speeds up navigation of `describe-char-unicodedata-file', and makes
+navigation of `describe-char-unihan-file' reasonable."
+  :group 'mule
+  :type '(choice (const :tag "None" nil)
+		 file))
+
 (defvar describe-char-unihan-field-descriptions
   #s(hash-table :test equal :data 
                 ("kAccountingNumeric"
@@ -967,14 +967,17 @@
          (ccl (or (and (charset-property charset 'encode-as-utf-8)
                        ccl-encode-to-ucs-2)
                   (charset-property charset 'ccl-program)))
-         (ccl-vector (make-vector 8 0)))
+         (ccl-vector (make-vector 8 0))
+         font-instance)
     (if (display-graphic-p (selected-frame))
         (list
-         (font-instance-name
-          (face-font-instance (or (get-char-property pos 'face)
-                                  'default)
-                              (selected-window)
-                              charset))
+         (if (setq font-instance 
+                   (face-font-instance (or (get-char-property pos 'face)
+                                           'default)
+                                       (selected-window)
+                                       charset))
+             (font-instance-name font-instance)
+           "[no font available]")
          (cond 
           ((and ccl (eq 'x (frame-type frame)))
            (setq char (split-char char))