[PATCH] Support opaque display-table objects on XEmacs

Aidan Kehoe kehoea at parhasard.net
Tue May 27 17:02:17 EDT 2008


 Ar an seachtú lá is fiche de mí Bealtaine, scríobh Reiner Steib: 

 > On Thu, May 22 2008, Miles Bader wrote:
 > 
 > > Aidan Kehoe <kehoea at parhasard.net> writes:
 > >> This patch adds support for the non-sequence display tables of XEmacs
 > >> 21.5, without any run-time overhead on GNU. A patch that’s equivalent
 > >> in functionality for that version has been integrated into the XEmacs
 > >> package repository; this conflicts with that, though--sorry Mike!--and
 > >> is more compatible with GNU.
 > 
 > I gather that it should be applied to the stable and development
 > branch.  Right?

That would be ideal from my perspective, yes. 

 > >> I’ve tested this (somewhat superficially) with XEmacs 21.5, 21.4
 > >> and GNU.
 > 
 > (Just call the later "Emacs".)

That’s something I’ve considered, yes. (Also, “latter”.)

 > >> Please advise me if this is the wrong list to submit this to. 
 > 
 > It's the right list.  Thanks.
 > 
 > >> I have papers on file with the FSF for Gnus and for GNU Emacs as a
 > >> whole, so that shouldn’t be an issue.
 > 
 > Confirmed.
 >  
 > >> 	* gnus-util.el (gnus-put-display-table): New.
 > >> 	(gnus-get-display-table): New. 
 > >> 	Macros that expand to an #'aset call under GNU, and to a runtime choice
 > >> 	under XEmacs. 
 > 
 > Is writing “#'” a new XEmacsy ChangeLog convention?

No, it’s a Common Lisp thing that I picked up from the SXEmacs folk, and
that I find helpful and clear. (In CL it’s a macro that throws an error at
read time if the following symbol doesn’t have a function definition.) 

 > >> 	* gnus-sum.el (gnus-summary-set-display-table): 
 > >> 	Use #'gnus-{put,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,get}-display-table, gnus-set-display-table for the
 > >> 	display table.
 > 
 > It's better (e.g. for searching) to spell out the macro names (not
 > using {put,get}).

This is unclear to me; are you asking me to resubmit the patch for this
reason?

 > >> @@ -3431,8 +3431,8 @@
 > >>  	       256)))
 > >>        (while (>= (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)))
 > >
 > > Should those be `gnus-get-display-table' and `gnus-put-display-table'?
 > 
 > Aidan?

Ah, yes, they should. I’ll resubmit the patch on that basis. 

 > >> +(defmacro gnus-put-display-table (range value display-table)
 > >> +  "Set the value for char RANGE to VALUE in DISPLAY-TABLE.  "
 > >> +  (if (featurep 'xemacs)
 > >> +      (progn
 > 
 > Useless `progn'?

Yes. 

 > >> +        `(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))))
 > 
 > `cond' would be more readable than an `if'-cascade, IMHO.

Meh, part of the cascade is at compile time, part at run time, and the
latter is only two deep. One more level and I would agree with you. 

-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?



More information about the XEmacs-Patches mailing list