Gnus development mailing list
 help / color / mirror / Atom feed
From: Pankaj Jangid <pankaj@codeisgreat.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Gnus Users <ding@gnus.org>
Subject: Re: Customizing %[, %] and fill width
Date: Sat, 12 Dec 2020 10:52:13 +0530	[thread overview]
Message-ID: <m2lfe3vbsq.fsf@codeisgreat.org> (raw)
In-Reply-To: <87h7pcuza8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Nov 2020 12:34:55 +0100")

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> I am definitely willing to sign the papers. Please let me know the
>> process.
>
> Great!    (Form sent off-list.)
>
> When the process has completed, please send a mail reminding me to push
> this patch.

Hi Lars,

Got the signed paper. Yeah!

Attached is the patch rebased with ‘master’. I have been doing it daily
to prevent merging issues at the last moment. :-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-New-user-options-to-customise-the-summary-line-specs.patch --]
[-- Type: text/x-patch, Size: 6234 bytes --]

From a67e7c9803fe24b8f235a507cc3d2f203b7c6bc5 Mon Sep 17 00:00:00 2001
From: Pankaj Jangid <pankaj@codeisgreat.org>
Date: Fri, 27 Nov 2020 00:33:25 +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 4aa07ce388..3d04f170bb 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 26e4b8514f..5a4a89245f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -510,6 +510,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 9432eefcb4..9488b32487 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


[-- Attachment #3: Type: text/plain, Size: 26 bytes --]


--
Regards
Pankaj Jangid

  parent reply	other threads:[~2020-12-12  5:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 12:54 Pankaj Jangid
2020-11-25 12:57 ` Lars Ingebrigtsen
2020-11-25 19:14   ` Pankaj Jangid
     [not found]     ` <87eekgxv9i.fsf@gnus.org>
     [not found]       ` <m2pn40tl3n.fsf@codeisgreat.org>
     [not found]         ` <87h7pcuza8.fsf@gnus.org>
2020-12-12  5:22           ` Pankaj Jangid [this message]
2020-12-12 10:47             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lfe3vbsq.fsf@codeisgreat.org \
    --to=pankaj@codeisgreat.org \
    --cc=ding@gnus.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).