From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67228 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Group, Summary buffers: End of line contain whitespaces Date: Wed, 13 Aug 2008 17:29:40 +0900 Organization: Emacsen advocacy group Message-ID: References: <87abfkmuko.fsf@jondo.cante.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218616298 8217 80.91.229.12 (13 Aug 2008 08:31:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 08:31:38 +0000 (UTC) Cc: bugs@quimby.gnus.org, ding@gnus.org To: Jari Aalto Original-X-From: ding-owner+M15680@lists.math.uh.edu Wed Aug 13 10:32:29 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTBmO-0005Lo-TL for ding-account@gmane.org; Wed, 13 Aug 2008 10:32:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1KTBkV-0004o5-Iz; Wed, 13 Aug 2008 03:30:31 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KTBkU-0004nw-94 for ding@lists.math.uh.edu; Wed, 13 Aug 2008 03:30:30 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1KTBkN-00020t-CI for ding@lists.math.uh.edu; Wed, 13 Aug 2008 03:30:30 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1KTBkM-00059c-00 for ; Wed, 13 Aug 2008 10:30:23 +0200 Original-Received: from localhost ([127.0.0.1]:60537) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1KTBjl-0001I8-3W; Wed, 13 Aug 2008 03:29:45 -0500 X-Hashcash: 1:20:080813:jari.aalto@cante.net::zzglHkMdSqcvOWKu:000000000000000000000000000000000000000000CmC X-Hashcash: 1:20:080813:bugs@quimby.gnus.org::T++fQIWzee5NLlHb:000000000000000000000000000000000000000003Gg7 X-Hashcash: 1:20:080813:ding@gnus.org::pZNy1CCA1SBMf2Dm:00009usZ X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:Lm55Udlp08jr0X9eQvG0TMKwCe4= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67228 Archived-At: >>>>> Jari Aalto wrote: > With setting: > (setq-default show-trailing-whitespace t) > The *Group* and **Summary* buffers seem to have EOL whitespaces. It > would be nice if these could be taken cared of (consider: copy/pasting > the buffer contents/areas elsewhere). > [2. Summary buffer --- image/png; gnus-1.png] => http://www.jpl.org/tmp/gnus-1.png > [3. Group buffer --- image/png; gnus-2.png] => http://www.jpl.org/tmp/gnus-2.png It is due to the space character that the default values of the following variables contain: `gnus-group-line-format' "%M\%S\%p\%P\%5y:%B%(%g%)%l %O\n" --- Gnus v5.11 "%M\%S\%p\%P\%5y:%B%(%g%)%O\n" --- Gnus v5.13 `gnus-summary-line-format' "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" --- Gnus v5.11 and v5.13 You use Gnus v5.11. So, for *Group* you can simply replace it with that of Gnus v5.13 since GroupLens (i.e. %l) is no longer available. For *Summary*, though it doesn't look good for me, this will work: (setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23f%]%)%s\n") I'm not sure what is the best way but I have two ideas. One is to remove trailing whitespace after the group buffer and the summary buffer have been generated or updated: --8<---------------cut here---------------start------------->8--- (add-hook 'gnus-group-prepare-hook (lambda nil (save-excursion (goto-char (point-min)) (while (re-search-forward " +$" nil t) (delete-region (match-beginning 0) (match-end 0)))))) (add-hook 'gnus-group-update-group-hook (lambda nil (end-of-line) (skip-chars-backward " ") (delete-region (point) (point-at-eol)))) (add-hook 'gnus-summary-prepare-hook (lambda nil (while (re-search-forward " +$" nil t) (delete-region (match-beginning 0) (match-end 0))) (goto-char (point-min)))) --8<---------------cut here---------------end--------------->8--- The other is to make the format-spec (which is a Lisp form) remove trailing whitespace by itself: --8<---------------cut here---------------start------------->8--- --- gnus-spec.el~ 2008-03-02 21:50:11 +0000 +++ gnus-spec.el 2008-08-13 08:25:45 +0000 @@ -703,7 +703,14 @@ (when result (if dontinsert result - (cons 'insert result))) + `(progn + (insert ,@result) + (if (bolp) + (progn + (end-of-line 0) + (skip-chars-backward " ") + (delete-region (point) (point-at-eol)) + (forward-line 1)))))) (cond ((stringp result) result) ((consp result) --8<---------------cut here---------------end--------------->8--- Maybe the former is faster than the later. Before trying the later, you need to eval the form: (gnus-update-format-specifications t 'group 'summary) Regards,