unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Splitting long lines in .notmuch-config
@ 2022-10-05 12:11 Rudolf Adamkovič
  2022-10-05 22:48 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Adamkovič @ 2022-10-05 12:11 UTC (permalink / raw)
  To: notmuch

Hi there!

Is it possible to split long lines in the .notmuch-config?  I normally
wrap my markup, config, and source files to 80 columns, but some of the
queries I define in my .notmuch-config now sprawl for over 200 columns.
I have tried to use two backslashes (\\) followed by a newline, like in
say Bash, but that does not work.  Any tips?

Thanks!

Rudy
-- 
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia\r

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

* Re: Splitting long lines in .notmuch-config
  2022-10-05 12:11 Splitting long lines in .notmuch-config Rudolf Adamkovič
@ 2022-10-05 22:48 ` David Bremner
  2022-10-13 23:08   ` Rudolf Adamkovič
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2022-10-05 22:48 UTC (permalink / raw)
  To: Rudolf Adamkovič, notmuch

Rudolf Adamkovič <salutis@me.com> writes:

> Hi there!
>
> Is it possible to split long lines in the .notmuch-config?  I normally
> wrap my markup, config, and source files to 80 columns, but some of the
> queries I define in my .notmuch-config now sprawl for over 200 columns.
> I have tried to use two backslashes (\\) followed by a newline, like in
> say Bash, but that does not work.  Any tips?

Not sure if this helps, but we are using the GLib GKeyFile API, so
whatever it supports (if anything) for line continuation, we do too.

One not so nice strategy would be to break your queries up into several
subqueries and and/or them together.\r

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

* Re: Splitting long lines in .notmuch-config
  2022-10-05 22:48 ` David Bremner
@ 2022-10-13 23:08   ` Rudolf Adamkovič
  0 siblings, 0 replies; 3+ messages in thread
From: Rudolf Adamkovič @ 2022-10-13 23:08 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner <david@tethera.net> writes:

> Not sure if this helps, but we are using the GLib GKeyFile API, so
> whatever it supports (if anything) for line continuation, we do too.

I found nothing in the GLib/GKeyFile documentation.  But then, I figured
that Org mode has me covered, as usual.  If anyone has the problem:

#+name: spammers
- [[mailto:foo@bar]]
- ...

#+name: notmuch-or
#+begin_src emacs-lisp :var addresses=() :results silent
(mapconcat (lambda (entry)
             (let* ((step-1 (car entry))
                    (step-2 (string-remove-prefix "[[mailto:" step-1))
                    (step-3 (string-remove-suffix "]]" step-2)))
               step-3))
           addresses
           " or ")
#+end_src

#+begin_src conf :tangle ~/.notmuch-config :noweb yes
...
spam = <<notmuch-or(addresses=spammers)>>
#+end_src

Thank you!

Rudy
-- 
"Genius is 1% inspiration and 99% perspiration."
-- Thomas Alva Edison, 1932

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia\r

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

end of thread, other threads:[~2022-10-13 23:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 12:11 Splitting long lines in .notmuch-config Rudolf Adamkovič
2022-10-05 22:48 ` David Bremner
2022-10-13 23:08   ` Rudolf Adamkovič

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).