changeset 4484:d6e2e2e819d7

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 26 Jul 2008 09:52:06 +0200
parents e3ef34f57070 (diff) 7869173584fc (current diff)
children 57db42ba54fb
files src/ChangeLog
diffstat 7 files changed, 180 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jul 16 22:36:03 2008 +0200
+++ b/lisp/ChangeLog	Sat Jul 26 09:52:06 2008 +0200
@@ -1,3 +1,32 @@
+2008-07-26  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* x-init.el (x-initialize-compose): 
+	Rewrite to use #'loop, as does similar code in x-win-sun.el,
+	x-win-xfree86.el. Locally bind function-key-map to the correct
+	value for the device's console.
+	* x-win-xfree86.el (x-win-init-xfree86): 
+	Locally bind function-key-map to the correct value for the
+	device's console.
+	* x-win-sun.el (x-win-init-sun): 
+	Locally bind function-key-map to the correct value for the
+	device's console.
+
+2008-07-20  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* descr-text.el (describe-char-unicode-data): 
+	Correct three calls to #'error; it doesn't take #'message style
+	format strings and arguments.
+
+2008-07-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* descr-text.el (describe-property-list): Move the (require
+	'hyper-apropos) call to top level, this isn't the only function
+	that uses the relevant face. 
+	(describe-char): Wrap the Unihan field descriptions if they are
+	longer than the windows width minus 50.
+	Rename the created buffer to reflect the character's position as
+	well as its value. 
+
 2008-07-07  Aidan Kehoe  <kehoea@parhasard.net>
 
 	Patch to make it up to the device-specific code whether
--- a/lisp/descr-text.el	Wed Jul 16 22:36:03 2008 +0200
+++ b/lisp/descr-text.el	Sat Jul 26 09:52:06 2008 +0200
@@ -32,6 +32,8 @@
 
 (eval-when-compile (require 'wid-edit))
 
+(require 'hyper-apropos)
+
 ;;; Describe-Text Utilities.
 
 (defun describe-text-widget (widget)
@@ -82,7 +84,6 @@
 into help buttons that call `describe-text-category' or
 `describe-face' when pushed."
   ;; Sort the properties by the size of their value.
-  (require 'hyper-apropos)
   (dolist (elt (sort (let (ret)
 		       (while properties
 			 (push (list (pop properties) (pop properties)) ret))
@@ -676,7 +677,8 @@
   (when describe-char-unicodedata-file
     (unless (file-exists-p describe-char-unicodedata-file)
       (error 'file-error
-             "`unicodedata-file' %s not found" describe-char-unicodedata-file))
+             (format "`unicodedata-file' %s not found"
+                     describe-char-unicodedata-file)))
     ;; XEmacs change; accept a character argument, use the cache if
     ;; appropriate.
     (when (characterp char)
@@ -696,13 +698,14 @@
                 (coding-system-for-read 'no-conversion-unix)
                 key lookup)
             (unless database-handle
-              (error 'io-error "Could not open %s as a %s database"
-                     (unidata-generate-database-file-name
-                      describe-char-unicodedata-file
-                      (eighth (file-attributes
-                               describe-char-unicodedata-file))
-                      unidata-database-format)
-                     unidata-database-format))
+              (error 'io-error 
+                     (format "Could not open %s as a %s database"
+                             (unidata-generate-database-file-name
+                              describe-char-unicodedata-file
+                              (eighth (file-attributes
+                                       describe-char-unicodedata-file))
+                              unidata-database-format)
+                             unidata-database-format)))
             (setq key (format "%04X" char)
                   lookup (get-database key database-handle))
             (if lookup
@@ -760,7 +763,8 @@
 	      (unless (or (= 13 (length fields))
 			  (= 14 (length fields)))
 		(error 'invalid-argument
-                       "Invalid contents in %s" describe-char-unicodedata-file))
+                       (format "Invalid contents in %s"
+                               describe-char-unicodedata-file)))
 	      ;; The field names and values lists are slightly
 	      ;; modified from Mule-UCS unidata.el.
 	      (apply #'list
@@ -1029,7 +1033,8 @@
 		  (describe-text-properties pos tmp-buf)
 		  (with-current-buffer tmp-buf (buffer-string)))
 	      (kill-buffer tmp-buf))))
-	 item-list max-width unicode unicode-formatted unicode-error)
+	 item-list max-width unicode unicode-formatted unicode-error
+	 unicodedata (max-unicode-description-width (- (window-width) 50)))
 
 
     (setq unicode-error
@@ -1185,13 +1190,29 @@
 				     `(insert-gui-button
                                        (make-gui-button
                                         ,(symbol-name face)))))))
-	    ,@(let ((unicodedata (and unicode
-				      (describe-char-unicode-data unicode))))
+	    ,@(progn 
+		(setq unicodedata (and unicode
+				       (describe-char-unicode-data unicode)))
 		(if unicodedata
 		    (cons (list "Unicode data" " ") unicodedata)))))
     (setq max-width (apply #'max (mapcar #'(lambda (x)
 					     (if (cadr x) (length (car x)) 0))
 					 item-list)))
+    (when (and unicodedata (> max-width max-unicode-description-width))
+      (setq max-width max-unicode-description-width)
+      (with-temp-buffer
+	(let ((fill-column max-unicode-description-width)
+	      (indent-tabs-mode nil))
+	  (dolist (unidata-line unicodedata)
+	    (when (cadr unidata-line)
+	      (setf (car unidata-line)
+		    (progn (insert (car unidata-line))
+			   (goto-char (point-min))
+			   (fill-paragraph 'right)
+			   (delete-region (1- (point-max))
+					  (point-max))
+			   (buffer-string)))
+	      (delete-region (point-min) (point-max)))))))
     ; (help-setup-xref nil (interactive-p))
     (with-displaying-help-buffer
      (lambda ()
@@ -1274,7 +1295,7 @@
 ;        (setq help-xref-stack-item (list 'help-insert-string (buffer-string)))
          (toggle-read-only 1)
          (print-help-return-message)))
-     (format "Describe %c" (char-after pos)))))
+       (format "Describe %c <%d>" (char-after pos) pos))))
 
 (defalias 'describe-char-after 'describe-char)
 (make-obsolete 'describe-char-after 'describe-char "22.1")
--- a/lisp/x-init.el	Wed Jul 16 22:36:03 2008 +0200
+++ b/lisp/x-init.el	Sat Jul 26 09:52:06 2008 +0200
@@ -84,12 +84,6 @@
 ;; Load X-server specific code.
 ;; Specifically, load some code to repair the grievous damage that MIT and
 ;; Sun have done to the default keymap for the Sun keyboards.
-
-(eval-when-compile
-  (defmacro x-define-dead-key (key map device)
-    `(when (x-keysym-on-keyboard-p ',key device)
-       (define-key function-key-map [,key] ',map))))
-
 (defun x-initialize-compose (device)
   "Enable compose key and dead key processing on DEVICE."
   (autoload 'compose-map	    "x-compose" nil t 'keymap)
@@ -100,111 +94,118 @@
   (autoload 'compose-circumflex-map "x-compose" nil t 'keymap)
   (autoload 'compose-tilde-map	    "x-compose" nil t 'keymap)
 
-  (when (x-keysym-on-keyboard-p 'multi-key device)
-    (define-key function-key-map [multi-key] 'compose-map))
+  (loop 
+    for (key map)
+    ;; The dead keys might really be called just about anything, depending
+    ;; on the vendor.  MIT thinks that the prefixes are "SunFA_", "D", and
+    ;; "hpmute_" for Sun, DEC, and HP respectively.  However, OpenWindows 3
+    ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
+    ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_".  Go
+    ;; figure.
+
+    ;; Presumably if someone is running OpenWindows, they won't be using the
+    ;; DEC or HP keysyms, but if they are defined then that is possible, so
+    ;; in that case we accept them all.
 
-  ;; The dead keys might really be called just about anything, depending
-  ;; on the vendor.  MIT thinks that the prefixes are "SunFA_", "D", and
-  ;; "hpmute_" for Sun, DEC, and HP respectively.  However, OpenWindows 3
-  ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
-  ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_".
-  ;; Go figure.
+    ;; If things seem not to be working, you might want to check your
+    ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
+    ;; mixed up view of what these keys should be called.
 
-  ;; Presumably if someone is running OpenWindows, they won't be using
-  ;; the DEC or HP keysyms, but if they are defined then that is possible,
-  ;; so in that case we accept them all.
-
-  ;; If things seem not to be working, you might want to check your
-  ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
-  ;; mixed up view of what these keys should be called.
+    ;; Canonical names:
+    in '((acute			compose-acute-map)
+         (grave			compose-grave-map)
+         (cedilla		compose-cedilla-map)
+         (diaeresis		compose-diaeresis-map)
+         (circumflex		compose-circumflex-map)
+         (tilde			compose-tilde-map)
+         (degree			compose-ring-map)
+         (multi-key              compose-map)
 
-  ;; Canonical names:
-  (x-define-dead-key acute			compose-acute-map device)
-  (x-define-dead-key grave			compose-grave-map device)
-  (x-define-dead-key cedilla			compose-cedilla-map device)
-  (x-define-dead-key diaeresis			compose-diaeresis-map device)
-  (x-define-dead-key circumflex			compose-circumflex-map device)
-  (x-define-dead-key tilde			compose-tilde-map device)
-  (x-define-dead-key degree			compose-ring-map device)
+         ;; Sun according to MIT:
+         (SunFA_Acute		compose-acute-map)
+         (SunFA_Grave		compose-grave-map)
+         (SunFA_Cedilla		compose-cedilla-map)
+         (SunFA_Diaeresis	compose-diaeresis-map)
+         (SunFA_Circum		compose-circumflex-map)
+         (SunFA_Tilde		compose-tilde-map)
+
+         ;; Sun according to OpenWindows 2:
+         (Dead_Grave		compose-grave-map)
+         (Dead_Circum		compose-circumflex-map)
+         (Dead_Tilde		compose-tilde-map)
 
-  ;; Sun according to MIT:
-  (x-define-dead-key SunFA_Acute		compose-acute-map device)
-  (x-define-dead-key SunFA_Grave		compose-grave-map device)
-  (x-define-dead-key SunFA_Cedilla		compose-cedilla-map device)
-  (x-define-dead-key SunFA_Diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key SunFA_Circum		compose-circumflex-map device)
-  (x-define-dead-key SunFA_Tilde		compose-tilde-map device)
+         ;; Sun according to OpenWindows 3:
+         (SunXK_FA_Acute		compose-acute-map)
+         (SunXK_FA_Grave		compose-grave-map)
+         (SunXK_FA_Cedilla	compose-cedilla-map)
+         (SunXK_FA_Diaeresis	compose-diaeresis-map)
+         (SunXK_FA_Circum	compose-circumflex-map)
+         (SunXK_FA_Tilde		compose-tilde-map)
 
-  ;; Sun according to OpenWindows 2:
-  (x-define-dead-key Dead_Grave			compose-grave-map device)
-  (x-define-dead-key Dead_Circum		compose-circumflex-map device)
-  (x-define-dead-key Dead_Tilde			compose-tilde-map device)
-
-  ;; Sun according to OpenWindows 3:
-  (x-define-dead-key SunXK_FA_Acute		compose-acute-map device)
-  (x-define-dead-key SunXK_FA_Grave		compose-grave-map device)
-  (x-define-dead-key SunXK_FA_Cedilla		compose-cedilla-map device)
-  (x-define-dead-key SunXK_FA_Diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key SunXK_FA_Circum		compose-circumflex-map device)
-  (x-define-dead-key SunXK_FA_Tilde		compose-tilde-map device)
+         ;; DEC according to MIT:
+         (Dacute_accent		compose-acute-map)
+         (Dgrave_accent		compose-grave-map)
+         (Dcedilla_accent	compose-cedilla-map)
+         (Dcircumflex_accent	compose-circumflex-map)
+         (Dtilde			compose-tilde-map)
+         (Dring_accent		compose-ring-map)
 
-  ;; DEC according to MIT:
-  (x-define-dead-key Dacute_accent		compose-acute-map device)
-  (x-define-dead-key Dgrave_accent		compose-grave-map device)
-  (x-define-dead-key Dcedilla_accent		compose-cedilla-map device)
-  (x-define-dead-key Dcircumflex_accent		compose-circumflex-map device)
-  (x-define-dead-key Dtilde			compose-tilde-map device)
-  (x-define-dead-key Dring_accent		compose-ring-map device)
+         ;; DEC according to OpenWindows 3:
+         (DXK_acute_accent	compose-acute-map)
+         (DXK_grave_accent	compose-grave-map)
+         (DXK_cedilla_accent	compose-cedilla-map)
+         (DXK_circumflex_accent	compose-circumflex-map)
+         (DXK_tilde		compose-tilde-map)
+         (DXK_ring_accent	compose-ring-map)
 
-  ;; DEC according to OpenWindows 3:
-  (x-define-dead-key DXK_acute_accent		compose-acute-map device)
-  (x-define-dead-key DXK_grave_accent		compose-grave-map device)
-  (x-define-dead-key DXK_cedilla_accent		compose-cedilla-map device)
-  (x-define-dead-key DXK_circumflex_accent	compose-circumflex-map device)
-  (x-define-dead-key DXK_tilde			compose-tilde-map device)
-  (x-define-dead-key DXK_ring_accent		compose-ring-map device)
+         ;; HP according to MIT:
+         (hpmute_acute		compose-acute-map)
+         (hpmute_grave		compose-grave-map)
+         (hpmute_diaeresis	compose-diaeresis-map)
+         (hpmute_asciicircum	compose-circumflex-map)
+         (hpmute_asciitilde	compose-tilde-map)
 
-  ;; HP according to MIT:
-  (x-define-dead-key hpmute_acute		compose-acute-map device)
-  (x-define-dead-key hpmute_grave		compose-grave-map device)
-  (x-define-dead-key hpmute_diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key hpmute_asciicircum		compose-circumflex-map device)
-  (x-define-dead-key hpmute_asciitilde		compose-tilde-map device)
+         ;; Empirically discovered on Linux XFree86 MetroX:
+         (usldead_acute		compose-acute-map)
+         (usldead_grave		compose-grave-map)
+         (usldead_diaeresis	compose-diaeresis-map)
+         (usldead_asciicircum	compose-circumflex-map)
+         (usldead_asciitilde	compose-tilde-map)
 
-  ;; Empirically discovered on Linux XFree86 MetroX:
-  (x-define-dead-key usldead_acute		compose-acute-map device)
-  (x-define-dead-key usldead_grave		compose-grave-map device)
-  (x-define-dead-key usldead_diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key usldead_asciicircum	compose-circumflex-map device)
-  (x-define-dead-key usldead_asciitilde		compose-tilde-map device)
+         ;; HP according to OpenWindows 3:
+         (hpXK_mute_acute	compose-acute-map)
+         (hpXK_mute_grave	compose-grave-map)
+         (hpXK_mute_diaeresis	compose-diaeresis-map)
+         (hpXK_mute_asciicircum	compose-circumflex-map)
+         (hpXK_mute_asciitilde	compose-tilde-map)
 
-  ;; HP according to OpenWindows 3:
-  (x-define-dead-key hpXK_mute_acute		compose-acute-map device)
-  (x-define-dead-key hpXK_mute_grave		compose-grave-map device)
-  (x-define-dead-key hpXK_mute_diaeresis	compose-diaeresis-map device)
-  (x-define-dead-key hpXK_mute_asciicircum	compose-circumflex-map device)
-  (x-define-dead-key hpXK_mute_asciitilde	compose-tilde-map device)
+         ;; HP according to HP-UX 8.0:
+         (XK_mute_acute		compose-acute-map)
+         (XK_mute_grave		compose-grave-map)
+         (XK_mute_diaeresis	compose-diaeresis-map)
+         (XK_mute_asciicircum	compose-circumflex-map)
+         (XK_mute_asciitilde	compose-tilde-map)
 
-  ;; HP according to HP-UX 8.0:
-  (x-define-dead-key XK_mute_acute		compose-acute-map device)
-  (x-define-dead-key XK_mute_grave		compose-grave-map device)
-  (x-define-dead-key XK_mute_diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key XK_mute_asciicircum	compose-circumflex-map device)
-  (x-define-dead-key XK_mute_asciitilde		compose-tilde-map device)
-
-  ;; [[ XFree86 seems to use lower case and a hyphen ]] Not true; they use
-  ;; lower case and an underscore. XEmacs converts the underscore to a
-  ;; hyphen in x_keysym_to_emacs_keysym because the keysym is in the
-  ;; "Keyboard" character set, which is just totally fucking random,
-  ;; considering it doesn't happen for any other character sets. 
-  (x-define-dead-key dead-acute			compose-acute-map device)
-  (x-define-dead-key dead-grave			compose-grave-map device)
-  (x-define-dead-key dead-cedilla		compose-cedilla-map device)
-  (x-define-dead-key dead-diaeresis		compose-diaeresis-map device)
-  (x-define-dead-key dead-circum		compose-circumflex-map device)
-  (x-define-dead-key dead-circumflex		compose-circumflex-map device)
-  (x-define-dead-key dead-tilde			compose-tilde-map device)
-  )
+         ;; [[ XFree86 seems to use lower case and a hyphen ]] Not true;
+         ;; they use lower case and an underscore. XEmacs converts the
+         ;; underscore to a hyphen in x_keysym_to_emacs_keysym because the
+         ;; keysym is in the "Keyboard" character set, which is just totally
+         ;; fucking random, considering it doesn't happen for any other
+         ;; character sets.
+         (dead-acute		compose-acute-map)
+         (dead-grave		compose-grave-map)
+         (dead-cedilla		compose-cedilla-map)
+         (dead-diaeresis		compose-diaeresis-map)
+         (dead-circum		compose-circumflex-map)
+         (dead-circumflex	compose-circumflex-map)
+         (dead-tilde		compose-tilde-map))
+    
+    ;; Get the correct value for function-key-map
+    with function-key-map = (symbol-value-in-console 'function-key-map
+                                                     (device-console device)
+                                                     function-key-map)
+    do (when (x-keysym-on-keyboard-p key device)
+         (define-key function-key-map (vector key) map))))
 
 (eval-when-compile
   (load "x-win-sun"     nil t)
--- a/lisp/x-win-sun.el	Wed Jul 16 22:36:03 2008 +0200
+++ b/lisp/x-win-sun.el	Sat Jul 26 09:52:06 2008 +0200
@@ -156,6 +156,10 @@
 		 (f11    stop)
 		 (f12    again))))
       )
+    ;; Get the correct value for function-key-map
+    with function-key-map = (symbol-value-in-console 'function-key-map
+                                                     (device-console device)
+                                                     function-key-map)
     do (when (x-keysym-on-keyboard-sans-modifiers-p from-key device)
 	 (dolist (prefix '(() (shift) (control) (meta) (alt)
 			   (shift control) (shift alt) (shift meta)
--- a/lisp/x-win-xfree86.el	Wed Jul 16 22:36:03 2008 +0200
+++ b/lisp/x-win-xfree86.el	Sat Jul 26 09:52:06 2008 +0200
@@ -90,6 +90,11 @@
       (f22 f10)
       (f23 f11)
       (f24 f12))
+    ;; Get the correct value for function-key-map
+    with function-key-map = (symbol-value-in-console 'function-key-map
+                                                     (device-console device)
+                                                     function-key-map)
+
     do
     (when (and (x-keysym-on-keyboard-p key device)
 	       (not (x-keysym-on-keyboard-sans-modifiers-p key device)))
--- a/src/ChangeLog	Wed Jul 16 22:36:03 2008 +0200
+++ b/src/ChangeLog	Sat Jul 26 09:52:06 2008 +0200
@@ -1,3 +1,9 @@
+2008-07-17  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* redisplay.c (init_redisplay): 
+	Don't set window-system to 'stream if running noninteractively,
+	revert to the documented behaviour. 
+
 2008-07-16  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* lread.c (read_escape): 
--- a/src/redisplay.c	Wed Jul 16 22:36:03 2008 +0200
+++ b/src/redisplay.c	Sat Jul 26 09:52:06 2008 +0200
@@ -9753,7 +9753,6 @@
 
   if (noninteractive)
     {
-      Vwindow_system = Qstream;
       Vinitial_device_type = Qstream;
       return;
     }