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

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

bug#16202: 24.3.50; lisp-mode's indent-sexp might be buggy (for slime in


From: npostavs
Subject: bug#16202: 24.3.50; lisp-mode's indent-sexp might be buggy (for slime in particular, and lisp in general)
Date: Wed, 13 Jul 2016 21:47:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)

joaotavora@gmail.com (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))





reply via email to

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