From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs 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 Message-ID: <87innoafhl.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1488663559 9670 195.159.176.226 (4 Mar 2017 21:39:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2017 21:39:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 16202@debbugs.gnu.org To: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 04 22:39:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckHOQ-0001Vz-AK for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 22:39:10 +0100 Original-Received: from localhost ([::1]:36657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckHOW-0002a5-1Z for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 16:39:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckHOM-0002YV-Bd for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 16:39:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckHOJ-00076M-6c for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 16:39:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckHOJ-00076I-1n for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 16:39:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ckHOI-00083w-IK for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 16:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2017 21:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16202 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16202-submit@debbugs.gnu.org id=B16202.148866350930947 (code B ref 16202); Sat, 04 Mar 2017 21:39:02 +0000 Original-Received: (at 16202) by debbugs.gnu.org; 4 Mar 2017 21:38:29 +0000 Original-Received: from localhost ([127.0.0.1]:40317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckHNk-000830-Uk for submit@debbugs.gnu.org; Sat, 04 Mar 2017 16:38:29 -0500 Original-Received: from mail-it0-f67.google.com ([209.85.214.67]:36585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckHNi-00082h-If; Sat, 04 Mar 2017 16:38:26 -0500 Original-Received: by mail-it0-f67.google.com with SMTP id w185so5905779ita.3; Sat, 04 Mar 2017 13:38:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Rtke6wZsMV3euZABYjG2orh3LDQWu5eoXfo8ZQEkkuU=; b=gZogkpBbJd2kAcAZumuqZ5DP321WYlHNGVIIwtLLid9Kxy0nb/XEb8cBshD/GHljTp m+vGQeesu4br1PRP5HnchiTmIl5oo3BAS17TZ6v3Ix0RDmzmGJQ1YKvZ+YjpN17TzO1k 57aAoztEuurn7ZDagcnnjVsqxM49VaPnt8NuODapBvZvhNQN70wagTeTHXEcYGruDzyO pSykdJHWdmLrA4HO0RgLp4KSpa/CKLoogbzt89Ub8j7hfFpKn6HKnBTdukQoBqTpveqC diOTRXlwNF/14Lf37MalB2mNUCwsYf7c/QBGLo6aTgiWQssTvGCEZXWxk+Csiz5XEeCN JeRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=Rtke6wZsMV3euZABYjG2orh3LDQWu5eoXfo8ZQEkkuU=; b=FS6gnJMk7Whr/rFeBLEJecaRO4FPG5DyNQiVJW+m7KIzMfMz5YA1G6LBPtnRaoCGGG nD+Gx9Os+OXDeaIvLNou2Sd234oBiSROGkp5eI46ACHnb/VQd716ArZ4Lm6t/Iv4puZG lcrdqd1uZ9TWUujfVyPBgXZpfXgI0Jm1b50dYcMWEhVuu9fx/X39J61nk8rRVA2QQZBr n7UEuW/0p8b2th0Pno1148UXhlIwCVQ776kQNfFwD9SskZngNPgnQZVzw6qzHxp+vR0h rXSq+LAgiLciVx6cl49egV6XNIRxv9/HvFg3jugtNQ0vmVxbqSX8UZPR0JIjJtrQnSYX +PPQ== X-Gm-Message-State: AMke39m3pNUcgT8F7WBwEhtbS4kcTpp8afaHO/ZXa63K4driJECFiVHDLvsy4JeyVUgY9g== X-Received: by 10.36.240.11 with SMTP id s11mr9765078ith.16.1488663500866; Sat, 04 Mar 2017 13:38:20 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b88sm2515834itd.21.2017.03.04.13.38.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Mar 2017 13:38:20 -0800 (PST) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Fri, 20 Dec 2013 15:08:29 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130199 Archived-At: tags 16202 notabug quit joaotavora@gmail.com (Jo=C3=A3o T=C3=A1vora) 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-indentatio= n-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 th= at > ! ;; 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 (<=3D (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))