bug#81644: sieve-mode: highlight imap4flags keywords

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Version: 32.1

Stéphane Blondon [17/Aug  3:25pm +02] wrote:
> Emacs has built in syntax highlighting for sieve email filtering.
> The RFC 5232 adds imap4flags ('setflag', 'addflag', 'removeflag' and 'hasflag').
>
> see RFC: https://datatracker.ietf.org/doc/rfc5232/
>
> These keywords are managed by dovecot (at least 'setflag', 'addflag'
> in the examples:
> https://doc.dovecot.org/main/howto/sieve.html#flagging-or-highlighting-your-mail
>
> The patch adds the highlight for the 4 keywords. It's not needed for
> ':flags' because it already works.
> It's based on the emacs git source code.
> diff --git i/lisp/net/sieve-mode.el w/lisp/net/sieve-mode.el
> index 54bccc179aa..908452b3f76 100644
> --- i/lisp/net/sieve-mode.el
> +++ w/lisp/net/sieve-mode.el
> @@ -85,12 +85,14 @@ sieve-font-lock-keywords
>        (,(regexp-opt '("require" "if" "else" "elsif" "stop") 'words)
>         . 'sieve-control-commands)
>        ;; action commands
> -      (,(regexp-opt '("fileinto" "redirect" "reject" "keep" "discard") 'words)
> +      (,(regexp-opt '("fileinto" "redirect" "reject" "keep" "discard"
> +         "setflag" "addflag" "removeflag")
> +         'words)
>         . 'sieve-action-commands)
>        ;; test commands
>        (,(regexp-opt '("address" "allof" "anyof" "exists" "false"
>  		      "true" "header" "not" "size" "envelope"
> -                      "body")
> +                      "body" "hasflag")
>                      'words)
>         . 'sieve-test-commands)
>        ("\\Sw+:\\sw+" . 'sieve-tagged-arguments))))

Thanks, installed on master and closing.

-- 
Sean Whitton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.