# HG changeset patch # User Miles Bader # Date 1216336863 0 # Node ID 9110741da209b64d88c5a7b50265f05089f3ed6f # Parent 0436fdfe2a5f82d5de2f6bc65e2ce786592f9ffb Merge from gnus--rel--5.10 Revision: emacs@sv.gnu.org/emacs--rel--22--patch-281 diff -r 0436fdfe2a5f -r 9110741da209 lisp/gnus/ChangeLog --- 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 + + * 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 * message.el (message-disassociate-draft): Revert 2008-03-18 change. diff -r 0436fdfe2a5f -r 9110741da209 lisp/gnus/gnus-sum.el --- 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) diff -r 0436fdfe2a5f -r 9110741da209 lisp/gnus/gnus-util.el --- 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