]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge from gnus--rel--5.10
authorMiles Bader <miles@gnu.org>
Thu, 17 Jul 2008 23:21:03 +0000 (23:21 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 17 Jul 2008 23:21:03 +0000 (23:21 +0000)
Revision: emacs@sv.gnu.org/emacs--rel--22--patch-281

lisp/gnus/ChangeLog
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el

index 23379fa6ce1fcf3b261923fde750f9df71677f76..c140cd72c54c97013f28610d7dff1fbbc57eb6d3 100644 (file)
@@ -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.
index a60211ba8b76bbc27774ee20005b81d75da48b4f..1483d830b85e790bdefc010ec942aeab05b94203 100644 (file)
@@ -3256,13 +3256,13 @@ display only a single character."
        (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 @@ display only a single character."
               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)
index 6f052534bdd9f8c7642d990913b32d2328184f48..a7998b7b4e248a034e003405cc154d1d36e7403d 100644 (file)
@@ -1671,6 +1671,27 @@ is allowed once again.  (Immediately, if `inhibit-quit' is nil.)"
             ;; 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