emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dba74cb: Allow customizing the Gnus summary thread indicators


From: Lars Ingebrigtsen
Subject: master dba74cb: Allow customizing the Gnus summary thread indicators
Date: Sat, 12 Dec 2020 05:47:24 -0500 (EST)

branch: master
commit dba74cb5ec1c1abfbee236bbcf811b023bb19d4f
Author: Pankaj Jangid <pankaj@codeisgreat.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow customizing the Gnus summary thread indicators
    
    * doc/misc/gnus.texi (Summary Buffer Lines): Document them.
    
    * lisp/gnus/gnus-sum.el (gnus-summary-prepare-threads): Use them.
    
    * lisp/gnus/gnus-sum.el (gnus-sum-opening-bracket)
    (gnus-sum-closing-bracket, gnus-sum-opening-bracket-adopted)
    (gnus-sum-closing-bracket-adopted): New variables.
---
 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 4aa07ce..cfd3ced 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -5028,10 +5028,37 @@ Nothing if the article is a root and lots of spaces if 
it isn't (it
 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 26e4b85..9aa735d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -511,6 +511,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
 page the current article.  If non-nil (the default), go to the
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9432eef..9488b32 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1460,8 +1460,8 @@ the normal Gnus MIME machinery."
     (?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 @@ buffer that was in action when the last article was 
fetched."
       (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 @@ buffer that was in action when the last article was 
fetched."
                       (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 @@ or a straight list of headers."
            (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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]