From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47180 Path: main.gmane.org!not-for-mail From: Paul Moore Newsgroups: gmane.emacs.gnus.general Subject: Re: User format functions - text properies get lost (XEmacs) Date: Mon, 14 Oct 2002 22:00:08 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <87r8ettekh.fsf@crybaby.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1034629996 21155 80.91.224.249 (14 Oct 2002 21:13:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2002 21:13:16 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181CWZ-0005Up-00 for ; Mon, 14 Oct 2002 23:13:15 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 181CV8-0000tj-00; Mon, 14 Oct 2002 16:11:46 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 14 Oct 2002 16:12:29 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id QAA00107 for ; Mon, 14 Oct 2002 16:12:17 -0500 (CDT) Original-Received: (qmail 9618 invoked by alias); 14 Oct 2002 21:13:06 -0000 Original-Received: (qmail 9613 invoked from network); 14 Oct 2002 21:13:06 -0000 Original-Received: from anchor-post-34.mail.demon.net (194.217.242.92) by gnus.org with SMTP; 14 Oct 2002 21:13:06 -0000 Original-Received: from morpheus.demon.co.uk ([158.152.8.30]) by anchor-post-34.mail.demon.net with smtp (Exim 3.35 #1) id 181CUl-000CtN-0Y for ding@gnus.org; Mon, 14 Oct 2002 22:11:24 +0100 Original-Received: from morpheus.demon.co.uk [127.0.0.1] by morpheus.demon.co.uk (127.0.0.1) (userid 1) with Hamster-NewsToMail-Gate (Classic Hamster Vr. 1.3 Build 1.3.23.191) ; Mon, 14 Oct 2002 22:00:09 +0100 X-Newsgroups: lists.ding Original-Lines: 47 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.5 (brussels sprouts, i586-pc-win32) Hamster/1.3.23.191 Cancel-Lock: sha1:PbWrAcySys01XGplvL1p3/I2ykU= Original-To: ding@gnus.org X-Gate: Hamster/1.3.23.191 NewsToMail-Gate Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:47180 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:47180 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes: > Paul Moore writes: > >> I'd appreciate any comments - this is my first attempt at submitting a >> patch for Gnus, so I apologise if I've made any obvious blunders, in >> coding or in procedure. > > If it works for you, that should be okay. It's a little suspicious > that it only handles %s and not, say %-20,20s. But if it's enough > for you, why not. As far as I can see, Gnus only generates %s (and %%) under xemacs. If gnus-use-correct-string-widths is nil (which is not the default) then %20s can be generated, but in that case my code just falls through to the default case (use format). So the formatting still happens OK, it's just that text properties get lost in that case. But is "it works for me" a good enough reason for a patch going into Gnus? It doesn't feel to me as if this is "complete" - it needs performance tuning, and it may need making optional (if the unavoidable performance impact is non-trivial). But I don't know how to do these things. I don't even know how to measure the performance :-( What's the next step for me if I want to get this included in Gnus? I'm happy to work with someone developing the code, but if it's left to me, it won't happen. There's a real (if rare) issue here. There is no general workaround available in user code - Gnus doesn't have the hooks to allow user code to interact with this phase of summary buffer generation. My patch works around the limitation (bug) in XEmacs, but it's not without cost. Maybe there's a better alternative, which doesn't need to work this way, but I can't follow the code well enough to see it. Just to re-clarify the original requirement - I want to make a part of the summary line have an alternative face in certain conditions (specifically, make the sender name change face if the sender is in my BBDB). Writing a user format function which returns a string which has face (and gnus-face) properties set should work (and does in FSF Emacs) but it fails to preserve the face in XEmacs. Paul. -- This signature intentionally left blank