From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: Oleh Krehel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2015 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 21343@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14405082419431 (code B ref -1); Tue, 25 Aug 2015 13:11:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Aug 2015 13:10:41 +0000 Received: from localhost ([127.0.0.1]:37667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUDzs-0002S2-8G for submit@debbugs.gnu.org; Tue, 25 Aug 2015 09:10:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUDzq-0002Rt-Sn for submit@debbugs.gnu.org; Tue, 25 Aug 2015 09:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUDzp-0002wW-WB for submit@debbugs.gnu.org; Tue, 25 Aug 2015 09:10:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUDzp-0002wN-TV for submit@debbugs.gnu.org; Tue, 25 Aug 2015 09:10:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUDzp-0004oQ-52 for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 09:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUDzl-0002qB-0r for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 09:10:37 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:34905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUDzk-0002pp-Jb for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 09:10:32 -0400 Received: by wicne3 with SMTP id ne3so14808982wic.0 for ; Tue, 25 Aug 2015 06:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=D0z1ELOdxLyAE82ild0c7fQQo1c3X6f+2QvjQiZlLdE=; b=mn/oQT5S9jNhquWbN8NVrrwhSZFoTMpSdyXkmT9r8F/6cbMkXC3De/+Ye40totZmge 2MLEeCqUIIE/5XHecsEEGh9F3Ga3dSYN6ZTgu3i5b0hjxDmlv818Y9V3Dc9MTR3g7YQT yMlccna5pL94iwIPqLyd7lJ/z/yzDJwjZqu+dHc10JVZH0IQkwlAC0tWB2sSdKy1NF1J cY0Qu5fJjTMpJ2Sau33bvT+hnxNSJJZ08U1ZZrKvZ10Nk6xDT2coqVNPDOGiZs7edWh5 ZknnEeb8Wu84BBHakPxLvQJrx5+dtyfjXipHK7HEcoSwQx2DLubb5Xukx05ZGUBmpH/n 7APg== X-Received: by 10.194.142.237 with SMTP id rz13mr51651591wjb.48.1440508231775; Tue, 25 Aug 2015 06:10:31 -0700 (PDT) Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id bm9sm2622894wib.10.2015.08.25.06.10.31 for (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Tue, 25 Aug 2015 06:10:31 -0700 (PDT) From: Oleh Krehel Date: Tue, 25 Aug 2015 15:11:18 +0200 Message-ID: <87lhczjyx5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) To reproduce, paste this code into *scratch*, "|" is the point: ("|foo" ";; (bar)") M-x indent-sexp will result in " ;" being inserted after the sexp. This is because `parse-partial-sexp' for the second line detects a comment at one stage. From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2015 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 21343@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14405247622638 (code B ref -1); Tue, 25 Aug 2015 17:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Aug 2015 17:46:02 +0000 Received: from localhost ([127.0.0.1]:38249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUIIM-0000gT-BG for submit@debbugs.gnu.org; Tue, 25 Aug 2015 13:46:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33248) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUIIK-0000g3-NU for submit@debbugs.gnu.org; Tue, 25 Aug 2015 13:46:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUIIJ-0002Hp-JE for submit@debbugs.gnu.org; Tue, 25 Aug 2015 13:46:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUIIJ-0002Hl-GT for submit@debbugs.gnu.org; Tue, 25 Aug 2015 13:45:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUIII-0005ia-Nv for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 13:45:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUIIF-0002Fl-Go for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 13:45:58 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:57173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUIIF-0002FR-8J for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2015 13:45:55 -0400 Received: from [192.168.178.31] ([95.119.32.249]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0LjsPB-1Yt1XH0hr7-00brCI for ; Tue, 25 Aug 2015 19:45:54 +0200 Message-ID: <55DCA9C7.7070609@easy-emacs.de> Date: Tue, 25 Aug 2015 19:45:43 +0200 From: Andreas =?UTF-8?Q?R=C3=B6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 References: <87lhczjyx5.fsf@gmail.com> In-Reply-To: <87lhczjyx5.fsf@gmail.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:cU+kpyLMLK9KX3a0ZRsPGisXj40Iu+HdmtoqKfKcXLi320uu3ug 7S9UrjmWrhinjVWarNlYS5d6uhnWlkTM3pQ5xXS8Tv9spHjo4stqtA04A737fZQnvTS02hb 8mLSzmUKafixAuwTazd7reC+Wa32W2g4Yw3447OiZOykRM97Ck/1gn2+bpxpiltrNbQi6uk PBUJxAGAuGh/JHpv77YNQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:DbjEFNHXa88=:/t/4ngD/1yc4ch7eHixCU7 Z1vUu8G2z/ZdaRc6nWNripfBSW34e/hOgRBLGBzXskzW7ddGCRzMp49engZnF2uV41pelRq7L EEOjtVyM/jqZIb9xVLyFf5xhkc+uSPWD228+saYMgqZOivOdZ/JDd+HHPMx5sm6MvvYzQtfMZ 0DJ4rW+leGPBYjmlvzTxkPTJAA7R1/Qnm2DZ7GA80n3QtII6TWy/tCNBbb4N24ZMn61WHvkmf qVZ35uM3UIf2m6Gv7DK6cEP/HkoJcQELWyKk9IdUFiCOlifxPhWMmuD5luTEFv96iClFEGlVL ySADiBiDfHMqaRtSVXhyvej3xkiETNeAIdkasoGYx/VB0+P41W7+JqgcAKX+QEsAdISakkpDc yiOoqzZG5zsnbTg6HiKTL2+C80rqKXHx2NI0KutMoeid9XeVHSCs6ZRiKSwtPC2DUJSFPWG1p 6i61A03DtGtSJ77FXbcDcOQ7YbRWOeTMDRuL+lLBW3sj63/TlYjUIf4rva/DHa0XjnAUXs4tP RV2gufzbN8Hb5hz+kq1ZhdWHt9qmbIjlPVHbp/yrYbVgn9nGE6swb8tIgSEi8tWetkFaRATEC M4djVVitA5pI/RsT2Jr8EPeE+5vLRhSUcP0yzFunHWbuYOaH+j3qU4gG1wQMQqTnDBNpW+Tmk WwdzA+UMG3GIPfBtotYQqZtb/ikpklYuQNM9nApiMD1xgO3YIisI07zOiqI5zvt+v7uxR6XOD r9s9PCEnepH5BFxbLQkLgQZ8zUHvz0T3UiPSNjTAuyNeoC6CEqeqwMsskSjXRmHyxV4o9o2+Y Ip/DXnkvSF5MnFxLsmx1LrRDYXoww== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Am 25.08.2015 um 15:11 schrieb Oleh Krehel: > To reproduce, paste this code into *scratch*, "|" is the point: > > ("|foo" > ";; (bar)") > > M-x indent-sexp will result in " ;" being inserted after the sexp. > > This is because `parse-partial-sexp' for the second line detects a > comment at one stage. > > > > > Can't reproduce with GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.23) of 2015-08-10 TAB indents nicely both lines, detects inside string when cursor at bar. From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: Oleh Krehel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Aug 2015 11:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas =?UTF-8?Q?R=C3=B6hler?= Cc: 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.144058840532540 (code B ref 21343); Wed, 26 Aug 2015 11:27:02 +0000 Received: (at 21343) by debbugs.gnu.org; 26 Aug 2015 11:26:45 +0000 Received: from localhost ([127.0.0.1]:38594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUYqr-0008Sm-Aw for submit@debbugs.gnu.org; Wed, 26 Aug 2015 07:26:45 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33183) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUYqp-0008Sd-4j for 21343@debbugs.gnu.org; Wed, 26 Aug 2015 07:26:43 -0400 Received: by wijn1 with SMTP id n1so21055363wij.0 for <21343@debbugs.gnu.org>; Wed, 26 Aug 2015 04:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=+qYWYITMdWbzYfbNOoKiiTuzzCn30RaO+/k6hHrXpHA=; b=MCtnaV6DwYPxj9SqomdpL9iPDWueK9+omISGqSxZK0ecW7dfZhJK+NFe1pS/WD7Huy XwhvW7E4HIGia1Hp9ER7A5Lk+4KxClXoRHtMj9kH+tNaFwYzSma/6FbuUOturrp09k9F 3co3/k5pnFdxJ6PRyINAXKSBICJiqJlYF6gCHjpE4R0GU063ncY6diWxX3k3mNCwgZmW w7dW4bzJW/oagt7lXQq+7Sqi9pb9wGILxjvL3mTBE6br/flRQQEvOBt4+OozWOUTzlTg 0Hf4DIEbVWavogWLQrY1tHsgKt4BUoQKPswRlce9XVIQ7tk8YnXVSC1Zd931qZPmCPoi Ogvw== X-Received: by 10.194.190.79 with SMTP id go15mr55803286wjc.80.1440588402565; Wed, 26 Aug 2015 04:26:42 -0700 (PDT) Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id y13sm3380671wjq.26.2015.08.26.04.26.41 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Wed, 26 Aug 2015 04:26:41 -0700 (PDT) From: Oleh Krehel References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> Date: Wed, 26 Aug 2015 13:27:26 +0200 In-Reply-To: <55DCA9C7.7070609@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6h\?\= \=\?utf-8\?Q\?ler\=22's\?\= message of "Tue, 25 Aug 2015 19:45:43 +0200") Message-ID: <87pp2awaqp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Andreas R=C3=B6hler writes: > Am 25.08.2015 um 15:11 schrieb Oleh Krehel: >> To reproduce, paste this code into *scratch*, "|" is the point: >> >> ("|foo" >> ";; (bar)") >> >> M-x indent-sexp will result in " ;" being inserted after the sexp. >> >> This is because `parse-partial-sexp' for the second line detects a >> comment at one stage. > Can't reproduce with GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ > Version 2.24.23) of 2015-08-10 > > TAB indents nicely both lines, detects inside string when cursor at > bar. This is reproducible with "emacs -Q" on both 25 and 24.5.2. You need to not press "TAB", but "M-x indent-sexp" from the specified point position. `parse-partial-sexp' will detect comment on line 2 only when called in a sequence that `indent-sexp' calls it, i.e. with the previous pps data passed to the second pps call. From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Aug 2015 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Oleh Krehel Cc: 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.144060077624114 (code B ref 21343); Wed, 26 Aug 2015 14:53:02 +0000 Received: (at 21343) by debbugs.gnu.org; 26 Aug 2015 14:52:56 +0000 Received: from localhost ([127.0.0.1]:38884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUc4N-0006Gr-Gp for submit@debbugs.gnu.org; Wed, 26 Aug 2015 10:52:55 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56549) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUc4M-0006Gk-9F for 21343@debbugs.gnu.org; Wed, 26 Aug 2015 10:52:54 -0400 Received: from [192.168.178.31] ([77.6.218.200]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0MUxEy-1ZE4jZ0XKW-00YBJQ; Wed, 26 Aug 2015 16:52:53 +0200 Message-ID: <55DDD2B9.1010001@easy-emacs.de> Date: Wed, 26 Aug 2015 16:52:41 +0200 From: Andreas =?UTF-8?Q?R=C3=B6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> <87pp2awaqp.fsf@gmail.com> In-Reply-To: <87pp2awaqp.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:by4s7QgHntvX8bgi7B+AbNblonaA1RwM+mwy2abHye5i197eeYB +1DLsFCSKrL5oUc2TtfXnP/2QTxKr4cjV4EZgZRxV66adbU24gy1yzKqC5/E5xmsBFnUtWP XFrN3bz0mVSi6D/qYA5xO1vnNRHKklZI7AL0pIODaCPOnL8oYSH8fyhnZc7MVGOAhfnA9PQ Z7gXljgt7/NY5MNoUAnew== X-UI-Out-Filterresults: notjunk:1;V01:K0:6R5sdEiGI0Y=:DFpfuglMvZWYOSh/jpiY2Q vHXDTzJ+Zg9Z5gkRGjFtFMtdfOFIGOio1539BZFBR/zZuExpnO4s3DEAXbjceGpf6BAXe1+wW Yg89U0EVQ7QqUZaypuXNPbMq55YLZprlRX8NbIR2AOC33Kpz/fEueCms0IINewAbvpT/pRose t5DUSudBZuXWJ5wOAqs2S2Mhh6wL4FrcZnPhHWlhN1pUwcgsgpwF/+KuMvOEAhq3jiUTS+ehD G76Pwilt8oLrLAWavcuAH9L9wpNDjwPW3tsiHKf2IhJ6FicH4aXZ4FfrVopa8H8vXJN78td0l nb7mnHgXTgmHsgJNnCwYxNAQNPe3BthItEN/vWYYQDqinWHKyMDpK08ocba9BPDkzdoJrO91o cGJ/SDcWHO6vIyqe3VtmpD63v6CQESAjhLbENw6t5J/5sZ4xsy77FcgKMjQ/UazmOfivZHrp6 vthcCqgZlDJG6wxka545B5ZBWc3ZdZT+vFj/rL5YMJCCYM2JhlTMH4cRU2h0+EXkZfNRYgtmC UAZKDxb+O/nFgLUxt9H1V9Z16xMJW2+YcO1I80DxRAejBBUG9vOxWlCrHm+1T9Foj/khB1Yhc 1AIChnFcJ3bVBvAzWoLphUU7NzSDtE8RUPh5tIsKodjTcAtAI6IsyHZlZZkvi3Zijsz3ZJKqY +tXgixOSIp8VuoA85bfdsvdhdP9iHqTGEFW0WZ3dieLmNsaM37IOOfJ29YVtbkqKs1gQsM2Ez IZuvr8cqCq8Ocm1L9dmiQJ20JEGJSbsQEDjkLFAwNMR2Q7IoS420NuJmOKOLKuxH/EPe7rC60 LO3NGEhZmtIKOcJjiTSxwuWCSJ8Lg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Am 26.08.2015 um 13:27 schrieb Oleh Krehel: > Andreas Röhler writes: > >> Am 25.08.2015 um 15:11 schrieb Oleh Krehel: >>> To reproduce, paste this code into *scratch*, "|" is the point: >>> >>> ("|foo" >>> ";; (bar)") >>> >>> M-x indent-sexp will result in " ;" being inserted after the sexp. >>> >>> This is because `parse-partial-sexp' for the second line detects a >>> comment at one stage. >> Can't reproduce with GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ >> Version 2.24.23) of 2015-08-10 >> >> TAB indents nicely both lines, detects inside string when cursor at >> bar. > This is reproducible with "emacs -Q" on both 25 and 24.5.2. You need to > not press "TAB", but "M-x indent-sexp" from the specified point > position. > > `parse-partial-sexp' will detect comment on line 2 only when called in a > sequence that `indent-sexp' calls it, i.e. with the previous pps data > passed to the second pps call. Okay, see the bug now, thanks. From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Jul 2016 02:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Oleh Krehel Cc: Andreas =?UTF-8?Q?R=C3=B6hler?= , 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.14675136549732 (code B ref 21343); Sun, 03 Jul 2016 02:41:02 +0000 Received: (at 21343) by debbugs.gnu.org; 3 Jul 2016 02:40:54 +0000 Received: from localhost ([127.0.0.1]:35020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJXL4-0002Wp-Fn for submit@debbugs.gnu.org; Sat, 02 Jul 2016 22:40:54 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:37497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJXL2-0002WX-NC; Sat, 02 Jul 2016 22:40:53 -0400 Received: by mail-it0-f50.google.com with SMTP id f6so42789992ith.0; Sat, 02 Jul 2016 19:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dDgurTR72xQAwm2uW0rTCed9zkh000noBvl7lc1v3Mo=; b=XMYLPs5GNydrXRY29Mxp4Wtjm4VM0T5OPw0NTCU9LU4wLpnEM3Rl1PANO4dOe+CrXd toXWddpLzbzaUS7CRUMStAYyX7llySUNoxy+ScLs0QA0z6hU6JN9FpagQ7TRgKZNEPFN 2Kkvc+ArKC7UUJ2T3NOxvSOMH/W98S+jctVC9bC08lviz98FYAYDQoNKxTyISN1icuIM jIllfJZe93DhNvepAGqmdCiW+GkO/Lx702MYaJgNJyVoGPOaJ0GLYo3p7izf0EgMG0Us RAaNIyOljCHEXNj/FSxb4SXEZ9aNCO1u+KES6/zOglttcpfYQvBxsfdRg9WPI7q//Z8P yQIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=dDgurTR72xQAwm2uW0rTCed9zkh000noBvl7lc1v3Mo=; b=V1W7GRm9tchu2BzGBzLyjEDtoxTFJRe7ndQTR7MKXxyLlLT+XhFslwguZVZMmZGrr7 +XSUuJbB4G8hxeauN09tXQN6YImAJn/m6jIGZkOWE21ofPUy3b9dv6eym1kcGp9YMRnU M5IKzaau4KSS0YHjeaL4Vj/RLYqho6jKjVv8NxpbDFw2fozuqLXDa/ue4CWYOgGHJGsN P3B1oaC4u8WCF3twvr6XwBX/l+zaxHh4mDrdMRpy/ALMwTya7jmL/80hCudc1L3LPD5g zSRlcU0D5n3f3NSdSvuktVWrJ0swsnShp/WCQn2wWTH2mDI22jGL/M70FLwQXWNUgNwS MCNg== X-Gm-Message-State: ALyK8tJJ+F89ljmaPvoPA6BU28yj09ntcpBIvHQ6s1KsyoRsq8h34F2wpnH3GQ/ODBriNA== X-Received: by 10.36.147.198 with SMTP id y189mr2623290itd.83.1467513646907; Sat, 02 Jul 2016 19:40:46 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id n63sm6833126ion.5.2016.07.02.19.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jul 2016 19:40:46 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> <87pp2awaqp.fsf@gmail.com> Date: Sat, 02 Jul 2016 22:40:56 -0400 In-Reply-To: <87pp2awaqp.fsf@gmail.com> (Oleh Krehel's message of "Wed, 26 Aug 2015 13:27:26 +0200") Message-ID: <87lh1jfnpj.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 21343 confirmed quit Oleh Krehel writes: >> Am 25.08.2015 um 15:11 schrieb Oleh Krehel: >>> To reproduce, paste this code into *scratch*, "|" is the point: >>> >>> ("|foo" >>> ";; (bar)") >>> >>> M-x indent-sexp will result in " ;" being inserted after the sexp. > > `parse-partial-sexp' will detect comment on line 2 only when called in a > sequence that `indent-sexp' calls it, i.e. with the previous pps data > passed to the second pps call. In fact, the problem already occurs on the 1st line: calling `parse-partial-sexp' from within a string gives wrong results, since it doesn't look at the starting quote. You can reproduce the bug with just "|;" A solution could be to use syntax-ppss to go to start of string before parsing (though I wonder if syntax-ppss should be used more for the parsing itself in that case, it seems like there's a lot of work going that probably duplicates what's already being done): diff --git c/lisp/emacs-lisp/lisp-mode.el i/lisp/emacs-lisp/lisp-mode.el index a277d7a..8b5efa3 100644 --- c/lisp/emacs-lisp/lisp-mode.el +++ i/lisp/emacs-lisp/lisp-mode.el @@ -1070,6 +1070,10 @@ indent-sexp ;; Get error now if we don't have a complete sexp after point. (save-excursion (forward-sexp 1))) (save-excursion + (let ((syn-start (nth 8 (syntax-ppss)))) + (when syn-start + (unless endpos (setq starting-point syn-start)) + (goto-char syn-start))) (setq outer-loop-done nil) (while (if endpos (< (point) endpos) (not outer-loop-done)) From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Mar 2017 06:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: Oleh Krehel Cc: Andreas =?UTF-8?Q?R=C3=B6hler?= , 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.148869430120654 (code B ref 21343); Sun, 05 Mar 2017 06:12:01 +0000 Received: (at 21343) by debbugs.gnu.org; 5 Mar 2017 06:11:41 +0000 Received: from localhost ([127.0.0.1]:40484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckPOO-0005N3-Iv for submit@debbugs.gnu.org; Sun, 05 Mar 2017 01:11:41 -0500 Received: from mail-io0-f172.google.com ([209.85.223.172]:35365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckPOM-0005Mh-6e; Sun, 05 Mar 2017 01:11:38 -0500 Received: by mail-io0-f172.google.com with SMTP id z13so52424623iof.2; Sat, 04 Mar 2017 22:11:38 -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; bh=dWJHT+A495pU95Zt6t4mih16CWkdbdq0owEDEW4eG80=; b=RvIR2+L/hPvR6Zg7W7cxCHxud7WRR4RbmXxJ0Wq5nqqZce79mhc5xveuJzHpW/8E7Z 4D4IPedA+nOLmI6QowIK7KOY3+6QAnyTRJ6ZZdqd+jlgSAJbCo7yUa1/I7whoaDDd/Fa JUUGUoIKz+puZmmT6yEwB7JVP8YJDdaFKaN8OlNxtRBdSSjKR2k6Lkt8LA7OaZn+IyLY EimnGTjqOiKhzmluhzOqHFlIsji1we+lew2zY4jwi2R/d4zNoZtA+pG/wqHAawGNAok6 5JMADqPvceS2z2BPFGORwWQhJczkD6c4YAgEg3NoDATuP9pd7WxZYWw7cz7XdxR23FNH wpfA== 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; bh=dWJHT+A495pU95Zt6t4mih16CWkdbdq0owEDEW4eG80=; b=jFpkvuV0fc1d3It6oykbSkQZw/CJ9DTF7eaMz6oVNeLg03u5iP6fS7+2DVa0aPKOvG bKpR20i19LNzApTplEwryG992ujGieQ1e2D0H16DCfgx3eeKTSM9BHRM/DCuvlJY5URz B/I2o3yD/ebpB2apzdp3jfhbXK/pq0qS+WYWVJW2nfz1+EFD1HXS5VPrWlgw8ZdZjgwj uIrxOKgBF5Pai29Hihv/RIszsfevFKasFCifgT3Z4RPE3iHe0kyx0lrHnKWthYq4eoPf lrdGUaZL5xflLxkLB1gPN8G8wRfCbRUvHNtFgP2o89uq9tLuV94GsSg/tKHjaV1XkOHh lRRA== X-Gm-Message-State: AMke39koyJ8IgsqypxI4jZNoxCe8lje64VfojMD43q830aKWyoAwsd7we8+QCvBY74Bb7Q== X-Received: by 10.107.5.137 with SMTP id 131mr10270585iof.87.1488694291615; Sat, 04 Mar 2017 22:11:31 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 62sm4555653itl.1.2017.03.04.22.11.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Mar 2017 22:11:30 -0800 (PST) From: npostavs@users.sourceforge.net References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> <87pp2awaqp.fsf@gmail.com> <87lh1jfnpj.fsf@users.sourceforge.net> Date: Sun, 05 Mar 2017 01:12:45 -0500 In-Reply-To: <87lh1jfnpj.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 02 Jul 2016 22:40:56 -0400") Message-ID: <87d1dw9rqa.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain tags 21343 patch quit npostavs@users.sourceforge.net writes: > A solution could be to use syntax-ppss to go to start of string before > parsing (though I wonder if syntax-ppss should be used more for the > parsing itself in that case, it seems like there's a lot of work going > that probably duplicates what's already being done): Actually, it turns out using syntax-ppss in the loop is slower, at least in the case of calling `pp' on a big list (which is a pessimal case for a cache based parser). Here is a patch (the first one just simplifies the code). --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v1-0001-lisp-emacs-lisp-lisp-mode.el-indent-sexp-Simplify.patch Content-Description: patch >From bada5e84d79e38ff386685f9b6b80fdf4e3b0988 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 Mar 2017 00:16:13 -0500 Subject: [PATCH v1 1/2] * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Simplify. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp): (indent-subsexp, indent-sexp-in-string): New tests. --- lisp/emacs-lisp/lisp-mode.el | 169 ++++++++++++++------------------ test/lisp/emacs-lisp/lisp-mode-tests.el | 92 +++++++++++++++++ 2 files changed, 165 insertions(+), 96 deletions(-) create mode 100644 test/lisp/emacs-lisp/lisp-mode-tests.el diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d720e0bc57..de0e66039a 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1056,103 +1056,80 @@ indent-sexp If optional arg ENDPOS is given, indent each line, stopping when ENDPOS is encountered." (interactive) - (let ((indent-stack (list nil)) - (next-depth 0) - ;; If ENDPOS is non-nil, use nil as STARTING-POINT - ;; so that calculate-lisp-indent will find the beginning of - ;; the defun we are in. - ;; If ENDPOS is nil, it is safe not to scan before point - ;; since every line we indent is more deeply nested than point is. - (starting-point (if endpos nil (point))) - (last-point (point)) - last-depth bol outer-loop-done inner-loop-done state this-indent) - (or endpos - ;; Get error now if we don't have a complete sexp after point. - (save-excursion (forward-sexp 1))) + (let* ((indent-stack (list nil)) + ;; If ENDPOS is non-nil, use beginning of defun as STARTING-POINT. + ;; If ENDPOS is nil, it is safe not to scan before point + ;; since every line we indent is more deeply nested than point is. + (starting-point (save-excursion (if endpos (beginning-of-defun)) + (point))) + (state nil) + (init-depth 0) + (next-depth 0) + (last-depth 0) + (last-syntax-point (point))) + (unless endpos + ;; Get error now if we don't have a complete sexp after point. + (save-excursion (forward-sexp 1) + ;; We need a marker because we modify the buffer + ;; text preceding endpos. + (setq endpos (point-marker)))) (save-excursion - (setq outer-loop-done nil) - (while (if endpos (< (point) endpos) - (not outer-loop-done)) - (setq last-depth next-depth - inner-loop-done nil) - ;; Parse this line so we can learn the state - ;; to indent the next line. - ;; This inner loop goes through only once - ;; unless a line ends inside a string. - (while (and (not inner-loop-done) - (not (setq outer-loop-done (eobp)))) - (setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) - nil nil state)) - (setq next-depth (car state)) - ;; If the line contains 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. - (if (car (nthcdr 4 state)) - (progn (indent-for-comment) - (end-of-line) - (setcar (nthcdr 4 state) nil))) - ;; If this line ends inside a string, - ;; go straight to next line, remaining within the inner loop, - ;; and turn off the \-flag. - (if (car (nthcdr 3 state)) - (progn - (forward-line 1) - (setcar (nthcdr 5 state) nil)) - (setq inner-loop-done t))) - (and endpos - (<= next-depth 0) - (progn - (setq indent-stack (nconc indent-stack - (make-list (- next-depth) nil)) - last-depth (- last-depth next-depth) - next-depth 0))) - (forward-line 1) - ;; Decide whether to exit. - (if endpos - ;; If we have already reached the specified end, - ;; give up and do not reindent this line. - (if (<= endpos (point)) - (setq outer-loop-done t)) - ;; If no specified end, we are done if we have finished one sexp. - (if (<= next-depth 0) - (setq outer-loop-done t))) - (unless outer-loop-done - (while (> last-depth next-depth) - (setq indent-stack (cdr indent-stack) - last-depth (1- last-depth))) - (while (< last-depth next-depth) - (setq indent-stack (cons nil indent-stack) - last-depth (1+ last-depth))) - ;; Now indent the next line according - ;; to what we learned from parsing the previous one. - (setq bol (point)) - (skip-chars-forward " \t") - ;; But not if the line is blank, or just a comment - ;; (except for double-semi comments; indent them as usual). - (if (or (eobp) (looking-at "\\s<\\|\n")) - nil - (if (and (car indent-stack) - (>= (car indent-stack) 0)) - (setq this-indent (car indent-stack)) - (let ((val (calculate-lisp-indent - (if (car indent-stack) (- (car indent-stack)) - starting-point)))) - (if (null val) - (setq this-indent val) - (if (integerp val) - (setcar indent-stack - (setq this-indent val)) - (setcar indent-stack (- (car (cdr val)))) - (setq this-indent (car val)))))) - (if (and this-indent (/= (current-column) this-indent)) - (progn (delete-region bol (point)) - (indent-to this-indent))))) - (or outer-loop-done - (setq outer-loop-done (= (point) last-point)) - (setq last-point (point))))))) + (while (< (point) endpos) + ;; Parse this line so we can learn the state to indent the + ;; next line. + (setq state (parse-partial-sexp + last-syntax-point (progn (end-of-line) (point)) + nil nil state)) + ;; If a string continues past end of line, skip to its end. + (when (nth 3 state) + (setq state (parse-partial-sexp (point) (point-max) + nil nil state 'syntax-table))) + (setq next-depth (car state)) + ;; If the line contains a comment indent it now with + ;; `indent-for-comment'. + (when (nth 4 state) + (indent-for-comment) + (end-of-line)) + (setq last-syntax-point (point)) + (when (< next-depth init-depth) + (setq indent-stack (nconc indent-stack + (make-list (- init-depth next-depth) nil)) + last-depth (- last-depth next-depth) + next-depth init-depth)) + (forward-line 1) + (when (< (point) endpos) + (let ((depth-delta (- next-depth last-depth))) + (cond ((< depth-delta 0) + (setq indent-stack (nthcdr (- depth-delta) indent-stack))) + ((> depth-delta 0) + (setq indent-stack (nconc (make-list depth-delta nil) + indent-stack)))) + (setq last-depth next-depth)) + ;; Now indent the next line according + ;; to what we learned from parsing the previous one. + (let ((bol (point))) + (skip-chars-forward " \t") + ;; But not if the line is blank, or just a comment (we + ;; already called `indent-for-comment' above). + (unless (or (eolp) (eq (char-syntax (char-after)) ?<)) + (let ((this-indent (car indent-stack))) + (when (listp this-indent) + (let ((val (calculate-lisp-indent + (or (car this-indent) starting-point)))) + (setq + this-indent + (cond ((integerp val) + (setf (car indent-stack) val)) + ((consp val) ; (COLUMN CONTAINING-SEXP-START) + (setf (car indent-stack) (cdr val)) + (car val)) + ;; `calculate-lisp-indent' only returns nil + ;; when we're in a string, but this won't + ;; happen because we skip strings above. + (t (error "This shouldn't happen!")))))) + (when (/= (current-column) this-indent) + (delete-region bol (point)) + (indent-to this-indent)))))))))) (defun indent-pp-sexp (&optional arg) "Indent each line of the list starting just after point, or prettyprint it. diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el new file mode 100644 index 0000000000..1972396112 --- /dev/null +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -0,0 +1,92 @@ +;;; lisp-mode-tests.el --- Test Lisp editing commands -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'cl-lib) +(require 'lisp-mode) + +(ert-deftest indent-sexp () + "Test basics of \\[indent-sexp]." + (with-temp-buffer + (insert "\ +\(a + (prog1 + (prog1 + 1 + 2) + 2) + (1 + \"string +ending\" + 2) ; comment + ;; comment + b)") + (goto-char (point-min)) + (let ((indent-tabs-mode nil) + (correct (buffer-string))) + (dolist (mode '(fundamental-mode emacs-lisp-mode)) + (funcall mode) + (indent-sexp) + ;; Don't mess up correctly indented code. + (should (string= (buffer-string) correct)) + ;; Correctly add indentation. + (save-excursion + (while (not (eobp)) + (delete-horizontal-space) + (forward-line))) + (indent-sexp) + (should (equal (buffer-string) correct)) + ;; Correctly remove indentation. + (save-excursion + (let ((n 0)) + (while (not (eobp)) + (insert (make-string n ?\s)) + (cl-incf n) + (back-to-indentation) + (forward-line (if (eq (char-after) ?\") 2 1))))) + (indent-sexp) + (should (equal (buffer-string) correct)))))) + +(ert-deftest indent-subsexp () + "Make sure calling `indent-sexp' inside a sexp works." + (with-temp-buffer + (insert "\ +\(d1 xx + (d2 yy + zz) + 11)") + (let ((correct (buffer-string))) + (search-backward "d2") + (up-list -1) + (indent-sexp) + (should (equal (buffer-string) correct))))) + +(ert-deftest indent-sexp-in-string () + "Make sure calling `indent-sexp' inside a string works." + ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21343. + (with-temp-buffer + (emacs-lisp-mode) + (insert "\";\"") + (let ((correct (buffer-string))) + (search-backward ";") + (indent-sexp) + (should (equal (buffer-string) correct))))) + +(provide 'lisp-mode-tests) +;;; lisp-mode-tests.el ends here -- 2.11.1 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0002-Fix-indent-sexp-when-called-from-inside-a-string-.patch Content-Description: patch >From b318e8c0bdd0f08b49f7f8c635bf886d967bc742 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 Mar 2017 00:53:58 -0500 Subject: [PATCH v1 2/2] Fix indent-sexp when called from inside a string (Bug#21343) * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Get initial syntax parse state from `syntax-ppss'. --- lisp/emacs-lisp/lisp-mode.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index de0e66039a..ce61c69f3c 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1062,10 +1062,14 @@ indent-sexp ;; since every line we indent is more deeply nested than point is. (starting-point (save-excursion (if endpos (beginning-of-defun)) (point))) - (state nil) - (init-depth 0) - (next-depth 0) - (last-depth 0) + ;; Use `syntax-ppss' to get initial state so we don't get + ;; confused by starting inside a string. We don't use + ;; `syntax-ppss' in the loop, because this is measurably + ;; slower when we're called on a long list. + (state (syntax-ppss)) + (init-depth (car state)) + (next-depth init-depth) + (last-depth init-depth) (last-syntax-point (point))) (unless endpos ;; Get error now if we don't have a complete sexp after point. -- 2.11.1 --=-=-=-- From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Mar 2017 13:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch To: Oleh Krehel Cc: Andreas =?UTF-8?Q?R=C3=B6hler?= , 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.148872229913669 (code B ref 21343); Sun, 05 Mar 2017 13:59:01 +0000 Received: (at 21343) by debbugs.gnu.org; 5 Mar 2017 13:58:19 +0000 Received: from localhost ([127.0.0.1]:40618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckWfx-0003YO-RC for submit@debbugs.gnu.org; Sun, 05 Mar 2017 08:58:18 -0500 Received: from mail-it0-f47.google.com ([209.85.214.47]:34754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckWfv-0003Y9-Jn for 21343@debbugs.gnu.org; Sun, 05 Mar 2017 08:58:16 -0500 Received: by mail-it0-f47.google.com with SMTP id m27so2567584iti.1 for <21343@debbugs.gnu.org>; Sun, 05 Mar 2017 05:58:15 -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; bh=ud8CB2Rul4dAFyaTDpkdFsMQz+fV2KR+NJhqTVDjxlk=; b=A9kcHf25x5iAp6a8un0/s35qTT0STq4QNPdl05txyUDQjkI7CR/zNHbNiprbo6MpKy gEg9lWRPpJMAXpAOmBSzS5t6Oi7MYmqXdSGqyn5t2sCFNGGh8YwTGR3t+lUQZRtSSGa4 bj4ceuS1lqXPt4aTdB53QsRNAYn2BxH45yczvFktwndGzzP82VKijzEQ5Hj3I9lTCf5B 2cJr0agXcXBut0Xm8/cPKbV9erFZ+YO3VbBiIUUYsb1rnp0C7rfvSh3kKQwTPtAXxhS4 vRpinbq1jQwcqrnlsQEQrS8Wc0MnvFNITBIx8qGfNMW1vTZe4/OBwy0Wypk9egVZSqK1 Ymzw== 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; bh=ud8CB2Rul4dAFyaTDpkdFsMQz+fV2KR+NJhqTVDjxlk=; b=Qlt3AATVjoNrqrCxHpvB/21je+OM/Dt2DsDzvNvUE1u2m2xoFB9WMYb6Eckp25O08C XykzaefgWufu3gee/owo0EUIDcQIJHkHvLCLmZWrmiOiUmmMClaiaCjCnYtl8oQ+LXNA DiyP8Qo0Lxk4xfSF7XretO0CHjQNFdStWqm+06Ha4jAXPYxfXyBn9Bsu6jR+Qsz/FycO 1RYbnR5ZC/ip7ILZVJ79Za8cAnqOMzOUq+KaLGHpqWCkaryqH/gJX7XqZnr7m0fJuShL KL8wQUW/VOHFb9aQhr13AbPFk8jdhSmhWQkRUd8GSxjU0fmwQqfJH+wh4r1tyG3eBFjG jfsw== X-Gm-Message-State: AMke39ku4xYDcjXXHw9YTvnJYnyeN3T7PqrNuTEs28fyB7D3D5mGwJxymVbMIsSFsUtpQg== X-Received: by 10.36.155.11 with SMTP id o11mr11745591itd.11.1488722290016; Sun, 05 Mar 2017 05:58:10 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id h91sm7047732ioi.24.2017.03.05.05.58.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Mar 2017 05:58:08 -0800 (PST) From: npostavs@users.sourceforge.net References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> <87pp2awaqp.fsf@gmail.com> <87lh1jfnpj.fsf@users.sourceforge.net> <87d1dw9rqa.fsf@users.sourceforge.net> Date: Sun, 05 Mar 2017 08:59:23 -0500 In-Reply-To: <87d1dw9rqa.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sun, 05 Mar 2017 01:12:45 -0500") Message-ID: <87a88zakp0.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain npostavs@users.sourceforge.net writes: > Here is a patch (the first one just simplifies the code). I had a mistake in the first patch, here's a corrected version. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v2-0001-lisp-emacs-lisp-lisp-mode.el-indent-sexp-Simplify.patch Content-Description: patch >From 053902dc2ad32f96c56f2231f6075a99d9596fa9 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 Mar 2017 00:16:13 -0500 Subject: [PATCH v2] * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Simplify. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp): (indent-subsexp, indent-sexp-in-string): New tests. --- lisp/emacs-lisp/lisp-mode.el | 171 ++++++++++++++------------------ test/lisp/emacs-lisp/lisp-mode-tests.el | 94 ++++++++++++++++++ 2 files changed, 169 insertions(+), 96 deletions(-) create mode 100644 test/lisp/emacs-lisp/lisp-mode-tests.el diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d720e0bc57..507fb8aebe 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1056,103 +1056,82 @@ indent-sexp If optional arg ENDPOS is given, indent each line, stopping when ENDPOS is encountered." (interactive) - (let ((indent-stack (list nil)) - (next-depth 0) - ;; If ENDPOS is non-nil, use nil as STARTING-POINT - ;; so that calculate-lisp-indent will find the beginning of - ;; the defun we are in. - ;; If ENDPOS is nil, it is safe not to scan before point - ;; since every line we indent is more deeply nested than point is. - (starting-point (if endpos nil (point))) - (last-point (point)) - last-depth bol outer-loop-done inner-loop-done state this-indent) - (or endpos - ;; Get error now if we don't have a complete sexp after point. - (save-excursion (forward-sexp 1))) + (let* ((indent-stack (list nil)) + ;; If ENDPOS is non-nil, use beginning of defun as STARTING-POINT. + ;; If ENDPOS is nil, it is safe not to scan before point + ;; since every line we indent is more deeply nested than point is. + (starting-point (save-excursion (if endpos (beginning-of-defun)) + (point))) + (state nil) + (init-depth 0) + (next-depth 0) + (last-depth 0) + (last-syntax-point (point))) + (unless endpos + ;; Get error now if we don't have a complete sexp after point. + (save-excursion (forward-sexp 1) + ;; We need a marker because we modify the buffer + ;; text preceding endpos. + (setq endpos (point-marker)))) (save-excursion - (setq outer-loop-done nil) - (while (if endpos (< (point) endpos) - (not outer-loop-done)) - (setq last-depth next-depth - inner-loop-done nil) - ;; Parse this line so we can learn the state - ;; to indent the next line. - ;; This inner loop goes through only once - ;; unless a line ends inside a string. - (while (and (not inner-loop-done) - (not (setq outer-loop-done (eobp)))) - (setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) - nil nil state)) - (setq next-depth (car state)) - ;; If the line contains 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. - (if (car (nthcdr 4 state)) - (progn (indent-for-comment) - (end-of-line) - (setcar (nthcdr 4 state) nil))) - ;; If this line ends inside a string, - ;; go straight to next line, remaining within the inner loop, - ;; and turn off the \-flag. - (if (car (nthcdr 3 state)) - (progn - (forward-line 1) - (setcar (nthcdr 5 state) nil)) - (setq inner-loop-done t))) - (and endpos - (<= next-depth 0) - (progn - (setq indent-stack (nconc indent-stack - (make-list (- next-depth) nil)) - last-depth (- last-depth next-depth) - next-depth 0))) - (forward-line 1) - ;; Decide whether to exit. - (if endpos - ;; If we have already reached the specified end, - ;; give up and do not reindent this line. - (if (<= endpos (point)) - (setq outer-loop-done t)) - ;; If no specified end, we are done if we have finished one sexp. - (if (<= next-depth 0) - (setq outer-loop-done t))) - (unless outer-loop-done - (while (> last-depth next-depth) - (setq indent-stack (cdr indent-stack) - last-depth (1- last-depth))) - (while (< last-depth next-depth) - (setq indent-stack (cons nil indent-stack) - last-depth (1+ last-depth))) - ;; Now indent the next line according - ;; to what we learned from parsing the previous one. - (setq bol (point)) - (skip-chars-forward " \t") - ;; But not if the line is blank, or just a comment - ;; (except for double-semi comments; indent them as usual). - (if (or (eobp) (looking-at "\\s<\\|\n")) - nil - (if (and (car indent-stack) - (>= (car indent-stack) 0)) - (setq this-indent (car indent-stack)) - (let ((val (calculate-lisp-indent - (if (car indent-stack) (- (car indent-stack)) - starting-point)))) - (if (null val) - (setq this-indent val) - (if (integerp val) - (setcar indent-stack - (setq this-indent val)) - (setcar indent-stack (- (car (cdr val)))) - (setq this-indent (car val)))))) - (if (and this-indent (/= (current-column) this-indent)) - (progn (delete-region bol (point)) - (indent-to this-indent))))) - (or outer-loop-done - (setq outer-loop-done (= (point) last-point)) - (setq last-point (point))))))) + (while (< (point) endpos) + ;; Parse this line so we can learn the state to indent the + ;; next line. + (while (progn + (setq state (parse-partial-sexp + last-syntax-point (progn (end-of-line) (point)) + nil nil state)) + ;; Skip over newlines within strings. + (nth 3 state)) + (setq state (parse-partial-sexp (point) (point-max) + nil nil state 'syntax-table)) + (setq last-syntax-point (point))) + (setq next-depth (car state)) + ;; If the line contains a comment indent it now with + ;; `indent-for-comment'. + (when (nth 4 state) + (indent-for-comment) + (end-of-line)) + (setq last-syntax-point (point)) + (when (< next-depth init-depth) + (setq indent-stack (nconc indent-stack + (make-list (- init-depth next-depth) nil)) + last-depth (- last-depth next-depth) + next-depth init-depth)) + (forward-line 1) + (when (< (point) endpos) + (let ((depth-delta (- next-depth last-depth))) + (cond ((< depth-delta 0) + (setq indent-stack (nthcdr (- depth-delta) indent-stack))) + ((> depth-delta 0) + (setq indent-stack (nconc (make-list depth-delta nil) + indent-stack)))) + (setq last-depth next-depth)) + ;; Now indent the next line according + ;; to what we learned from parsing the previous one. + (let ((bol (point))) + (skip-chars-forward " \t") + ;; But not if the line is blank, or just a comment (we + ;; already called `indent-for-comment' above). + (unless (or (eolp) (eq (char-syntax (char-after)) ?<)) + (let ((this-indent (car indent-stack))) + (when (listp this-indent) + (let ((val (calculate-lisp-indent + (or (car this-indent) starting-point)))) + (setq + this-indent + (cond ((integerp val) + (setf (car indent-stack) val)) + ((consp val) ; (COLUMN CONTAINING-SEXP-START) + (setf (car indent-stack) (cdr val)) + (car val)) + ;; `calculate-lisp-indent' only returns nil + ;; when we're in a string, but this won't + ;; happen because we skip strings above. + (t (error "This shouldn't happen!")))))) + (when (/= (current-column) this-indent) + (delete-region bol (point)) + (indent-to this-indent)))))))))) (defun indent-pp-sexp (&optional arg) "Indent each line of the list starting just after point, or prettyprint it. diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el new file mode 100644 index 0000000000..2801f23df6 --- /dev/null +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -0,0 +1,94 @@ +;;; lisp-mode-tests.el --- Test Lisp editing commands -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'cl-lib) +(require 'lisp-mode) + +(ert-deftest indent-sexp () + "Test basics of \\[indent-sexp]." + (with-temp-buffer + (insert "\ +\(a + (prog1 + (prog1 + 1 + 2) + 2) + (1 + \"string +noindent\" (\"string2 +noindent\" 3 +4) + 2) ; comment + ;; comment + b)") + (goto-char (point-min)) + (let ((indent-tabs-mode nil) + (correct (buffer-string))) + (dolist (mode '(fundamental-mode emacs-lisp-mode)) + (funcall mode) + (indent-sexp) + ;; Don't mess up correctly indented code. + (should (string= (buffer-string) correct)) + ;; Correctly add indentation. + (save-excursion + (while (not (eobp)) + (delete-horizontal-space) + (forward-line))) + (indent-sexp) + (should (equal (buffer-string) correct)) + ;; Correctly remove indentation. + (save-excursion + (let ((n 0)) + (while (not (eobp)) + (unless (looking-at "noindent") + (insert (make-string n ?\s))) + (cl-incf n) + (forward-line)))) + (indent-sexp) + (should (equal (buffer-string) correct)))))) + +(ert-deftest indent-subsexp () + "Make sure calling `indent-sexp' inside a sexp works." + (with-temp-buffer + (insert "\ +\(d1 xx + (d2 yy + zz) + 11)") + (let ((correct (buffer-string))) + (search-backward "d2") + (up-list -1) + (indent-sexp) + (should (equal (buffer-string) correct))))) + +(ert-deftest indent-sexp-in-string () + "Make sure calling `indent-sexp' inside a string works." + ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21343. + (with-temp-buffer + (emacs-lisp-mode) + (insert "\";\"") + (let ((correct (buffer-string))) + (search-backward ";") + (indent-sexp) + (should (equal (buffer-string) correct))))) + +(provide 'lisp-mode-tests) +;;; lisp-mode-tests.el ends here -- 2.11.1 --=-=-=-- From unknown Wed Jun 25 05:43:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21343: 24.5; parse-partial-sexp mistakes string for a comment Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Mar 2017 00:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch To: Oleh Krehel Cc: Andreas =?UTF-8?Q?R=C3=B6hler?= , 21343@debbugs.gnu.org Received: via spool by 21343-submit@debbugs.gnu.org id=B21343.14893640787407 (code B ref 21343); Mon, 13 Mar 2017 00:15:02 +0000 Received: (at 21343) by debbugs.gnu.org; 13 Mar 2017 00:14:38 +0000 Received: from localhost ([127.0.0.1]:53012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnDdF-0001vK-Q8 for submit@debbugs.gnu.org; Sun, 12 Mar 2017 20:14:37 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:34711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnDdD-0001v3-Rf; Sun, 12 Mar 2017 20:14:36 -0400 Received: by mail-io0-f193.google.com with SMTP id n76so11943507ioe.1; Sun, 12 Mar 2017 17:14:35 -0700 (PDT) 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; bh=lKEVlmhW0cjEaH1rNvKtR6fn7FZHc5VrIuGBOj+XUaQ=; b=RFaoRAWs7XeqbP3hNpc2994WxmjOT89wddQ9yA8VmEwQ6D/1tINPaxbsiBceFRgYnk s45fX0DDgQ4Jhay0eu5LryGJEFLE7rly9zzlT+37O8M8AFeTQNaPmkGr5xArLrVZKL8X hBAk7NOm1RsYk70LyrovSPF/m6aFtItzmKSrvhXnXSbURPZste3vv2LhS1bufSrGgpBp wxrekSlGMRmkGqgbnSM9A+Fx5aoq/a7vUtiewv2SwGP5iNwNDSbzbU4fapkglDN95bsE mjM/Faiok7VDLEuSeWLU5F6mk+8RJAs+qo6fl6ncUHkyGyVLGifiW6CBnIRQrHy18913 iCug== 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; bh=lKEVlmhW0cjEaH1rNvKtR6fn7FZHc5VrIuGBOj+XUaQ=; b=AKVwoklgpQB6PWq8bnU7Pbnl3+XIrwsZwy9GSVjxpINdjwKpW1jmwd3TmJO01pfQ4Y cbWdb+nyjaGNWObOPMQaeZan3lMWQ0FElhNFJLuSHA9ZjXGGy5J4ZECi3bHuqX+b9Tib D4fzL5MLITNXffvZSKmbX9z55etDFiAb+uPt5GGUX+AgEn59IKuYa99HV7TA2dzSBc9S 9YiNYowyg+YNDaFXBvSXKX/+DvSHnUg2R/NEXui38KvQr+B66bdISrJ+3k6R9kjX7lxN ll/zozTwhUcaDYF0OrZ5WukCWAAxdHiCTa72ncB9UnMGbwpEaPL34HmHj1nq1fusPDz2 yLyg== X-Gm-Message-State: AMke39mYjtO1eLtYgX6Vzy0P+fVxfJUrkXjF/aZk7ExNFDkfBjfTSiuvhQf1FLgmm1G7Tw== X-Received: by 10.107.41.212 with SMTP id p203mr27020305iop.13.1489364070357; Sun, 12 Mar 2017 17:14:30 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id v197sm3387062ita.2.2017.03.12.17.14.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Mar 2017 17:14:29 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87lhczjyx5.fsf@gmail.com> <55DCA9C7.7070609@easy-emacs.de> <87pp2awaqp.fsf@gmail.com> <87lh1jfnpj.fsf@users.sourceforge.net> <87d1dw9rqa.fsf@users.sourceforge.net> <87a88zakp0.fsf@users.sourceforge.net> Date: Sun, 12 Mar 2017 20:15:47 -0400 In-Reply-To: <87a88zakp0.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sun, 05 Mar 2017 08:59:23 -0500") Message-ID: <87o9x66ngs.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.8 (/) tags 21343 fixed close 21343 26.1 quit npostavs@users.sourceforge.net writes: > npostavs@users.sourceforge.net writes: > >> Here is a patch (the first one just simplifies the code). > > I had a mistake in the first patch, here's a corrected version. Pushed to master [1: cf670b49a7]. 1: 2017-03-12 20:08:32 -0400 cf670b49a7704d63575863f832426d32bf6a8c3c Fix indent-sexp when called from inside a string (Bug#21343)