unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43634: 27.1; Wrong indentation in sieve-mode
       [not found] <m17dsgfl30.fsf.ref@yahoo.es>
@ 2020-09-26 18:29 ` Unknown
  2020-09-30  3:13   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Unknown @ 2020-09-26 18:29 UTC (permalink / raw)
  To: 43634


Copy the following Sieve script to "sample.sieve":

if size :over 100K {
  reject "I'm sorry, I do not accept mail over 100kb in size.";
}

M-x mark-whole-buffer and indent. The closing brace is reindented in a
strange way:

if size :over 100K {
  reject "I'm sorry, I do not accept mail over 100kb in size.";
         }

As sieve-mode inherits from c-mode, putting things in parens works, but
this is not valid according to the grammar (see
https://tools.ietf.org/html/rfc5228#section-3.1):

if (size :over 100K) {
  reject "I'm sorry, I do not accept mail over 100kb in size.";
}





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

* bug#43634: 27.1; Wrong indentation in sieve-mode
  2020-09-26 18:29 ` bug#43634: 27.1; Wrong indentation in sieve-mode Unknown
@ 2020-09-30  3:13   ` Lars Ingebrigtsen
  2021-01-27  6:05     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-30  3:13 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 43634

Daniel Martín <mardani29@yahoo.es> writes:

> M-x mark-whole-buffer and indent. The closing brace is reindented in a
> strange way:
>
> if size :over 100K {
>   reject "I'm sorry, I do not accept mail over 100kb in size.";
>          }
>
> As sieve-mode inherits from c-mode, putting things in parens works

I guess there isn't really much in Sieve that's that C-like.  I mean,
it's {} and strings, but ...  not the whole shebang.

Do we have a simpler mode somewhere that just understands {} and strings
that Sieve mode could inhering from instead?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43634: 27.1; Wrong indentation in sieve-mode
  2020-09-30  3:13   ` Lars Ingebrigtsen
@ 2021-01-27  6:05     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-27  6:05 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 43634

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Do we have a simpler mode somewhere that just understands {} and strings
> that Sieve mode could inhering from instead?

Apparently not (except just calling smie, which didn't quite do the
right thing), so I just took an indentation function and altered it
slightly.  Fix in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-01-27  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m17dsgfl30.fsf.ref@yahoo.es>
2020-09-26 18:29 ` bug#43634: 27.1; Wrong indentation in sieve-mode Unknown
2020-09-30  3:13   ` Lars Ingebrigtsen
2021-01-27  6:05     ` Lars Ingebrigtsen

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

	https://git.savannah.gnu.org/cgit/emacs.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).