changeset 4454:1f0aa40cafe0

Small improvements in disp-table.el, mule/cyril-util.el. 2008-05-11 Aidan Kehoe <kehoea@parhasard.net> * disp-table.el (make-display-table): [...] Also, I previously said #xFF when I meant ?\xFF; correct this. * mule/cyril-util.el (standard-display-cyrillic-translit): Make the selection of the default language more sensible; change the API a little to make a sensible default Cyrillic language available, checking current-language-environment.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 11 May 2008 12:03:07 +0200
parents 29efd169efe7
children 49f8ed034500 a1f8c5c250c2
files lisp/ChangeLog lisp/disp-table.el lisp/mule/cyril-util.el
diffstat 3 files changed, 25 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun May 11 11:24:01 2008 +0200
+++ b/lisp/ChangeLog	Sun May 11 12:03:07 2008 +0200
@@ -2,7 +2,12 @@
 
 	* disp-table.el (make-display-table): 
 	Update the example code to make it more general, and more
-	compatible with GNU.
+	compatible with GNU. Also, I previously said #xFF when I meant
+	?\xFF; correct this.
+	* mule/cyril-util.el (standard-display-cyrillic-translit): 
+	Make the selection of the default language more sensible; change
+	the API a little to make a sensible default Cyrillic language
+	available, checking current-language-environment. 
 
 2007-07-21  Aidan Kehoe  <kehoea@parhasard.net>
 
--- a/lisp/disp-table.el	Sun May 11 11:24:01 2008 +0200
+++ b/lisp/disp-table.el	Sun May 11 12:03:07 2008 +0200
@@ -39,7 +39,7 @@
 
 This returns a generic character table; previously it returned a vector, but
 that was not helpful when dealing with internationalized characters above
-#xFF.  See `make-char-table' for details of character tables in general.  To
+?\xFF.  See `make-char-table' for details of character tables in general.  To
 write code that works with both vectors and character tables, add something
 like the following to the beginning of your file, and use
 `put-display-table' to set what a given character is displayed as, and
--- a/lisp/mule/cyril-util.el	Sun May 11 11:24:01 2008 +0200
+++ b/lisp/mule/cyril-util.el	Sun May 11 12:03:07 2008 +0200
@@ -43,7 +43,8 @@
       "*List of known Cyrillic languages")
 
 ;;;###autoload
-(defun standard-display-cyrillic-translit (&optional cyrillic-language)
+(defun standard-display-cyrillic-translit (&optional cyrillic-language
+					   disable)
   "Display a cyrillic buffer using a transliteration.
 For readability, the table is slightly
 different from the one used for the input method `cyrillic-translit'.
@@ -51,19 +52,26 @@
 The argument is a string which specifies which language you are using;
 that affects the choice of transliterations slightly.
 Possible values are listed in 'cyrillic-language-alist'.
-If the argument is t, we use the default cyrillic transliteration.
-If the argument is nil, we return the display table to its standard state."
+
+Specifying a prefix arg, by preceding
+\\[standard-display-cyrillic-translit] with \\[universal-argument]
+turns off Cyrillic display.  Noninteractively, the DISABLE argument
+does the same thing.  "
   (interactive
    (list
-    (let* ((completion-ignore-case t))
-      (completing-read
-       "Cyrillic language (default nil): "
-       cyrillic-language-alist nil t nil nil nil))))
-  (when (equal cyrillic-language "")
-    (setq cyrillic-language nil))
+    (let* ((completion-ignore-case t)
+	   (default-language (if (assoc-ignore-case
+				  current-language-environment
+				  cyrillic-language-alist)
+				 current-language-environment
+			       "Russian")))
+      (or current-prefix-arg
+	  (completing-read
+	   (format "Cyrillic language (default %s): " default-language)
+	   cyrillic-language-alist nil t nil nil default-language)))))
   (frob-display-table
    (lambda (display-table)
-     (if (null cyrillic-language)
+     (if (or disable current-prefix-arg)
          (if (char-table-p display-table)
              (remove-char-table 'cyrillic-iso8859-5 display-table))
        (put-display-table ?,LP(B "a"   display-table)