From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#24542: 25.1.50; The symbol `@' and sexp scanning Date: Wed, 10 Apr 2024 19:06:32 -0400 Message-ID: References: <8760pj27wm.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33157"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 24542@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 11 01:07:15 2024 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 1ruh2B-0008Ot-AS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Apr 2024 01:07:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruh1r-0005pR-FP; Wed, 10 Apr 2024 19:06:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruh1q-0005pH-6m for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 19:06:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruh1p-0003Ml-VM for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 19:06:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruh1y-00087k-EC for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 19:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 23:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24542 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 24542-submit@debbugs.gnu.org id=B24542.171279041931219 (code B ref 24542); Wed, 10 Apr 2024 23:07:02 +0000 Original-Received: (at 24542) by debbugs.gnu.org; 10 Apr 2024 23:06:59 +0000 Original-Received: from localhost ([127.0.0.1]:54480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruh1v-00087T-1n for submit@debbugs.gnu.org; Wed, 10 Apr 2024 19:06:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruh1s-00086S-Iy for 24542@debbugs.gnu.org; Wed, 10 Apr 2024 19:06:57 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 44B2180C41; Wed, 10 Apr 2024 19:06:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1712790400; bh=cYjkOEWk0c1975l3ganLzmqwEMrBZr92Em4UaKrBIYY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iVQcnNvx7HptFI+eKXdfUIHQ4dpAxWKaoDccJ/A3+NXcePAfUlmRTiWv0BrFxD275 vpXWUj05sKz6P63/E711C7GaW/xcf67qWaJivzKWfkNI3WhsOg/BNJhmWBkPh03eHa VMFvQrsr5fvW1GEbR6fgPIk4dMmjT/Q88Srr/AvWcOAO6ymz0+6EjDRpyAYTct8+k2 KiDBqbaEElt9RLoDTsFQHw5XDo8WTVyp8agaYfstTGt7GcF1Q7LQ2xrTjyLjJA6b+n M+rU9+w25xqIorFi6do8keE8Nfwrgt+W+2X1SDV2P+kb1qTYrBUAuhEeibNT0NyZL9 d8XbHl8r7Tz2w== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 551A7805EE; Wed, 10 Apr 2024 19:06:40 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34F23120735; Wed, 10 Apr 2024 19:06:40 -0400 (EDT) In-Reply-To: <8760pj27wm.fsf@web.de> (Michael Heerdegen's message of "Sun, 25 Sep 2016 19:42:17 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283069 Archived-At: --=-=-= Content-Type: text/plain > (eq element '@) > > in an elisp mode buffer (e.g. scratch). Put point at the quote or the > "@". Eval > (goto-char (scan-sexps (point) 1)) > and you get an error like: > Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 15 16) The patch below seems to fix it. Any comments/objections? Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=bug24542.diff diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 9b4c3f994cd..10d7f01ebaf 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -40,9 +40,8 @@ 'emacs-lisp-mode-abbrev-table (defvar emacs-lisp-mode-syntax-table (let ((table (make-syntax-table lisp-data-mode-syntax-table))) - ;; These are redundant, now. - ;;(modify-syntax-entry ?\[ "(] " table) - ;;(modify-syntax-entry ?\] ")[ " table) + ;; `syntax-propertize'. takes care of `,@'. + (modify-syntax-entry ?@ "_" table) table) "Syntax table used in `emacs-lisp-mode'.") diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 1d1ef9981e5..3ef5a28e460 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -1131,5 +1131,14 @@ test-indentation (emacs-lisp-mode) (indent-region (point-min) (point-max))))) +(ert-deftest elisp-tests-syntax-propertize () + (with-temp-buffer + (emacs-lisp-mode) + (insert "(a '@)") + (should (equal (scan-sexps (+ (point-min) 3) 1) (1- (point-max)))) + (erase-buffer) + (insert "(a ,@)") + (should-error (scan-sexps (+ (point-min) 3) 1)))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here --=-=-=--