Changes committed gnus/lisp (ChangeLog gnus-sum.el gnus-util.el gnus-xmas.el)
"Reiner Steib" <[email protected]>
| Newsgroups | gmane.emacs.gnus.commits |
|---|---|
| Message-ID | <[email protected]> |
Modified: ChangeLog gnus-sum.el gnus-util.el gnus-xmas.el * 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'. * gnus-xmas.el (gnus-xmas-summary-set-display-table): Use `gnus-put-display-table', `gnus-get-display-table', `gnus-set-display-table' for the display table. Index: ChangeLog diff -u gnus/lisp/ChangeLog:7.1878 gnus/lisp/ChangeLog:7.1879 --- ChangeLog:7.1878 Sat Jun 14 17:39:11 2008 +++ ChangeLog Sat Jun 14 17:45:03 2008 @@ -1,3 +1,17 @@ +2008-06-14 Aidan Kehoe <[email protected]> + + * 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'. + + * gnus-xmas.el (gnus-xmas-summary-set-display-table): Use + `gnus-put-display-table', `gnus-get-display-table', + `gnus-set-display-table' for the display table. + 2008-06-14 Reiner Steib <[email protected]> * nnmairix.el: Add autoloads. Index: gnus-sum.el diff -u gnus/lisp/gnus-sum.el:7.228 gnus/lisp/gnus-sum.el:7.229 --- gnus-sum.el:7.228 Wed Jun 11 16:19:44 2008 +++ gnus-sum.el Sat Jun 14 17:45:03 2008 @@ -3420,13 +3420,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)) @@ -3434,8 +3434,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) Index: gnus-util.el diff -u gnus/lisp/gnus-util.el:7.81 gnus/lisp/gnus-util.el:7.82 --- gnus-util.el:7.81 Wed Jun 11 16:19:44 2008 +++ gnus-util.el Sat Jun 14 17:45:03 2008 @@ -1801,6 +1801,27 @@ (defalias 'gnus-read-shell-command (if (fboundp 'read-shell-command) 'read-shell-command 'read-string)) +(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 Index: gnus-xmas.el diff -u gnus/lisp/gnus-xmas.el:7.25 gnus/lisp/gnus-xmas.el:7.26 --- gnus-xmas.el:7.25 Mon Mar 10 01:53:11 2008 +++ gnus-xmas.el Sat Jun 14 17:45:03 2008 @@ -39,6 +39,7 @@ (defvar menu-bar-mode (featurep 'menubar)) (require 'messagexmas) (require 'wid-edit) +(require 'gnus-util) (defgroup gnus-xmas nil "XEmacsoid support for Gnus" @@ -173,18 +174,18 @@ (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 over 126 below ctl-arrow. (let ((i (if (integerp ctl-arrow) ctl-arrow 160))) (while (>= (setq i (1- i)) 127) - (unless (aref table i) - (aset table i [??])))) + (unless (gnus-get-display-table i table) + (gnus-put-display-table i [??] table)))) ;; Can't use `set-specifier' because of a bug in 19.14 and earlier (add-spec-to-specifier current-display-table table (current-buffer) nil)))