From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#35286: 26.2; indent-sexp broken Date: Mon, 15 Apr 2019 20:14:58 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4678"; mail-complaints-to="usenet@blaine.gmane.org" To: 35286@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 15 14:16:22 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hG0X7-00011m-MY for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Apr 2019 14:16:21 +0200 Original-Received: from localhost ([127.0.0.1]:49416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG0X1-00082c-9l for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Apr 2019 08:16:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG0Wp-00080e-7z for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:16:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG0Wo-0000a9-DY for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hG0Wo-0000a4-6i for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hG0Wn-0002Xm-SJ for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2019 12:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35286 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15553305159709 (code B ref -1); Mon, 15 Apr 2019 12:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Apr 2019 12:15:15 +0000 Original-Received: from localhost ([127.0.0.1]:34207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hG0W3-0002WX-6J for submit@debbugs.gnu.org; Mon, 15 Apr 2019 08:15:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hG0W0-0002WF-Um for submit@debbugs.gnu.org; Mon, 15 Apr 2019 08:15:13 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hG0Vv-00009p-K7 for submit@debbugs.gnu.org; Mon, 15 Apr 2019 08:15:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG0Vu-0007mF-JO for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG0Vt-00009N-QQ for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:15:06 -0400 Original-Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:43573) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hG0Vt-00008z-I6 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2019 08:15:05 -0400 Original-Received: by mail-pf1-x42a.google.com with SMTP id c8so8490193pfd.10 for ; Mon, 15 Apr 2019 05:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=WLvbVHHn+WGLMlO2jiCKvJ4uSV8qDRkMxirzbc9DLdQ=; b=bk/crdTDDmGeuYziPXeY31eRr5QBBwafm/5nfn7xd5XfJaRwutSB7fRgU16klqaNf4 SEYIqMzKIy33M81/40xxf7eOs+aRJHYGiPkVenxT/oqOOOSRj/EFDnY8LUIUjEd4U3cW mx49avwM//qJdPR11yusaAuyWF0sxmcQcj6JK98/YITYczdIgdSrFZ0lvh57dBJNvTSL MXOxVcjCq6TGHcTSc+ozjCpqJLOuZP3BGNgl/Wau4lAOJz7zZGkbuvZ9rVQWEf0qXNmO ljzKKvVCGi8dzD0jDEPUg/id1ExK2T8e+GbGvz+wZwmlEdLY/jmEWyAODcLCOhkjWLPS gRnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=WLvbVHHn+WGLMlO2jiCKvJ4uSV8qDRkMxirzbc9DLdQ=; b=p+4J8GINaDezRQs5tZROywzEn5Cj3s7r9oLepmFBdO3lzjkC1/A7bdg0GaFUpuAHQS U5JyIQFEU5y4bpPwpKuP2RTrBQDzYY16xvu9zoXjv5AVp0biEmrNeDSR/yl9tCVpYgC0 YVp2WA9IyYYyoVt2EvOSMQ2jumZgcU4eOUB4csvoP/+PaV//LX3o+S902jS4V+2x9KpM nS4bGbSgrNn4+FghQ+7BPvaN3Ksk6hi61WHg+IBsugpu43blrJXFbckBuDZ1sW9pjp0X lPY3Ij06Uj8djh92gO6dhdwwl0N3Ss1xiAXCtFO2RKDW4XQFEhSEChrkc5fiwyxPyzbL Cvhg== X-Gm-Message-State: APjAAAWGWdwn0jy4r3AMbH/oyaNMSYt5wSFNwgfqDNLjbnQ6lPIPxiy7 2aZLkOBBf851tk5OdIpTg2BH9Er9 X-Google-Smtp-Source: APXvYqxgqc2SL9WuhrFPp8BwJCv/iydNqH0Eucn/drYam4zzNDmWGiXtI8k1opawFLd2f3nhyzb9AQ== X-Received: by 2002:a63:ef4c:: with SMTP id c12mr56977776pgk.43.1555330502990; Mon, 15 Apr 2019 05:15:02 -0700 (PDT) Original-Received: from Zeuss-MacBook-Air.local ([112.208.181.189]) by smtp.gmail.com with ESMTPSA id y10sm74480318pfm.27.2019.04.15.05.15.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 05:15:02 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 209.51.188.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:157655 Archived-At: I am only using the following ruby code to demonstrate the issue. I noticed this issue while editing other programming text. def sum_eq_n?(arr, n) return true if arr.empty? && n == 0 arr.product(arr).reject { |a,b| a == b }.any? !{ |a,b| a + b == n } # def sum_eq_n?(arr, n) return true if arr.empty? && n == 0 arr.product(arr).reject { |a,b| a == b }.any? { |a,b| a + b == n } end Put the above ruby code in a ruby-mode buffer. ! is used to indicate where point is and is not part of the code. M-x indent-sexp and see indentation of every line after the point changed. The bug is caused by the following unsafe part of indent-sexp introduced in 26.2: (save-excursion (let ((eol (line-end-position))) (forward-sexp 1) (condition-case () (while (and (< (point) eol) (not (eobp))) (forward-sexp 1)) (scan-error nil))) (point)) which can easily include two or more sexps after point. This looks like a major breakage.