From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.help Subject: Re: [gnus] How to show mails from an specific mailing list? Date: Tue, 22 Jun 2021 16:30:17 +0300 Message-ID: References: <87mtri1lwk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30050"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: help-gnu-emacs@gnu.org To: Rodrigo Morales Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 22 15:32:16 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvgVj-0007bB-5A for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 22 Jun 2021 15:32:15 +0200 Original-Received: from localhost ([::1]:36412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvgVh-0002Fa-GY for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 22 Jun 2021 09:32:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvgU0-0002FM-6Z for help-gnu-emacs@gnu.org; Tue, 22 Jun 2021 09:30:28 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:40121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvgTv-0001H4-5s for help-gnu-emacs@gnu.org; Tue, 22 Jun 2021 09:30:27 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 159C3E95; Tue, 22 Jun 2021 09:30:20 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 22 Jun 2021 09:30:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=l1RiO7kzl8NdwbwYTS9rk1KO9E dJbv/BcCYfgMQ8fjI=; b=KtMBIgNgbd+bYlcuq3oPiuOCpg9kd5DfhH5zLon7JQ nVy4TDJGp6VNf8iBQqMu3oPVIgI5e4hf90TJ6/Rjj/Faw4qGsqj/cpTvzJyb239s bP1J9REj5PHdmjZxTZCOd0mxn/ftBEszrbNVBVhAU+PpGb6F7VvgVW26L91JsGSc +KbE/sy9gCIpY3yd6V7+3579GG7Ju+7+4R5vOc/d4gl2VsCXbc4ey3lB+lGhLRGm h9VtZ0rKJQmoDMBkPMGPtVkEwNbKKSjMgAKntdmFgNadr/DQVcDSZmLhzUQMAiQ2 U4B7fmHaPV8AP3NdiHeKE2kQDVt4cFWs7TBR15gmOUvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=l1RiO7 kzl8NdwbwYTS9rk1KO9EdJbv/BcCYfgMQ8fjI=; b=kMve9JMQsua9mInNraHE+I MM8Ovo7qojDTVI6841XG45YorWfIBeb604N5vuOkv73CGA54PQNQAdzy1Lz8DMJE 6VTn5rkBd8h/EShL2IjvanQiuVu+NihFdU83XXaK6eg1m0mADLg8f9zom7jSVnZz 3dEerk2fFvhV5Gm2UFEK61szpBhY+d9tSIxQq0YfTs5IPoDRY16DUziU3pshKX+W z7XiyV+TA+04ravs5xizMYZVl/Ceqsz8PhZJ3YVrU6zEb1o4kvPLrfzeDkSLpY04 KTaPmaGcPmZ93LNf3f2jDs/mhdh5gGkOVGgUvzrnv5vdQ2vpWpbcF93YaiYAdeyQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeguddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf grthhtvghrnhepvdevkeffvdeuvefhuddtjeehkedvueefveettddtveduudfgieffieev ieevhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Jun 2021 09:30:18 -0400 (EDT) In-Reply-To: <87mtri1lwk.fsf@gmail.com> (Rodrigo Morales's message of "Tue, 22 Jun 2021 00:57:47 -0500") Received-SPF: pass client-ip=64.147.123.24; envelope-from=fgunbin@fastmail.fm; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131196 Archived-At: 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 ;; ;; ;; mail list to group: (mapcar (lambda (list) (list (car list) (concat "\\(From\\|To\\):.*\\<" (cadr list) "\\>"))) mail-lists) ;; ;; ))) 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