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

Previous Next

Package: emacs;

Reported by: joaotavora <at> gmail.com (João Távora)

Date: Fri, 20 Dec 2013 15:09:02 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> users.sourceforge.net
To: joaotavora <at> gmail.com (João Távora)
Cc: 16202 <at> debbugs.gnu.org
Subject: bug#16202: 24.3.50; lisp-mode's indent-sexp might be buggy (for slime in particular, and lisp in general)
Date: Sat, 04 Mar 2017 16:39:34 -0500
tags 16202 notabug
quit

joaotavora <at> gmail.com (João Távora) writes:

> Hi maintainers,
>
> This was started by bug reports in the slime-devel mailing list
>
>   http://comments.gmane.org/gmane.lisp.slime.devel/11196
>   http://comments.gmane.org/gmane.lisp.slime.devel/11189
>
> The reproduction recipe described in these messages requires,
> unfortunately, that you install slime.

Unfortunately, it no longer works with current slime.

    Debugger entered--Lisp error: (void-function common-lisp-run-indentation-tests)

I can't find a definition of common-lisp-run-indentation-tests anywhere
in slime's code.

>
> which indented the two comment lines to comment-column, I think. The
> patch I attach at the end of this message fixes it.
>
> ...as does indenting the sexp with indent-region. This might be naive,
> but why not super-simplify indent-sexp to be something like this?

Both your patch and indent-region do not indent comments that occur
after code.  But I don't think doing this indentation is a bug, rather,
slime should change `comment-indent-function' and/or
`comment-insert-comment-function' so that comments will be indented in
the way it expects.

>   	;; unless a line ends inside a string.
>   	(while (and (not inner-loop-done)
>   		    (not (setq outer-loop-done (eobp))))
> + 	  (setq before-parse (point))
>   	  (setq state (parse-partial-sexp (point) (progn (end-of-line) (point))
>   					  nil nil state))
>   	  (setq next-depth (car state))
> ! 	  ;; If the line contains nothing but a comment other than the sort that
> ! 	  ;; is indented like code, indent it now with indent-for-comment.
> ! 	  ;; Comments indented like code are right already.  In any case clear
> ! 	  ;; the in-comment flag in the state because parse-partial-sexp never
> ! 	  ;; sees the newlines.
> ! 	  (when (car (nthcdr 4 state))
> !             (when (<= (nth 8 state) before-parse)

I think this would only indent comments starting at the beginning of the
line, which never need to be indented anyway...

> !               (indent-for-comment)
> !               (end-of-line))
> !             (setcar (nthcdr 4 state) nil))






This bug report was last modified 7 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.