Re: adding date to the summary buffer
Response below/inline for email gfp wrote: > (original email sent 21 Jan 2025 at 14:34) > > Hi, > > thanks very much. > It worked. Excellent. > I am reading the manual every day, I read also that already twice, > but my problem is that I am still on a low level, > so I can´t put it into practice yet. Understood. We all have to start somewhere. My advice was in particular to have a look at the description for the variable which defines the format of the summary line, M-x describe-variable RET gnus-summary-line-format RET as it describes each and every % directive in such a format. Starting with what I gave you may be the wrong starting point as it has many possibly superfluous bits of information... -- Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8
Re: adding date to the summary buffer
I have the following: --8<---cut here---start->8--- (setq gnus-user-date-format-alist '(((gnus-seconds-today) . " %k:%M") ((+ (gnus-seconds-today) (* 24 3600)) . " %l %p") (604800 . " %a") (31536000 . "%e %b") (t . " %Y"))) (setq gnus-summary-line-format "%1{%U%R%O %4k%} %3{%&user-date;%*%uj│%}%I%(%-16,16f%) %5{%s%}\n") --8<---cut here---end--->8--- which presents the date in more refined detail the newer the post is. Very old posts show just the year; newer ones the month and day; even newer the day and time; and the newest with the time alone. The %1, %3, and %5 refer to faces used by the summary line. As always in Emacs, "help" is your friend. Try "M-x describe-variable" for each of those two variables above. -- Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8
Re: adding date to the summary buffer
Response below/inline for email Gottfried wrote: > (original email sent 21 Jan 2025 at 11:48) > > HI, > > thanks to all for help > > using your proposal says: > > Debugger entered--Lisp error: (void-variable gnus-face-5) > I checked that, but I don´t know at the moment what to change in face 5. You may have to define the faces for gnus, e.g.: (setq gnus-face-5 'gnus-button) I.e. set the face to an existing one that matches what you want M-x list-faces-display RET or create your own face if you wish. -- Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8
Re: adding date to the summary buffer
Response below/inline for email Gottfried wrote: > (original email sent 21 Jan 2025 at 13:22) > > now comes up another Lisp error: Can I suggest you read the documentation for the gnus-summary-line-format so that you can remove any offending fields? Otherwise, this becomes a rabbit hole! In this case, instead of passing on my user defined function "j" (which would need eliding to share), simply remove the "%uj" bit in the middle of the format specification, maybe replacing it with a space. E.g. (setq gnus-summary-line-format "%1{%U%R%O %4k%} %3{%&user-date;%* │%}%I%(%-16,16f%) %5{%s%}\n") should hopefully work. -- Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8
Re: adding date to the summary buffer
Hi, thanks now comes up another Lisp error: Debugger entered--Lisp error: (void-function gnus-user-format-function-j) (gnus-user-format-function-j gnus-tmp-header) (insert (gnus-user-format-function-j gnus-tmp-header) "│") (progn (insert (gnus-user-date (mail-header-date gnus-tmp-header))) (setq gnus-position (point)) (insert (gnus-user-format-function-j gnus-tmp-header) "│") (point)) (add-text-properties (point) (progn (insert (gnus-user-date (mail-header-date gnus-tmp-header))) (setq gnus-position (point)) (insert (gnus-user-format-function-j gnus-tmp-header) "│") (point)) (cons 'face (cons (list 'bold 'default) '(gnus-face t (let (gnus-position) (add-text-properties (point) (progn (insert (format "%c%c%c %4s" gnus-tmp-unread gnus-tmp-replied gnus-tmp-downloaded (gnus-summary-line-message-size gnus-tmp-header))) (point)) (cons 'face (cons (list 'italic 'default) '(gnus-face t (insert " ") (add-text-properties (point) (progn (insert (gnus-user-date (mail-header-date gnus-tmp-header))) (setq gnus-position (point)) (insert (gnus-user-format-function-j gnus-tmp-header) "│") (point)) (cons 'face (cons (list 'bold 'default) '(gnus-face t (insert gnus-tmp-indentation) (put-text-property (point) (progn (insert (format "%-16s" (let* ((val ...) (need ...)) (if (> need 0) (concat nil val ...) val (point)) 'mouse-face gnus-mouse-face) (insert " ") (add-text-properties (point) (progn (insert gnus-tmp-subject-or-nil) (point)) (cons 'face (cons (list 'gnus-button 'default) '(gnus-face t (insert "\n") (if gnus-position (put-text-property gnus-position (1+ gnus-position) 'gnus-position t))) gnus-summary-prepare-threads((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) gnus-summary-prepare() gnus-summary-read-group-1("nntp+news.eternal-september.org:alt.comp.software" nil t nil nil nil) gnus-summary-read-group("nntp+news.eternal-september.org:alt.comp.software" nil t nil nil nil nil) gnus-group-read-group(nil t) gnus-group-select-group(nil) funcall-interactively(gnus-group-select-group nil) call-interactively(gnus-group-select-group nil nil) command-execute(gnus-group-select-group) my gnus.el: (setq gnus-user-date-format-alist '(((gnus-seconds-today) . " %k:%M") ((+ (gnus-seconds-today) (* 24 3600)) . " %l %p") (604800 . " %a") (31536000 . "%e %b") (t . " %Y"))) (setq gnus-summary-line-format "%1{%U%R%O %4k%} %3{%&user-date;%*%uj│%}%I%(%-16,16f%) %5{%s%}\n") (setq gnus-face-5 'gnus-button) Gottfried Am 21.01.25 um 12:54 schrieb Fraga, Eric: Response below/inline for email Gottfried wrote: (original email sent 21 Jan 2025 at 11:48) HI, thanks to all for help using your proposal says: Debugger entered--Lisp error: (void-variable gnus-face-5) I checked that, but I don´t know at the moment what to change in face 5. You may have to define the faces for gnus, e.g.: (setq gnus-face-5 'gnus-button) I.e. set the face to an existing one that matches what you want M-x list-faces-display RET or create your own face if you wish. OpenPGP_0x61FAF349C9FB7F94.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature
Re: adding date to the summary buffer
HI, thanks to all for help using your proposal says: Debugger entered--Lisp error: (void-variable gnus-face-5) gnus-face-face-function(((insert gnus-tmp-subject-or-nil)) 5) #f(compiled-function (sform) #)((face 5 "%s")) gnus-complex-form-to-spec(("" (face 1 "%U%R%O %4k") " " (face 3 "%&user-date;" (point) "%uj│") "%I" (mouse 0 "%-16,16f") " " (face 5 "%s") "\n") ((78 (mail-header-number gnus-tmp-header) 100) (83 (mail-header-subject gnus-tmp-header) 115) (115 gnus-tmp-subject-or-nil 115) (110 gnus-tmp-name 115) (65 (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) 115) (97 (or (car (funcall gnus-extract-address-components gnus-tmp-from)) gnus-tmp-from) 115) (70 gnus-tmp-from 115) (120 (mail-header-xref gnus-tmp-header) 115) (68 (mail-header-date gnus-tmp-header) 115) (100 (gnus-dd-mmm (mail-header-date gnus-tmp-header)) 115) (111 (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) 115) (77 (mail-header-id gnus-tmp-header) 115) (114 (mail-header-references gnus-tmp-header) 115) (99 (or (mail-header-chars gnus-tmp-header) 0) 100) (107 (gnus-summary-line-message-size gnus-tmp-header) 115) (76 gnus-tmp-lines 115) (90 (or (nnselect-article-rsv (mail-header-number gnus-tmp-header)) 0) 100) (71 (or (nnselect-article-group (mail-header-number gnus-tmp-header)) "") 115) (103 (or (gnus-group-short-name (nnselect-article-group (mail-header-number gnus-tmp-header))) "") 115) (79 gnus-tmp-downloaded 99) (73 gnus-tmp-indentation 115) (84 (if (= gnus-tmp-level 0) "" (make-string (frame-width) 32)) 115) (82 gnus-tmp-replied 99) (91 gnus-tmp-opening-bracket 115) (93 gnus-tmp-closing-bracket 115) (62 (make-string gnus-tmp-level 32) 115) (60 (make-string (max 0 (- 20 gnus-tmp-level)) 32) 115) (105 gnus-tmp-score 100) (122 gnus-tmp-score-char 99) (86 (gnus-thread-total-score (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread))) 100) (85 gnus-tmp-unread 99) (102 (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from) 115) (116 (gnus-summary-number-of-articles-in-thread (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level) 100) (101 (gnus-summary-number-of-articles-in-thread (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level t) 99) (117 gnus-tmp-user-defined 115) (80 (gnus-pick-line-number) 100) (66 gnus-tmp-thread-tree-header-string 115) (user-date (gnus-user-date (mail-header-date gnus-tmp-header)) 115))) gnus-parse-complex-format("%1{%U%R%O %4k%} %3{%&user-date;%*%uj│%}%I%(%-16,16..." ((78 (mail-header-number gnus-tmp-header) 100) (83 (mail-header-subject gnus-tmp-header) 115) (115 gnus-tmp-subject-or-nil 115) (110 gnus-tmp-name 115) (65 (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) 115) (97 (or (car (funcall gnus-extract-address-components gnus-tmp-from)) gnus-tmp-from) 115) (70 gnus-tmp-from 115) (120 (mail-header-xref gnus-tmp-header) 115) (68 (mail-header-date gnus-tmp-header) 115) (100 (gnus-dd-mmm (mail-header-date gnus-tmp-header)) 115) (111 (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) 115) (77 (mail-header-id gnus-tmp-header) 115) (114 (mail-header-references gnus-tmp-header) 115) (99 (or (mail-header-chars gnus-tmp-header) 0) 100) (107 (gnus-summary-line-message-size gnus-tmp-header) 115) (76 gnus-tmp-lines 115) (90 (or (nnselect-article-rsv (mail-header-number gnus-tmp-header)) 0) 100) (71 (or (nnselect-article-group (mail-header-number gnus-tmp-header)) "") 115) (103 (or (gnus-group-short-name (nnselect-article-group (mail-header-number gnus-tmp-header))) "") 115) (79 gnus-tmp-downloaded 99) (73 gnus-tmp-indentation 115) (84 (if (= gnus-tmp-level 0) "" (make-string (frame-width) 32)) 115) (82 gnus-tmp-replied 99) (91 gnus-tmp-opening-bracket 115) (93 gnus-tmp-closing-bracket 115) (62 (make-string gnus-tmp-level 32) 115) (60 (make-string (max 0 (- 20 gnus-tmp-level)) 32) 115) (105 gnus-tmp-score 100) (122 gnus-tmp-score-char 99) (86 (gnus-thread-total-score (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread))) 100) (85 gnus-tmp-unread 99) (102 (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from) 115) (116 (gnus-summary-number-of-articles-in-thread (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level) 100) (101 (gnus-summary-number-of-articles-in-thread (and (boundp 'gnus-tmp-thread) (car gnus-tmp-thread)) gnus-tmp-level t) 99) (117 gnus-tmp-user-defined 115) (80 (gnus-pick-line-number) 100) (66 gnus-tmp-thread-tree-header-string 115) (user-date (gnus-user-date (mail-header-date gnus-tmp-header)) 115))) gnus-parse-format("%1{%U%R%O %4k%} %3{%&user-date;%*%uj│%}%I%(%-16,16..." ((78 (mail-header-number gnus-tmp-header) 100) (83 (mail-header-subject gnus-tmp-header) 115) (115 gnus-tmp-subject-or-nil 115) (110 gnus-tmp-name 115) (65 (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) 115) (97 (or (car (funcall gnus-extract-address-components gnus-tmp-from)) gnus-tmp-from) 115) (70 gnus-
Re: adding date to the summary buffer
Hi, thanks very much. It worked. Can I suggest you read the documentation for the gnus-summary-line-format so that you can remove any offending fields? I am reading the manual every day, I read also that already twice, but my problem is that I am still on a low level, so I can´t put it into practice yet. I would need examples, that one setting looks like this, an other setting looks like that, in order to learn quicker. Kind regards, gfp (shorter form of my name) Am 21.01.25 um 14:27 schrieb Fraga, Eric: Response below/inline for email Gottfried wrote: (original email sent 21 Jan 2025 at 13:22) now comes up another Lisp error: Can I suggest you read the documentation for the gnus-summary-line-format so that you can remove any offending fields? Otherwise, this becomes a rabbit hole! In this case, instead of passing on my user defined function "j" (which would need eliding to share), simply remove the "%uj" bit in the middle of the format specification, maybe replacing it with a space. E.g. (setq gnus-summary-line-format "%1{%U%R%O %4k%} %3{%&user-date;%* │%}%I%(%-16,16f%) %5{%s%}\n") should hopefully work. OpenPGP_0xD9E413C6C4BB32CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature
Re: adding date to the summary buffer
Hi all, thanks very much for helping me. I tried every hint from all of you and checked what it looks like. My advice was in particular to have a look at the description for the variable which defines the format of the summary line, M-x describe-variable RET gnus-summary-line-format RET I read also that. What does the number -16,16 say? │%}%I%(%-16,16f%) the default was: -23,23 [%4L: %-23,23f%] I found this: gnus-summary-line-format: %I Indentation based on thread level (a string of spaces) Still I don`t know what the number exactly mean. Kind regards gfp Am 21.01.25 um 15:43 schrieb Fraga, Eric: Response below/inline for email gfp wrote: (original email sent 21 Jan 2025 at 14:34) Hi, thanks very much. It worked. Excellent. I am reading the manual every day, I read also that already twice, but my problem is that I am still on a low level, so I can´t put it into practice yet. Understood. We all have to start somewhere. My advice was in particular to have a look at the description for the variable which defines the format of the summary line, M-x describe-variable RET gnus-summary-line-format RET as it describes each and every % directive in such a format. Starting with what I gave you may be the wrong starting point as it has many possibly superfluous bits of information... OpenPGP_0xD9E413C6C4BB32CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature
Re: adding date to the summary buffer
> On Tue, 21 Jan 2025 16:08:39 +, gfp said: gfp> Hi all, gfp> thanks very much for helping me. gfp> I tried every hint from all of you and checked what it looks like. >> My advice was in >>> particular to have a look at the description for the variable which >>> defines the format of the summary line, >>> M-x describe-variable RET gnus-summary-line-format RET gfp> I read also that. gfp> What does the number -16,16 say? gfp> │%}%I%(%-16,16f%) gfp> the default was: -23,23 gfp> [%4L: %-23,23f%] gfp> I found this: gfp> gnus-summary-line-format: gfp> %I Indentation based on thread level (a string of spaces) gfp> Still I don`t know what the number exactly mean. If I read (info "(gnus) Formatting Basics") 3 times, then I think it means that it will be at least 23 characters, at most 23 characters, and that it will pad with spaces on the right to make it so. So a string shorter than 23 characters gets padding, and one longer than that is truncated. Iʼve not tested this at all 😺 Robert --
Re: adding date to the summary buffer
Response below/inline for email gfp wrote: > (original email sent 21 Jan 2025 at 16:08) > > Hi all, > > thanks very much for helping me. > I tried every hint from all of you and checked what it looks like. > >> My advice was in >>> particular to have a look at the description for the variable which >>> defines the format of the summary line, >>> M-x describe-variable RET gnus-summary-line-format RET > > I read also that. > > What does the number -16,16 say? > │%}%I%(%-16,16f%) >From the description of the variable, which gives all the directives allowed: %f Contents of the From: or To: headers (string) The numbers (between the % and the f) specify minimum and maximum length for that field and the -indicates that the contents to be padded to the right (so left justified). You can find a description of this in section "Formatting Basics" of the gnus info manual. The %( ... %) indicate that mouse-face property should be used for the enclosed text; this is described in section "Formatting Fonts" of the gnus info manual. There's a lot in the formatting section of the gnus manual, too much to absorb all at once (or even ever...). -- Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8
Re: adding date to the summary buffer
2025-01-21
Thread
Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
"Fraga, Eric" writes: > Can I suggest you read the documentation for the > gnus-summary-line-format so that you can remove any offending fields? > Otherwise, this becomes a rabbit hole! Let's better try to avoid examples which a newbie has problems to understand. That would be fairer - we can't assume arbitrary format specifications are understood at this level. Michael.