bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20846: 24.4; Electric-indent-mode does not call indent-line-function


From: Lars Ingebrigtsen
Subject: bug#20846: 24.4; Electric-indent-mode does not call indent-line-function after hitting RET inside a comment
Date: Thu, 27 May 2021 01:32:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Robin Neatherway <robin.neatherway@gmail.com> writes:

> Run `emacs -Q -l tmp.el` (major mode tmp defined in attached file
> tmp.el).
> Type `hello RET`, observe "Called indent-line!" in minibuffer.
> Type `/* hello RET`, observe no message in minibuffer.

(I'm going through old bug reports that unfortunately got no response at
the time.)

If I understand correctly, this bug report is about
`indent-line-function' not being called in comments?

In which case, this if an easier way to reproduce is:

emacs -Q /tmp/foo.c
M-: (setq-local indent-line-function (lambda () (message "indent"))) RET
/* RET

Inside the comment, the indentation function is not called, but it's
called everywhere else.

I'm not quite sure whether this is by design or not -- TAB is certainly
meaningful in comments, so I'm not sure why RET is handled specially
here.

That is, with 

/* Yes
no

will indent to

/* Yes
   no

but RET doesn't move point the same way.  Which seems inconsistent.

Anybody have an opinion here?

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]