Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Cleaner dates in summary buffers
@ 2013-08-31 23:17 João Távora
  2013-09-01 14:14 ` João Távora
  0 siblings, 1 reply; 2+ messages in thread
From: João Távora @ 2013-08-31 23:17 UTC (permalink / raw)
  To: info-gnus-english

Hi all,

Is there any way to turn this

    U.  2013-08-30 16:37  [    Julien Cubizolles    ]    `->              
    U.  2013-08-30 10:16  [         F. Gr.          ]  custom-theme-load-p
    U.+ 2013-08-30 15:07  [   jumianek@gmail.com    ]  v mouse does not co
    U.+ 2013-08-30 17:35  [      Óscar Fuentes      ]  `-> 
    U.  2013-08-30 23:27  [        Catonano         ]  v o-blog (helpwith 
    U.  2013-08-31 02:12  [      Jambunathan K      ]  `-> 
    U.  2013-08-31 22:26  [        Catonano         ]    `->

Into this?

    U.  2013-08-30 16:37  [    Julien Cubizolles    ]    `-> 
    U.             10:16  [         F. Gr.          ]  custom-theme-load-p
    U.+            15:07  [   jumianek@gmail.com    ]  v mouse does not co
    U.+            17:35  [      Óscar Fuentes      ]  `-> 
    U.             23:27  [        Catonano         ]  v o-blog (helpwith 
    U.  2013-08-31 02:12  [      Jambunathan K      ]  `-> 
    U.             22:26  [        Catonano         ]    `->

I already have these settings

    (setq gnus-summary-line-format "%U%R%z %(%&user-date;  %[%ux%]  %B%s%)\n"
          gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
          gnus-thread-sort-functions '(gnus-thread-sort-by-date))

    (defun gnus-user-format-function-x (header)
        ;;; stuff that fancies up the sender name)

And some more settings, probably irrelevant. I'm thinking I could write
code in `gnus-summary-update-hook' that hides these dates with a
'display property, but wonder if you can come up with anything better...

Thanks,
João



_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cleaner dates in summary buffers
  2013-08-31 23:17 Cleaner dates in summary buffers João Távora
@ 2013-09-01 14:14 ` João Távora
  0 siblings, 0 replies; 2+ messages in thread
From: João Távora @ 2013-09-01 14:14 UTC (permalink / raw)
  To: info-gnus-english

joaotavora@gmail.com (João Távora) writes:

> Hi all,
>
> Is there any way to turn this
>
>     U.  2013-08-30 16:37  [    Julien Cubizolles    ]    `->              
>     U.  2013-08-30 23:27  [        Catonano         ]  v o-blog (helpwith 
>     U.  2013-08-31 02:12  [      Jambunathan K      ]  `-> 
>     U.  2013-08-31 22:26  [        Catonano         ]    `->
>
> Into this?
>
>     U.  2013-08-30 16:37  [    Julien Cubizolles    ]    `-> 
>     U.             23:27  [        Catonano         ]  v o-blog (helpwith 
>     U.  2013-08-31 02:12  [      Jambunathan K      ]  `-> 
>     U.             22:26  [        Catonano         ]    `->
>

Well, this seems to be working:

    (add-hook 'gnus-summary-update-hook
              'joaot/gnus-summary-fancify-date)
     
    (defvar joaot/gnus-date-regexp "^....\\([[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{2\\}\\) .*")
     
    (defun joaot/gnus-summary-fancify-date ()
      (goto-char (point-min))
      (loop with last-date = nil
            while (search-forward-regexp joaot/gnus-date-regexp nil t)
            for this-date = (match-string 1)
            when (and last-date
                      (string= this-date last-date))
            do
            (let ((inhibit-read-only t))
              (add-text-properties (match-beginning 1)
                                   (match-end 1)
                                   `(face (:foreground ,(frame-parameter (selected-frame)
                                                                         'background-color)))))
            do (setq last-date this-date)))

Just in case anyone finds it useful or wants to improve it. The regexp
bit is a little fragile.

J




_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-01 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31 23:17 Cleaner dates in summary buffers João Távora
2013-09-01 14:14 ` João Távora

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).