changeset 80613:9110741da209

Merge from gnus--rel--5.10 Revision: emacs@sv.gnu.org/emacs--rel--22--patch-281
author Miles Bader <miles@gnu.org>
date Thu, 17 Jul 2008 23:21:03 +0000
parents 0436fdfe2a5f
children fa8281092b2f
files lisp/gnus/ChangeLog lisp/gnus/gnus-sum.el lisp/gnus/gnus-util.el
diffstat 3 files changed, 37 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Thu Jul 17 09:07:32 2008 +0000
+++ b/lisp/gnus/ChangeLog	Thu Jul 17 23:21:03 2008 +0000
@@ -1,3 +1,13 @@
+2008-06-18  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* gnus-util.el (gnus-put-display-table, gnus-get-display-table): New
+	macros that expand to an `aset'/`aref' call under Emacs, and to a
+	runtime choice under XEmacs.
+
+	* gnus-sum.el (gnus-summary-set-display-table): Use
+	`gnus-put-display-table', `gnus-get-display-table',
+	`gnus-set-display-table' for the display table, instead of `aset'.
+
 2008-06-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* message.el (message-disassociate-draft): Revert 2008-03-18 change.
--- a/lisp/gnus/gnus-sum.el	Thu Jul 17 09:07:32 2008 +0000
+++ b/lisp/gnus/gnus-sum.el	Thu Jul 17 23:21:03 2008 +0000
@@ -3256,13 +3256,13 @@
 	(i 32))
     ;; Nix out all the control chars...
     (while (>= (setq i (1- i)) 0)
-      (aset table i [??]))
+      (gnus-put-display-table i [??] table))
    ;; ... but not newline and cr, of course.  (cr is necessary for the
     ;; selective display).
-    (aset table ?\n nil)
-    (aset table ?\r nil)
+    (gnus-put-display-table ?\n nil table)
+    (gnus-put-display-table ?\r nil table)
     ;; We keep TAB as well.
-    (aset table ?\t nil)
+    (gnus-put-display-table ?\t nil table)
     ;; We nix out any glyphs 127 through 255, or 127 through 159 in
     ;; Emacs 23 (unicode), that are not set already.
     (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160))
@@ -3270,8 +3270,8 @@
 	       256)))
       (while (>= (setq i (1- i)) 127)
 	;; Only modify if the entry is nil.
-	(unless (aref table i)
-	  (aset table i [??]))))
+	(unless (gnus-get-display-table i table)
+	  (gnus-put-display-table i [??] table))))
     (setq buffer-display-table table)))
 
 (defun gnus-summary-set-article-display-arrow (pos)
--- a/lisp/gnus/gnus-util.el	Thu Jul 17 09:07:32 2008 +0000
+++ b/lisp/gnus/gnus-util.el	Thu Jul 17 23:21:03 2008 +0000
@@ -1671,6 +1671,27 @@
 	     ;; that intends to handle the quit signal next time.
 	     (eval '(ignore nil))))))
 
+(defmacro gnus-put-display-table (range value display-table)
+  "Set the value for char RANGE to VALUE in DISPLAY-TABLE.  "
+  (if (featurep 'xemacs)
+      (progn
+        `(if (fboundp 'put-display-table)
+          (put-display-table ,range ,value ,display-table)
+          (if (sequencep ,display-table)
+              (aset ,display-table ,range ,value)
+            (put-char-table ,range ,value ,display-table))))
+    `(aset ,display-table ,range ,value)))
+
+(defmacro gnus-get-display-table (character display-table)
+  "Find value for CHARACTER in DISPLAY-TABLE.  "
+  (if (featurep 'xemacs)
+      `(if (fboundp 'get-display-table)
+          (get-display-table ,character ,display-table)
+          (if (sequencep ,display-table)
+              (aref ,display-table ,character)
+            (get-char-table ,character ,display-table)))
+    `(aref ,display-table ,character)))
+
 (provide 'gnus-util)
 
 ;;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49