diff options
| author | Pankaj Jangid | 2020-12-12 11:47:12 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-12-12 11:47:17 +0100 |
| commit | dba74cb5ec1c1abfbee236bbcf811b023bb19d4f (patch) | |
| tree | 2f8c49029418bb39bb913451af9c1900d097fcd1 | |
| parent | 404f12060ca43d100a0609f2658dd487f6a50ebd (diff) | |
| download | emacs-dba74cb5ec1c1abfbee236bbcf811b023bb19d4f.tar.gz emacs-dba74cb5ec1c1abfbee236bbcf811b023bb19d4f.zip | |
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.
| -rw-r--r-- | doc/misc/gnus.texi | 31 | ||||
| -rw-r--r-- | etc/NEWS | 13 | ||||
| -rw-r--r-- | 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 4aa07ce3887..cfd3ceda3ff 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 | |||
| 5028 | pushes everything after it off the screen). | 5028 | pushes everything after it off the screen). |
| 5029 | @item [ | 5029 | @item [ |
| 5030 | Opening bracket, which is normally @samp{[}, but can also be @samp{<} | 5030 | Opening bracket, which is normally @samp{[}, but can also be @samp{<} |
| 5031 | for adopted articles (@pxref{Customizing Threading}). | 5031 | for adopted articles (@pxref{Customizing Threading}). This can be |
| 5032 | customized using following settings: | ||
| 5033 | |||
| 5034 | @table @code | ||
| 5035 | @item gnus-sum-opening-bracket | ||
| 5036 | @vindex gnus-sum-opening-bracket | ||
| 5037 | Opening bracket for normal (non-adopted) articles. The default is | ||
| 5038 | @samp{[}. | ||
| 5039 | |||
| 5040 | @item gnus-sum-opening-bracket-adopted | ||
| 5041 | @vindex gnus-sum-opening-bracket-adopted | ||
| 5042 | Opening bracket for adopted articles. The default is @samp{<}. | ||
| 5043 | |||
| 5044 | @end table | ||
| 5045 | |||
| 5032 | @item ] | 5046 | @item ] |
| 5033 | Closing bracket, which is normally @samp{]}, but can also be @samp{>} | 5047 | Closing bracket, which is normally @samp{]}, but can also be @samp{>} |
| 5034 | for adopted articles. | 5048 | for adopted articles. This can be customised using following settings: |
| 5049 | |||
| 5050 | @table @code | ||
| 5051 | @item gnus-sum-closing-bracket | ||
| 5052 | @vindex gnus-sum-closing-bracket | ||
| 5053 | Closing bracket for normal (non-adopted) articles. The default is | ||
| 5054 | @samp{]}. | ||
| 5055 | |||
| 5056 | @item gnus-sum-closing-bracket-adopted | ||
| 5057 | @vindex gnus-sum-opening-bracket-adopted | ||
| 5058 | Closing bracket for adopted articles. The default is @samp{>}. | ||
| 5059 | |||
| 5060 | @end table | ||
| 5061 | |||
| 5035 | @item > | 5062 | @item > |
| 5036 | One space for each thread level. | 5063 | One space for each thread level. |
| 5037 | @item < | 5064 | @item < |
| @@ -511,6 +511,19 @@ tags to be considered as well. | |||
| 511 | ** Gnus | 511 | ** Gnus |
| 512 | 512 | ||
| 513 | +++ | 513 | +++ |
| 514 | *** New user options to customise the summary line specs %[ and %]. | ||
| 515 | Four new options introduced in customisation group | ||
| 516 | 'gnus-summary-format'. These are 'gnus-sum-opening-bracket', | ||
| 517 | 'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and | ||
| 518 | 'gnus-sum-closing-bracket-adopted'. Their default values are '[', ']', | ||
| 519 | '<', '>' respectively. These variables control the appearance of '%[' | ||
| 520 | and '%]' specs in the summary line format. '%[' will normally display | ||
| 521 | the value of 'gnus-sum-opening-bracket', but can also be | ||
| 522 | 'gnus-sum-opening-bracket-adopted' for the adopted articles. '%]' will | ||
| 523 | normally display the value of 'gnus-sum-closing-bracket', but can also | ||
| 524 | be 'gnus-sum-closing-bracket-adopted' for the adopted articles. | ||
| 525 | |||
| 526 | +++ | ||
| 514 | *** New user option 'gnus-paging-select-next'. | 527 | *** New user option 'gnus-paging-select-next'. |
| 515 | This controls what happens when using commands like 'SPC' and 'DEL' to | 528 | This controls what happens when using commands like 'SPC' and 'DEL' to |
| 516 | page the current article. If non-nil (the default), go to the | 529 | 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 9432eefcb4d..9488b324878 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1460,8 +1460,8 @@ the normal Gnus MIME machinery." | |||
| 1460 | (?I gnus-tmp-indentation ?s) | 1460 | (?I gnus-tmp-indentation ?s) |
| 1461 | (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | 1461 | (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) |
| 1462 | (?R gnus-tmp-replied ?c) | 1462 | (?R gnus-tmp-replied ?c) |
| 1463 | (?\[ gnus-tmp-opening-bracket ?c) | 1463 | (?\[ gnus-tmp-opening-bracket ?s) |
| 1464 | (?\] gnus-tmp-closing-bracket ?c) | 1464 | (?\] gnus-tmp-closing-bracket ?s) |
| 1465 | (?\> (make-string gnus-tmp-level ? ) ?s) | 1465 | (?\> (make-string gnus-tmp-level ? ) ?s) |
| 1466 | (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) | 1466 | (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) |
| 1467 | (?i gnus-tmp-score ?d) | 1467 | (?i gnus-tmp-score ?d) |
| @@ -3748,6 +3748,30 @@ buffer that was in action when the last article was fetched." | |||
| 3748 | (inline | 3748 | (inline |
| 3749 | (gnus-summary-extract-address-component gnus-tmp-from)))))) | 3749 | (gnus-summary-extract-address-component gnus-tmp-from)))))) |
| 3750 | 3750 | ||
| 3751 | (defcustom gnus-sum-opening-bracket "[" | ||
| 3752 | "With %[ spec, used to identify normal (non-adopted) articles." | ||
| 3753 | :version "28.1" | ||
| 3754 | :type 'string | ||
| 3755 | :group 'gnus-summary-format) | ||
| 3756 | |||
| 3757 | (defcustom gnus-sum-closing-bracket "]" | ||
| 3758 | "With %] spec, used to identify normal (non-adopted) articles." | ||
| 3759 | :version "28.1" | ||
| 3760 | :type 'string | ||
| 3761 | :group 'gnus-summary-format) | ||
| 3762 | |||
| 3763 | (defcustom gnus-sum-opening-bracket-adopted "<" | ||
| 3764 | "With %[ spec, used to identify adopted articles." | ||
| 3765 | :version "28.1" | ||
| 3766 | :type 'string | ||
| 3767 | :group 'gnus-summary-format) | ||
| 3768 | |||
| 3769 | (defcustom gnus-sum-closing-bracket-adopted ">" | ||
| 3770 | "With %] spec, used to identify adopted articles." | ||
| 3771 | :version "28.1" | ||
| 3772 | :type 'string | ||
| 3773 | :group 'gnus-summary-format) | ||
| 3774 | |||
| 3751 | (defun gnus-summary-insert-line (header level current undownloaded | 3775 | (defun gnus-summary-insert-line (header level current undownloaded |
| 3752 | unread replied expirable subject-or-nil | 3776 | unread replied expirable subject-or-nil |
| 3753 | &optional dummy score process) | 3777 | &optional dummy score process) |
| @@ -3805,8 +3829,14 @@ buffer that was in action when the last article was fetched." | |||
| 3805 | (1+ (match-beginning 0)) (1- (match-end 0)))) | 3829 | (1+ (match-beginning 0)) (1- (match-end 0)))) |
| 3806 | (t gnus-tmp-from))) | 3830 | (t gnus-tmp-from))) |
| 3807 | (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | 3831 | (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) |
| 3808 | (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | 3832 | (gnus-tmp-opening-bracket |
| 3809 | (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | 3833 | (if gnus-tmp-dummy |
| 3834 | gnus-sum-opening-bracket-adopted | ||
| 3835 | gnus-sum-opening-bracket)) | ||
| 3836 | (gnus-tmp-closing-bracket | ||
| 3837 | (if gnus-tmp-dummy | ||
| 3838 | gnus-sum-closing-bracket-adopted | ||
| 3839 | gnus-sum-closing-bracket)) | ||
| 3810 | (inhibit-read-only t)) | 3840 | (inhibit-read-only t)) |
| 3811 | (when (string= gnus-tmp-name "") | 3841 | (when (string= gnus-tmp-name "") |
| 3812 | (setq gnus-tmp-name gnus-tmp-from)) | 3842 | (setq gnus-tmp-name gnus-tmp-from)) |
| @@ -5439,10 +5469,10 @@ or a straight list of headers." | |||
| 5439 | (if (and (eq gnus-summary-make-false-root 'adopt) | 5469 | (if (and (eq gnus-summary-make-false-root 'adopt) |
| 5440 | (= gnus-tmp-level 1) | 5470 | (= gnus-tmp-level 1) |
| 5441 | (memq number gnus-tmp-gathered)) | 5471 | (memq number gnus-tmp-gathered)) |
| 5442 | (setq gnus-tmp-opening-bracket ?\< | 5472 | (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket-adopted |
| 5443 | gnus-tmp-closing-bracket ?\>) | 5473 | gnus-tmp-closing-bracket gnus-sum-closing-bracket-adopted) |
| 5444 | (setq gnus-tmp-opening-bracket ?\[ | 5474 | (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket |
| 5445 | gnus-tmp-closing-bracket ?\])) | 5475 | gnus-tmp-closing-bracket gnus-sum-closing-bracket)) |
| 5446 | (if (>= gnus-tmp-level (length gnus-thread-indent-array)) | 5476 | (if (>= gnus-tmp-level (length gnus-thread-indent-array)) |
| 5447 | (gnus-make-thread-indent-array | 5477 | (gnus-make-thread-indent-array |
| 5448 | (max (* 2 (length gnus-thread-indent-array)) | 5478 | (max (* 2 (length gnus-thread-indent-array)) |