[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allow '-' in field names? Support for Debian's multi-line format?
From: |
Jose E. Marchesi |
Subject: |
Re: Allow '-' in field names? Support for Debian's multi-line format? |
Date: |
Thu, 26 Jan 2023 12:29:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Simon.
> Have you considered allowing '-' in field names?
>
> Currently the field names seems to be hard-coded to
> '[a-zA-Z%][a-zA-Z0-9_]*' in recutils. Many files I encounter (e.g.,
> Debian archive Releases/Packages files, RFC2822 e-mails) also allows
> '-'. How about changing the allowed field name regexp to
> '[a-zA-Z%][a-zA-Z0-9_-]*'?
Yes, I have considered it, with the same use-case in mind :)
The problem is that in selection expressions we are providing an infix
operator - for subtraction.
So, either:
- We add an alternative syntax to selection expressions that allows '-'
in field names, such as lisp-like, or
- We expect '-' normalized to '_' when referring to field names in
selection expressions, or
- We live with the limitation of not being able to refer to such fields
in selection expressions.
> Debian uses a multi-line format like this:
>
> Foo: bar
> baz
> foo
> .
> foo
> bar
> baz
>
> What do you think of supporting that format as well?
>
> I could look into implementing it, but I thought I'd ask first if this
> has been discussed and rejected before for some reason that isn't clear
> to me.
Sure :)
The support Debian syntax has been in the TODO for ages :/