From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#19342: auto-fill scan-error in sh-mode Date: Thu, 19 Aug 2021 15:29:10 +0200 Message-ID: <87tujl7ec9.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 19342@debbugs.gnu.org, Stefan Monnier To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 19 15:30:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGi7r-00023T-UO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 15:30:31 +0200 Original-Received: from localhost ([::1]:39186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGi7q-0005Lb-PH for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 09:30:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGi7P-0005Je-6g for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 09:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGi7O-0003rw-Vl for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 09:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGi7O-0000CL-Mo for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 09:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Aug 2021 13:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19342 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 19342-submit@debbugs.gnu.org id=B19342.1629379768680 (code B ref 19342); Thu, 19 Aug 2021 13:30:02 +0000 Original-Received: (at 19342) by debbugs.gnu.org; 19 Aug 2021 13:29:28 +0000 Original-Received: from localhost ([127.0.0.1]:58852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGi6p-0000Au-Ki for submit@debbugs.gnu.org; Thu, 19 Aug 2021 09:29:27 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:49450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGi6n-0000Ae-JI for 19342@debbugs.gnu.org; Thu, 19 Aug 2021 09:29:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eHC6LW/zkMivOcabi+5buQbq6Hj7lc5Zg8pFIh+zYvw=; b=JzyoMFqkz1q0ldSDj4p0D/UJFg qdL+EZUaZayF/YDMLuGIIAwvWyqxeWenaFo/4GjhWviuEH9MJt6MzqLgu5N/4kYnDIrqdt/QjzVnO 6R1wkg6TGXRtkqQZt+aC7TV4thRCtUb2K3DJAcZe5di0FQaI54nYn1G1ZPgPEpAWdpWA=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGi6b-0006MK-PV; Thu, 19 Aug 2021 15:29:18 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 10 Dec 2014 16:51:22 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212212 Archived-At: Glenn Morris writes: > Type a long string with spaces, past fill-column; eg: > > foo="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaa > > Auto-fill results in: > > Error: (scan-error "Containing expression ends prematurely" 75 75) This problem is still present in Emacs 28. This is the backtrace: Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 95 95) signal(scan-error ("Containing expression ends prematurely" 95 95)) (if (and (car res) (= pos (point)) (not (if forw (eobp) (bobp)))) ( (let ((pos (point)) (res (if forw (smie-forward-sexp 'halfsexp) (sm (while (/= n 0) (setq n (- n (if forw 1 -1))) (let ((pos (point)) ( (let ((forw (> n 0)) (forward-sexp-function nil)) (while (/= n 0) ( smie-forward-sexp-command(1) forward-sexp(1) (cond ((< 0 (length tok)) (assoc tok smie-grammar)) ((looking-at "\ (let ((tok (funcall smie-forward-token-function))) (cond ((< 0 (len smie-indent-forward-token() smie-indent-keyword() smie--funcall(smie-indent-keyword) run-hook-wrapped(smie--funcall smie-indent-keyword) smie-indent-calculate() smie-auto-fill(#f(compiled-function (&rest args) #)) The code that errors out is: (defun smie-indent-forward-token () [...] ((looking-at "\\s\"\\|\\s|") (forward-sexp 1) That is, if we're auto-filling an unterminated string, it'll always bug out, apparently? I've added Stefan to the CCs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no