all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [gnus] How to show mails from an specific mailing list?
@ 2021-06-22  5:57 Rodrigo Morales
  2021-06-22  8:30 ` Daniel Martín
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rodrigo Morales @ 2021-06-22  5:57 UTC (permalink / raw)
  To: help-gnu-emacs


I'm currently using Gnus with the following configuration

#+BEGIN_SRC elisp
(add-to-list 'gnus-secondary-select-methods
	     '(nnmaildir "personal"
			 (directory "~/.mail/personal/")))
#+END_SRC

I sometimes want to read mails from an specific mailing list. However,
since I'm on multiple mailing lists, the Summary buffer show messages
from all mailing lists. My question is: Is there any way to make Gnus
show messages from a given mailing list?

I've recently started to use local mailboxes so I'm no mail expert but,
apparently, local messages store the mailing list they belong to in its
metadata since "mu" (an external utility, https://github.com/djcb/mu)
can show the mailing list as a field for each message when searching
(see code block below).

#+BEGIN_SRC dash
mu find -f 'v' maildir:/personal/ | sort -u | grep 'emacs'
#+END_SRC

#+RESULTS:
#+BEGIN_EXAMPLE
bug-gnu-emacs.gnu.org
emacs-devel.gnu.org
emacs-diffs.gnu.org
emacs-orgmode.gnu.org
help-gnu-emacs.gnu.org
info-gnu-emacs.gnu.org
#+END_EXAMPLE

#+BEGIN_SRC dash
mu find maildir:/personal/ list:help-gnu-emacs.gnu.org | wc -l
#+END_SRC

#+RESULTS:
#+BEGIN_EXAMPLE
7431
#+END_EXAMPLE

Any help is appreciated,
Rodrigo Morales.



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

* Re: [gnus] How to show mails from an specific mailing list?
  2021-06-22  5:57 [gnus] How to show mails from an specific mailing list? Rodrigo Morales
@ 2021-06-22  8:30 ` Daniel Martín
  2021-06-22  8:31 ` Eric S Fraga
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Daniel Martín @ 2021-06-22  8:30 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: help-gnu-emacs

Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:

>
> I sometimes want to read mails from an specific mailing list. However,
> since I'm on multiple mailing lists, the Summary buffer show messages
> from all mailing lists. My question is: Is there any way to make Gnus
> show messages from a given mailing list?
>

You can filter or search mailing list messages using the "List-Id" mail
header (see RFC 2919).

If you want to categorize mail from Gnus, read section "6.4.3 Splitting
Mail" of the Gnus Info documentation.



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

* Re: [gnus] How to show mails from an specific mailing list?
  2021-06-22  5:57 [gnus] How to show mails from an specific mailing list? Rodrigo Morales
  2021-06-22  8:30 ` Daniel Martín
@ 2021-06-22  8:31 ` Eric S Fraga
  2021-06-22 13:30 ` Filipp Gunbin
  2021-06-26  0:01 ` Emanuel Berg via Users list for the GNU Emacs text editor
  3 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2021-06-22  8:31 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, 22 Jun 2021 at 00:57, Rodrigo Morales wrote:
> I sometimes want to read mails from an specific mailing list. 

If the mailing list sets the List-Id: header, you can use the "/h"
command in the gnus summary buffer to limit to headers that match a
particular regex, e.g. something along the lines of

/h ^List-Id:.*emacs-dev

might do the job.

The /x (for different x) limit commands are quite useful.  For the
above, you will want to have the summary show old messages as well (/o)
before applying the /h limit view.
-- 
Eric S Fraga via Emacs 28.0.50 & org 9.4.6 on Debian bullseye/sid




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

* Re: [gnus] How to show mails from an specific mailing list?
  2021-06-22  5:57 [gnus] How to show mails from an specific mailing list? Rodrigo Morales
  2021-06-22  8:30 ` Daniel Martín
  2021-06-22  8:31 ` Eric S Fraga
@ 2021-06-22 13:30 ` Filipp Gunbin
  2021-06-26  0:01 ` Emanuel Berg via Users list for the GNU Emacs text editor
  3 siblings, 0 replies; 5+ messages in thread
From: Filipp Gunbin @ 2021-06-22 13:30 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: help-gnu-emacs

On 22/06/2021 00:57 -0500, Rodrigo Morales wrote:

> I sometimes want to read mails from an specific mailing list. However,
> since I'm on multiple mailing lists, the Summary buffer show messages
> from all mailing lists. My question is: Is there any way to make Gnus
> show messages from a given mailing list?

I use client splitting and a mapping file, like this.

File contains lines like:

ml.auctex auctex@gnu.org
ml.auctex-devel auctex-devel@gnu.org
ml.bash-announce bash-announce@gnu.org
ml.bash-bug bug-bash@gnu.org

Then in .gnus.el I do:

(let ((mail-lists (fg-dotemacs-read-group-to-email
                   "~/file.txt")))
  (setq nnmail-split-methods
        (nconc
         ;; <any rules before...>
         ;;
         ;; mail list to group:
         (mapcar (lambda (list)
                   (list (car list)
                         (concat "\\(From\\|To\\):.*\\<" (cadr list) "\\>")))
                 mail-lists)
         ;;
         ;; <any rules after...>
         )))

Supporting functions:

(defun fg-dotemacs-read-group-to-email (file)
  "Read mappings from FILE and return list of entries (GROUP-NAME
EMAIL).  Each line should be like: 'ml.my-list
my-list@example.org', email is treated as literal and
regexp-quoted."
  (mapcar (lambda (list)
            (if (= (length list) 2)
                (list (car list) (regexp-quote (cadr list)))
              (error "Invalid line: %S" list)))
          (mapcar #'split-string
                  (fg-dotemacs-read-lines file))))

(defun fg-dotemacs-read-lines (file)
  "Returns all non-blank lines of FILE as a list of strings.
Leading and trailing whitespace is trimmed off.  If the first
non-whitespace character on a line is '#' then the line is
treated as comment and skipped."
  (let (res)
    (with-temp-buffer
      (insert-file-contents (expand-file-name file))
      (while (not (eobp))
        (beginning-of-line)
        (unless (looking-at "[ \t]*$\\|[ \t]*#")
          (push (string-trim
                 (buffer-substring (point) (line-end-position)))
                res))
        (forward-line)))
    (nreverse res)))

There's also "fancy splitting", you can read about it in (info "(gnus)
Fancy Mail Splitting"), I haven't checked it yet.

Filipp



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

* Re: [gnus] How to show mails from an specific mailing list?
  2021-06-22  5:57 [gnus] How to show mails from an specific mailing list? Rodrigo Morales
                   ` (2 preceding siblings ...)
  2021-06-22 13:30 ` Filipp Gunbin
@ 2021-06-26  0:01 ` Emanuel Berg via Users list for the GNU Emacs text editor
  3 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-26  0:01 UTC (permalink / raw)
  To: help-gnu-emacs

Rodrigo Morales wrote:

> I'm currently using Gnus with the following configuration
>
> #+BEGIN_SRC elisp
> (add-to-list 'gnus-secondary-select-methods
> 	     '(nnmaildir "personal"
> 			 (directory "~/.mail/personal/")))
> #+END_SRC
>
> I sometimes want to read mails from an specific mailing
> list. However, since I'm on multiple mailing lists, the
> Summary buffer show messages from all mailing lists.
> My question is: Is there any way to make Gnus show messages
> from a given mailing list?

With Gnus and mailing lists its Gmane who does all of that for
you...

  https://gmane.io/

It says "It currently only allows access to the archive via
NNTP on news.gmane.io." Heh, "only" - that's what people care
for :)

(also "archive" BTW, LOL)

-- 
underground experts united
https://dataswamp.org/~incal




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

end of thread, other threads:[~2021-06-26  0:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-22  5:57 [gnus] How to show mails from an specific mailing list? Rodrigo Morales
2021-06-22  8:30 ` Daniel Martín
2021-06-22  8:31 ` Eric S Fraga
2021-06-22 13:30 ` Filipp Gunbin
2021-06-26  0:01 ` Emanuel Berg via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.