From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20298 invoked from network); 25 Nov 2020 19:16:29 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 25 Nov 2020 19:16:29 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1ki0Fr-00CDYq-2p; Wed, 25 Nov 2020 13:15:03 -0600 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1ki0Fq-00DNai-E2; Wed, 25 Nov 2020 13:15:02 -0600 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1ki0Fl-00DNYv-1q for ding@lists.math.uh.edu; Wed, 25 Nov 2020 13:14:57 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1ki0Fi-0015rN-FL for ding@lists.math.uh.edu; Wed, 25 Nov 2020 13:14:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QoYP0GS36Y+aqYD138V/z9fNB4f0ZGP9TQ4hcv81Eaw=; b=ZkDvmuCu3bbj0rxuel3omikgf/ 6sangiXlOw7z05vcMArw3aQ9S/YtYHaCL5ZYGLijRojrGF1ZiELwP+NjvpcRpfkjdCxXRRZYBQf8O GorttDJdDWLwgA5lsgfCUJd4JJt1SJ1XfgzYMbGGfVod96h2bMwOlYFhcJUo8I+PD8GA=; Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ki0FV-0001pu-QM for ding@gnus.org; Wed, 25 Nov 2020 20:14:49 +0100 Received: by mail-pf1-x432.google.com with SMTP id x24so3248064pfn.6 for ; Wed, 25 Nov 2020 11:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeisgreat-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:mail-followup-to:date :in-reply-to:message-id:user-agent:mime-version; bh=QoYP0GS36Y+aqYD138V/z9fNB4f0ZGP9TQ4hcv81Eaw=; b=LbEE5HzfbNJBFAFqDYc0007DNFSuprGONydTBg/TleY0wlMdBG90qOJZ93F9B5/2DH NKvhE5LV8ni69RaVfT6qfvZve2l12q5VL5oWaiWABGiBl7Ud0b7hpCb/Ox9NKR4/MqI/ UJMzr9N8YlCRsIrbsyzHa6pMVLDYV+vIbkZgb9QSo9Xcro38Q4rOwXy5doEyjvWuzqCa b0G0YHPMrZzZ58w2L8ppN/Eh+F/5Qxn7ED/LY8jEFJ9p6TTX76zmkQiJLmG7dz0/uBBg 2vB+suzZTZSnMaEAwXlhXgS5oixP+LApkYRMY54wjdC3uX9GCY/CI85Xb0CK2A+h9FDe +Vuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references :mail-followup-to:date:in-reply-to:message-id:user-agent :mime-version; bh=QoYP0GS36Y+aqYD138V/z9fNB4f0ZGP9TQ4hcv81Eaw=; b=dV9N5+lgLbqt5EeAQmF4ol9VJT3MO0H8XqAkynl0R4yCSHdOvFc0/XYwSv0Cj5m72d MIP18tTya4YSz+/u/s1HswKnpTgtA0Eh8bticwVYxaGggrVWOiFvHiSJfc4En7GfGizJ DA/OrKTZ2W3WkPacZkJ++8i2grQ/oR9sryfrXuWspkG0iB/AHLdECSlMUasO/SUxQBW0 XeZvpd4dyXmyWBeEVaufUcLfLAclGhZoO2HGpAeTKMa1yvo7aglSSQFVwMGyD03nfqky sFprtVKgSgjJWm3R0yKRqekOe2OuW46g2ApF/44RrfMc0iNC6LwSzd94b04rVvqxUUtp ac1w== X-Gm-Message-State: AOAM5331FZN7f7YVn1wEFbPV1rnqeDHjQtlhwWoaKg58ASOwi6zwjnvi PuTkmz9Fzy+ZS7wq0g1wWOlPel1OFQIkMA== X-Google-Smtp-Source: ABdhPJxTDMXbfWUpo0lyd+ymj49m58+HoJfF+fSPh63JDQt08PBf/+uVFnrRFOxlFCvmeRUPpRgUgQ== X-Received: by 2002:a17:90b:3355:: with SMTP id lm21mr3725326pjb.115.1606331678693; Wed, 25 Nov 2020 11:14:38 -0800 (PST) Received: from mb2.local ([2405:201:5c06:7812:dc99:f60a:f48a:145e]) by smtp.gmail.com with ESMTPSA id a23sm2659730pgv.35.2020.11.25.11.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 11:14:38 -0800 (PST) From: Pankaj Jangid To: Lars Ingebrigtsen Cc: Gnus Users Subject: Re: Customizing %[, %] and fill width Organization: Code Is Great Foundation References: <87y2ipzj9g.fsf@gnus.org> Mail-Followup-To: Lars Ingebrigtsen , Gnus Users Date: Thu, 26 Nov 2020 00:44:35 +0530 In-Reply-To: <87y2ipzj9g.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 25 Nov 2020 13:57:31 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-ID: Precedence: bulk --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: >> 1. %[%] produce contextual output either `[]' or `<>' depending upon >> whether the entry is real child or adopted. Is there a way to customize >> these two output values? > (defun gnus-summary-insert-line (header level current undownloaded > [...] > (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) > (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) > > Patches to fix this are welcome. This is working on my build. Is this patch acceptable? Should I submit it via M-x submit-emacs-patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-New-user-options-to-customise-the-summary-line-specs.patch >From 4b4d68f8a15fd9481304344c041e1c6b4f148125 Mon Sep 17 00:00:00 2001 From: Pankaj Jangid Date: Thu, 26 Nov 2020 00:34:48 +0530 Subject: [PATCH] New user options to customise the summary line specs %[ and %]. Four new options are introduced - 'gnus-sum-opening-bracket', 'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and 'gnus-sum-closing-bracket-adopted'. * doc/misc/gnus.text: documentation added for the new options * etc/NEWS: entry for new options * lisp/gnus/gnus-sum.el: implementation for new options --- doc/misc/gnus.texi | 31 +++++++++++++++++++++++++++-- etc/NEWS | 13 ++++++++++++ lisp/gnus/gnus-sum.el | 46 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 80 insertions(+), 10 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 81ce13945c..0aa881ba12 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5028,10 +5028,37 @@ Summary Buffer Lines pushes everything after it off the screen). @item [ Opening bracket, which is normally @samp{[}, but can also be @samp{<} -for adopted articles (@pxref{Customizing Threading}). +for adopted articles (@pxref{Customizing Threading}). This can be +customized using following settings: + +@table @code +@item gnus-sum-opening-bracket +@vindex gnus-sum-opening-bracket +Opening bracket for normal (non-adopted) articles. The default is +@samp{[}. + +@item gnus-sum-opening-bracket-adopted +@vindex gnus-sum-opening-bracket-adopted +Opening bracket for adopted articles. The default is @samp{<}. + +@end table + @item ] Closing bracket, which is normally @samp{]}, but can also be @samp{>} -for adopted articles. +for adopted articles. This can be customised using following settings: + +@table @code +@item gnus-sum-closing-bracket +@vindex gnus-sum-closing-bracket +Closing bracket for normal (non-adopted) articles. The default is +@samp{]}. + +@item gnus-sum-closing-bracket-adopted +@vindex gnus-sum-opening-bracket-adopted +Closing bracket for adopted articles. The default is @samp{>}. + +@end table + @item > One space for each thread level. @item < diff --git a/etc/NEWS b/etc/NEWS index 9091643da5..18fdb6121a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -488,6 +488,19 @@ tags to be considered as well. ** Gnus ++++ +*** New user options to customise the summary line specs %[ and %]. +Four new options introduced in customisation group +'gnus-summary-format'. These are 'gnus-sum-opening-bracket', +'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and +'gnus-sum-closing-bracket-adopted'. Their default values are '[', ']', +'<', '>' respectively. These variables control the appearance of '%[' +and '%]' specs in the summary line format. '%[' will normally display +the value of 'gnus-sum-opening-bracket', but can also be +'gnus-sum-opening-bracket-adopted' for the adopted articles. '%]' will +normally display the value of 'gnus-sum-closing-bracket', but can also +be 'gnus-sum-closing-bracket-adopted' for the adopted articles. + +++ *** New user option 'gnus-paging-select-next'. This controls what happens when using commands like `SPC' and `DEL' to diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 469fa36fb7..c5943cebaf 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1460,8 +1460,8 @@ gnus-summary-line-format-alist (?I gnus-tmp-indentation ?s) (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) (?R gnus-tmp-replied ?c) - (?\[ gnus-tmp-opening-bracket ?c) - (?\] gnus-tmp-closing-bracket ?c) + (?\[ gnus-tmp-opening-bracket ?s) + (?\] gnus-tmp-closing-bracket ?s) (?\> (make-string gnus-tmp-level ? ) ?s) (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) (?i gnus-tmp-score ?d) @@ -3748,6 +3748,30 @@ gnus-summary-from-or-to-or-newsgroups (inline (gnus-summary-extract-address-component gnus-tmp-from)))))) +(defcustom gnus-sum-opening-bracket "[" + "With %[ spec, used to identify normal (non-adopted) articles." + :version "28.1" + :type 'string + :group 'gnus-summary-format) + +(defcustom gnus-sum-closing-bracket "]" + "With %] spec, used to identify normal (non-adopted) articles." + :version "28.1" + :type 'string + :group 'gnus-summary-format) + +(defcustom gnus-sum-opening-bracket-adopted "{" + "With %[ spec, used to identify adopted articles." + :version "28.1" + :type 'string + :group 'gnus-summary-format) + +(defcustom gnus-sum-closing-bracket-adopted "}" + "With %] spec, used to identify adopted articles." + :version "28.1" + :type 'string + :group 'gnus-summary-format) + (defun gnus-summary-insert-line (header level current undownloaded unread replied expirable subject-or-nil &optional dummy score process) @@ -3805,8 +3829,14 @@ gnus-summary-insert-line (1+ (match-beginning 0)) (1- (match-end 0)))) (t gnus-tmp-from))) (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) - (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) - (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) + (gnus-tmp-opening-bracket + (if gnus-tmp-dummy + gnus-sum-opening-bracket-adopted + gnus-sum-opening-bracket)) + (gnus-tmp-closing-bracket + (if gnus-tmp-dummy + gnus-sum-closing-bracket-adopted + gnus-sum-closing-bracket)) (inhibit-read-only t)) (when (string= gnus-tmp-name "") (setq gnus-tmp-name gnus-tmp-from)) @@ -5439,10 +5469,10 @@ gnus-summary-prepare-threads (if (and (eq gnus-summary-make-false-root 'adopt) (= gnus-tmp-level 1) (memq number gnus-tmp-gathered)) - (setq gnus-tmp-opening-bracket ?\< - gnus-tmp-closing-bracket ?\>) - (setq gnus-tmp-opening-bracket ?\[ - gnus-tmp-closing-bracket ?\])) + (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket-adopted + gnus-tmp-closing-bracket gnus-sum-closing-bracket-adopted) + (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket + gnus-tmp-closing-bracket gnus-sum-closing-bracket)) (if (>= gnus-tmp-level (length gnus-thread-indent-array)) (gnus-make-thread-indent-array (max (* 2 (length gnus-thread-indent-array)) -- 2.29.2 --=-=-=--