Gnus development mailing list
 help / color / mirror / Atom feed
* Add to gnus-visible-headers
@ 2022-10-05  9:14 Colin Baxter
  2022-10-07 16:37 ` Adam Sjøgren
  2022-10-07 16:44 ` Eric S Fraga
  0 siblings, 2 replies; 6+ messages in thread
From: Colin Baxter @ 2022-10-05  9:14 UTC (permalink / raw)
  To: ding


I want to add a couple of new headers to the "gnus-visible-headers"
variable. I could write out all existing headers and then add the new
headers, as in

(setq gnus-visible-headers "existing\\|new").

That works, but is there a simpler way (and shorter) of just appending
the new headers?

Thank you.

Best wishes,

Colin Baxter.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add to gnus-visible-headers
  2022-10-05  9:14 Add to gnus-visible-headers Colin Baxter
@ 2022-10-07 16:37 ` Adam Sjøgren
  2022-10-08  8:49   ` Colin Baxter
  2022-10-09  6:06   ` Emanuel Berg
  2022-10-07 16:44 ` Eric S Fraga
  1 sibling, 2 replies; 6+ messages in thread
From: Adam Sjøgren @ 2022-10-07 16:37 UTC (permalink / raw)
  To: ding

Colin writes:

> (setq gnus-visible-headers "existing\\|new").
>
> That works, but is there a simpler way (and shorter) of just appending
> the new headers?

You could do:

   (setq gnus-visible-headers (concat gnus-visible-headers "\\|new"))

but if it's simpler and shorter, I'm not sure. At least you aren't
hardcoding the existing value :-)


  Best regards,

    Adam

-- 
 "You shouldn't let poets lie to you."                      Adam Sjøgren
                                                       asjo@koldfront.dk



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add to gnus-visible-headers
  2022-10-05  9:14 Add to gnus-visible-headers Colin Baxter
  2022-10-07 16:37 ` Adam Sjøgren
@ 2022-10-07 16:44 ` Eric S Fraga
  2022-10-08  8:48   ` Colin Baxter
  1 sibling, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2022-10-07 16:44 UTC (permalink / raw)
  To: ding

On Wednesday,  5 Oct 2022 at 10:14, Colin Baxter wrote:
> (setq gnus-visible-headers "existing\\|new").
>
> That works, but is there a simpler way (and shorter) of just appending
> the new headers?

What about

(setq gnus-visible-headers (concat gnus-visible-headers "\\|new"))

Untested...
-- 
Eric S Fraga via gnus (Emacs 29.0.50 2022-09-29) on Debian 11.4



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add to gnus-visible-headers
  2022-10-07 16:44 ` Eric S Fraga
@ 2022-10-08  8:48   ` Colin Baxter
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Baxter @ 2022-10-08  8:48 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: ding

>>>>> Eric S Fraga <e.fraga@ucl.ac.uk> writes:

    > On Wednesday,  5 Oct 2022 at 10:14, Colin Baxter wrote:
    >> (setq gnus-visible-headers "existing\\|new").
    >>
    >> That works, but is there a simpler way (and shorter) of just
    >> appending the new headers?

    > What about

    > (setq gnus-visible-headers (concat gnus-visible-headers "\\|new"))

    > Untested...  -- Eric S Fraga via gnus (Emacs 29.0.50 2022-09-29)
    > on Debian 11.4

Thanks Eric. This works. I never seem to remember to use `concat'!

Best wishes,

Colin.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add to gnus-visible-headers
  2022-10-07 16:37 ` Adam Sjøgren
@ 2022-10-08  8:49   ` Colin Baxter
  2022-10-09  6:06   ` Emanuel Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Colin Baxter @ 2022-10-08  8:49 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

>>>>> Adam Sjøgren <asjo@koldfront.dk> writes:

    > You could do:

    >    (setq gnus-visible-headers (concat gnus-visible-headers
    > "\\|new"))

    > but if it's simpler and shorter, I'm not sure. At least you aren't
    > hardcoding the existing value :-)

Indeed! Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add to gnus-visible-headers
  2022-10-07 16:37 ` Adam Sjøgren
  2022-10-08  8:49   ` Colin Baxter
@ 2022-10-09  6:06   ` Emanuel Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2022-10-09  6:06 UTC (permalink / raw)
  To: ding

Adam Sjøgren wrote:

>> (setq gnus-visible-headers "existing\\|new").
>>
>> That works, but is there a simpler way (and shorter) of
>> just appending the new headers?
>
> You could do:
>
>    (setq gnus-visible-headers (concat gnus-visible-headers "\\|new"))

You (the OP) can also use this method which really is cool 

(setq auto-mode-alist `(
    ("\\.bal\\'"     . balance-mode)
    ("\\.cl\\'"      . common-lisp-mode)
    ("\\.dat\\'"     . gnuplot-mode)
    ("\\.gpi\\'"     . gnuplot-mode)
    ("\\.grm\\'"     . sml-mode)
    ("\\.lu\\'"      . lua-mode)
    ("\\.nqp\\'"     . perl-mode)
    ("\\.php\\'"     . html-mode)
    ("\\.pic\\'"     . nroff-mode)
    ("\\.pl\\'"      . prolog-mode)
    ("\\.sed\\'"     . conf-mode)
    ("\\.service\\'" . conf-mode)
    ("\\.tap\\'"     . gcode-mode)
    ("\\.tex\\'"     . latex-mode)
    ("\\.xr\\'"      . conf-xdefaults-mode)
    ("keys\\'"       . conf-mode)
    ("*"             . text-mode)
  ,@auto-mode-alist) )

> but if it's simpler and shorter, I'm not sure. At least you
> aren't hardcoding the existing value :-)

You mean like this? What's wrong with that? :)

(setq gnus-visible-headers '(
                             "^Bcc:"
                             "^Cc:"
                             "^Date:"
                             "^From:"
                             "^Subject:"
                             "^To:"
                             ))

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-09  6:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05  9:14 Add to gnus-visible-headers Colin Baxter
2022-10-07 16:37 ` Adam Sjøgren
2022-10-08  8:49   ` Colin Baxter
2022-10-09  6:06   ` Emanuel Berg
2022-10-07 16:44 ` Eric S Fraga
2022-10-08  8:48   ` Colin Baxter

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).