Subject: bug#78756: Difference in indentation behavior between elisp-mode and sh-mode

From: Christopher Dimech <[email-masked]>
Date: Wed, 11 Jun 2025 18:07:42 +0200

> Sent: Thursday, June 12, 2025 at 1:53 AM
> From: "Christopher Dimech via Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]>
> To: [email-masked]
> Subject: bug#78756: Difference in indentation behavior between elisp-mode and sh-mode
>
> When defining a function in elisp-mode, the text following 
> the function is not indented, regardless of where the closing 
> parenthesis is placed:
> 
> (defun lana ()
>   "Desc"
> 
>   (interactive)
>   (message "lana"))
> 
> ;; lana ends here
> 
> But in sh-mode, the text after the function is indented by
> 1 character.
> 
> opcon ()
>  {
>    echo "TODO"
>  }
> 
>  ## opcon ends here
> 
> In elisp-mode, this does not happen—the next line of 
> text is never indented, regardless of the closing 
> parenthesis's position.

It is worth noting that awk-mode handles this correctly - text 
following a function definition is not indented.

It appears that the correct approach is not to indent the following
text.
 
> It appears that the correct approach is not to indent 
> the following text.  This discrepancy may also exist 
> in other programming modes.
> 
> It would be ideal if indentation behavior were made 
> consistent across all programming modes in Emacs.
> 
> 
> 
> 
> 
>