Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Jari Aalto <jari.aalto@cante.net>
Cc: bugs@quimby.gnus.org, ding@gnus.org
Subject: Re: Group, Summary buffers: End of line contain whitespaces
Date: Wed, 13 Aug 2008 17:29:40 +0900	[thread overview]
Message-ID: <b4md4kdco7f.fsf@jpl.org> (raw)
In-Reply-To: <87abfkmuko.fsf@jondo.cante.net>

>>>>> 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,



       reply	other threads:[~2008-08-13  8:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87abfkmuko.fsf@jondo.cante.net>
2008-08-13  8:29 ` Katsumi Yamaoka [this message]
2008-08-13 18:56   ` Reiner Steib
2008-08-13 21:47     ` Jari Aalto
2008-08-15 16:31       ` jidanni
2008-08-19 11:48       ` Miles Bader
2008-08-22 15:52   ` Ted Zlatanov
2008-08-27 23:01     ` Miles Bader
2008-08-28 13:51       ` Ted Zlatanov
2008-08-29 11:15         ` Reiner Steib
2008-08-29 15:12           ` bugs and features (was: Group, Summary buffers: End of line contain whitespaces) Ted Zlatanov
2008-09-15 21:00             ` registry doc patch (was: bugs and features) Ted Zlatanov
2008-09-16  9:17               ` registry doc patch Rupert Swarbrick
2008-09-16 13:36                 ` Ted Zlatanov
2008-09-16 12:30               ` Magnus Henoch
2008-09-16 13:39                 ` Ted Zlatanov
2008-09-18 23:19                   ` Katsumi Yamaoka
2008-09-19 16:19                     ` Ted Zlatanov
2008-09-23 19:18                       ` Reiner Steib
2008-09-24  0:37                         ` Katsumi Yamaoka
2008-09-24  6:45                           ` Katsumi Yamaoka
2008-09-24 16:45                             ` Reiner Steib
2008-09-24 16:44                           ` informat.el: `Info-split' split size (was: registry doc patch) Reiner Steib
2008-09-24 23:58                             ` informat.el: `Info-split' split size Katsumi Yamaoka
2008-09-25  3:10                               ` Eli Zaretskii
2008-09-25  4:01                                 ` Katsumi Yamaoka
2008-09-25 23:10                               ` Katsumi Yamaoka
2008-08-29 13:51         ` Group, Summary buffers: End of line contain whitespaces Ted Zlatanov
2008-08-29 15:31         ` Daiki Ueno
2008-08-29 15:55           ` Ted Zlatanov
2008-08-30  5:07             ` Katsumi Yamaoka
2008-08-30  9:33               ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4md4kdco7f.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=bugs@quimby.gnus.org \
    --cc=ding@gnus.org \
    --cc=jari.aalto@cante.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).