From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66979 Path: news.gmane.org!not-for-mail From: Aidan Kehoe Newsgroups: gmane.emacs.xemacs.patches,gmane.emacs.gnus.general Subject: [PATCH] Support opaque display-table objects on XEmacs Date: Thu, 22 May 2008 00:57:07 +0200 Message-ID: <18484.43203.462970.885072@parhasard.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1211410712 31480 80.91.229.12 (21 May 2008 22:58:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 May 2008 22:58:32 +0000 (UTC) Cc: xemacs-patches@xemacs.org To: ding@gnus.org Original-X-From: xemacs-patches-bounces@xemacs.org Thu May 22 00:59:10 2008 Return-path: Envelope-to: gexp-xemacs-patches-2@gmane.org Original-Received: from 98.f7bed1.client.atlantech.net ([209.190.247.152] helo=calypso.tux.org) by lo.gmane.org with esmtp (Exim 4.50) id 1JyxFa-0007j8-Sq for gexp-xemacs-patches-2@gmane.org; Thu, 22 May 2008 00:57:39 +0200 Original-Received: from calypso.tux.org (localhost [127.0.0.1]) by calypso.tux.org (Postfix) with ESMTP id 03B2F1179C9; Wed, 21 May 2008 18:56:52 -0400 (EDT) Original-Received: from gwyn.tux.org (gwyn.tux.org [207.172.156.132]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by calypso.tux.org (Postfix) with ESMTP id 4F9341178E4 for ; Wed, 21 May 2008 18:56:49 -0400 (EDT) Original-Received: from gwyn.tux.org (ident-user@localhost.localdomain [127.0.0.1]) by gwyn.tux.org (8.12.11/8.12.11) with ESMTP id m4LMumNS019845 for ; Wed, 21 May 2008 18:56:48 -0400 Original-Received: (from xemacweb@localhost) by gwyn.tux.org (8.12.11/8.12.11/Submit) id m4LMumfT019844 for xemacs-patches@calypso.tux.org; Wed, 21 May 2008 18:56:48 -0400 Original-Received: from gwyn.tux.org (ident-user@localhost.localdomain [127.0.0.1]) by gwyn.tux.org (8.12.11/8.12.11) with ESMTP id m4LMuj7A019826 for ; Wed, 21 May 2008 18:56:45 -0400 Original-Received: (from mailnull@localhost) by gwyn.tux.org (8.12.11/8.12.11/Submit) id m4LMuj5f019825 for xemacweb@tux.org; Wed, 21 May 2008 18:56:45 -0400 Original-Received: from daedalus.asclepian.ie (daedalus.ipv4.asclepian.ie [213.133.100.226]) by gwyn.tux.org (8.12.11/8.12.11) with ESMTP id m4LMuiXB019808 for ; Wed, 21 May 2008 18:56:44 -0400 Original-Received: by daedalus.asclepian.ie (Postfix, from userid 1002) id 89355B83C; Wed, 21 May 2008 23:57:45 +0100 (IST) X-Mailer: VM 7.19 under 21.5 (beta28) "fuki" a1f8c5c250c2 XEmacs Lucid X-NS5-file-as-sent: t X-Echelon-distraction: New World Order Delta Force Ortega Peking explosion Craig Livingstone X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gwyn.tux.org [0.0.0.0]); Wed, 21 May 2008 18:56:48 -0400 (EDT) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gwyn.tux.org [0.0.0.0]); Wed, 21 May 2008 18:56:45 -0400 (EDT) X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-1.6 (gwyn.tux.org [207.172.156.133]); Wed, 21 May 2008 18:56:45 -0400 (EDT) X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on gwyn.tux.org X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on gwyn.tux.org X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on gwyn.tux.org X-Virus-Status: Clean X-XEmacs-List: patches X-BeenThere: xemacs-patches@xemacs.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "XEmacs patch submissions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: xemacs-patches-bounces@xemacs.org Errors-To: xemacs-patches-bounces@xemacs.org Xref: news.gmane.org gmane.emacs.xemacs.patches:9443 gmane.emacs.gnus.general:66979 Archived-At: Hi,=20 This patch adds support for the non-sequence display tables of XEmacs 21.= 5, without any run-time overhead on GNU. A patch that=E2=80=99s equivalent i= n functionality for that version has been integrated into the XEmacs packag= e repository; this conflicts with that, though--sorry Mike!--and is more compatible with GNU. I=E2=80=99ve tested this (somewhat superficially) wi= th XEmacs 21.5, 21.4 and GNU. Please advise me if this is the wrong list to submit this to. I have pape= rs on file with the FSF for Gnus and for GNU Emacs as a whole, so that shouldn=E2=80=99t be an issue. Bye,=20 Aidan ChangeLog addition:=20 2008-05-22 Aidan Kehoe * gnus-util.el (gnus-put-display-table): New. (gnus-get-display-table): New.=20 Macros that expand to an #'aset call under GNU, and to a runtime choice under XEmacs.=20 * gnus-sum.el (gnus-summary-set-display-table):=20 Use #'gnus-{put,get}-display-table, gnus-set-display-table for the display table, instead of #'aset.=20 * gnus-xmas.el (gnus-xmas-summary-set-display-table):=20 Use #'gnus-{put,get}-display-table, gnus-set-display-table for the display table. Index: lisp/gnus-sum.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 7.226 diff -u -r7.226 gnus-sum.el --- lisp/gnus-sum.el 19 May 2008 08:47:42 -0000 7.226 +++ lisp/gnus-sum.el 21 May 2008 22:54:32 -0000 @@ -3417,13 +3417,13 @@ (i 32)) ;; Nix out all the control chars... (while (>=3D (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 (=3D (make-char 'latin-iso8859-1 160) 16= 0)) @@ -3431,8 +3431,8 @@ 256))) (while (>=3D (setq i (1- i)) 127) ;; Only modify if the entry is nil. - (unless (aref table i) - (aset table i [??])))) + (unless (get-display-table i table) + (put-display-table i [??] table)))) (setq buffer-display-table table))) =20 (defun gnus-summary-set-article-display-arrow (pos) Index: lisp/gnus-util.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v retrieving revision 7.80 diff -u -r7.80 gnus-util.el --- lisp/gnus-util.el 19 May 2008 08:47:42 -0000 7.80 +++ lisp/gnus-util.el 21 May 2008 22:54:32 -0000 @@ -1798,6 +1798,27 @@ ;; that intends to handle the quit signal next time. (eval '(ignore nil)))))) =20 +(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 ,char-table))) + (provide 'gnus-util) =20 ;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49 Index: lisp/gnus-xmas.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-xmas.el,v retrieving revision 7.25 diff -u -r7.25 gnus-xmas.el --- lisp/gnus-xmas.el 10 Mar 2008 00:53:11 -0000 7.25 +++ lisp/gnus-xmas.el 21 May 2008 22:54:32 -0000 @@ -39,6 +39,7 @@ (defvar menu-bar-mode (featurep 'menubar)) (require 'messagexmas) (require 'wid-edit) +(require 'gnus-util) =20 (defgroup gnus-xmas nil "XEmacsoid support for Gnus" @@ -173,18 +174,18 @@ (i 32)) ;; Nix out all the control chars... (while (>=3D (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 (>=3D (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))) --=20 =C2=BFD=C3=B3nde estar=C3=A1 ahora mi sobrino Yoghurtu Ngh=C3=A9, que tuv= o que huir precipitadamente de la aldea por culpa de la escasez de rinocerontes?