From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87425 Path: news.gmane.org!.POSTED!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.gnus.general Subject: Re: Set gnus-simplify-subject-functions in group parameters? Date: Thu, 16 Mar 2017 19:36:42 +0000 Organization: http://www.tim-landscheidt.de/ Message-ID: <87k27p814l.fsf@passepartout.tim-landscheidt.de> References: <87ino1vwvt.fsf@passepartout.tim-landscheidt.de> <87o9xfjfub.fsf@passepartout.tim-landscheidt.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1489693092 16580 195.159.176.226 (16 Mar 2017 19:38:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Mar 2017 19:38:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35646@lists.math.uh.edu Thu Mar 16 20:38:08 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048035.atla03.us.yomura.com ([107.189.48.35]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cobDq-0003gS-L1 for ding-account@gmane.org; Thu, 16 Mar 2017 20:38:06 +0100 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048035.atla03.us.yomura.com (Halon) with ESMTPS id 15ba3ce7-0a80-11e7-b156-b499baabecb2; Thu, 16 Mar 2017 19:38:10 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.87) (envelope-from ) id 1cobCy-0001KS-EN; Thu, 16 Mar 2017 14:37:12 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cobCv-0001Js-LP for ding@lists.math.uh.edu; Thu, 16 Mar 2017 14:37:09 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1cobCu-0008BF-0M for ding@lists.math.uh.edu; Thu, 16 Mar 2017 14:37:09 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1cobCs-0004J3-Je for ding@gnus.org; Thu, 16 Mar 2017 20:37:06 +0100 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cobCf-0005ED-N8 for ding@gnus.org; Thu, 16 Mar 2017 20:36:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 98 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:gOcqvq7iioF33mmHi2hxYMInDXs= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87425 Archived-At: I wrote: > […] > Thanks, I'll try (something like) that. > […] I found that the solution with gnus-simplify-subject-functions does not meet my use case; I wanted: | [ 35: Wikipedia ] Wikipedia-Seite Diskussion:Lasithi-Hochebene wurde von Langläufer erstellt | [ 41: Wikipedia ] Wikipedia-Seite Lasithi-Hochebene wurde von Langläufer geändert | [ 40: Wikipedia ] Wikipedia-Seite Lasithi wurde von Langläufer geändert to be displayed as: | [ 35: Wikipedia ] Wikipedia-Seite Diskussion:Lasithi-Hochebene wurde von Langläufer erstellt | < 41: Wikipedia > Wikipedia-Seite Lasithi-Hochebene wurde von Langläufer geändert | [ 40: Wikipedia ] Wikipedia-Seite Lasithi wurde von Langläufer geändert However, with gnus-simplify-subject-functions munging the subject, I ended up with (IIRC, did not record it): | [ 35: Wikipedia ] Wikipedia-Seite Diskussion:Lasithi-Hochebene wurde von Langläufer erstellt | [ 41: Wikipedia ] | [ 40: Wikipedia ] Wikipedia-Seite Lasithi wurde von Langläufer geändert i. e. the different subjects were not displayed. So I looked a bit more at the threading code and viewed my prob- lem as the addition of a reference to a fake thread root "Wikipedia page Lasithi-Hochebene". I set the group parame- ters to: | ((gnus-alter-header-function | (lambda | (header) | (let* | ((references | (mail-header-references header)) | (subject | (mail-header-subject header)) | (reference-to-add | (cond | ((string-match "^Wikipedia-Seite \\(Benutzer\\|Hilfe\\|Kategorie\\|Portal\\|Vorlage\\|Wikipedia\\)\\(?: Diskussion\\)?:\\(.*\\) wurde von .* \\(?:erstellt\\|geändert\\|gelöscht\\)$" subject) | (concat | (match-string 1 subject) | ":" | (match-string 2 subject))) | ((string-match "^Wikipedia-Seite \\(?:Diskussion:\\)?\\(.*\\) wurde von .* \\(?:erstellt\\|geändert\\|gelöscht\\)$" subject) | (match-string 1 subject))))) | (if reference-to-add | (let | ((encoded-reference-to-add | (concat "<" | (base64-encode-string reference-to-add t) | "@de.wikipedia.org>"))) | (mail-header-set-references header | (if | (string-equal "" references) | encoded-reference-to-add | (concat references " " encoded-reference-to-add)))))))) | (gnus-summary-thread-gathering-function | (lambda | (threads) | (gnus-gather-threads-by-references threads)))) It is currently not possible to directly set gnus-summary-thread-gathering-function to gnus-gather-threads-by-references due to https://debbugs.gnu.org/26105, so the latter setting works around for that. The function for gnus-alter-header-function should be easy to understand; encoding the page title in Base64 is probably overly cautious and careless at the same time (is "=" legal in message IDs?), but it works for me so far. After a long session with edebug, I also added: | (setq gnus-newsgroup-variables '(gnus-alter-header-function)) to my ~/.emacs. This is necessary because gnus-get-newsgroup-headers-xover calls gnus-nov-parse-line (which calls gnus-alter-header-function) framed by: | […] | (with-current-buffer nntp-server-buffer | […] Without gnus-newsgroup-variables the group parameters are only set for the summary buffer, so gnus-alter-header-function would be always nil (or whatever the global value is). HTH, Tim