Subject: Re: bug#16202: 24.3.50; lisp-mode's indent-sexp might be buggy (for slime in particular, and lisp in general)

From: [email-masked]
Date: Wed, 13 Jul 2016 21:47:05 -0400

[email-masked] (João Távora) writes:

> ...as does indenting the sexp with indent-region. This might be naive,
> but why not super-simplify indent-sexp to be something like this?
>
>    (defun indent-sexp (&optional endpos)
>      (interactive)
>      (if endpos
>          (indent-region (point) endpos)
>        (indent-region (point) (save-excursion
>                                 (forward-sexp 1)
>                                 (point)))))

Just for the record, at least one significant difference is that
indent-sexp also indents comments at the end of the line, while
indent-region does not.

e.g.

(progn
       ;; comment on its own line
  (do-something) ; a comment which is not moved by indent-region
  (do-another-thing))