From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#41649: 27.0.91; beginning-of-defun doesn't work inside React markup in js-jsx-mode Date: Mon, 1 Jun 2020 10:59:50 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c9670e05a709915d" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="92739"; mail-complaints-to="usenet@ciao.gmane.io" To: 41649@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 20:01:31 2020 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 1jfokb-000NwK-Ni for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 20:01:29 +0200 Original-Received: from localhost ([::1]:39344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfoka-0001Ct-PM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 14:01:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfokA-0001Cf-IU for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfokA-0000Sa-8S for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfokA-0003Nk-4p for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 18:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41649 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.159103443312955 (code B ref -1); Mon, 01 Jun 2020 18:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jun 2020 18:00:33 +0000 Original-Received: from localhost ([127.0.0.1]:36966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfojh-0003Mt-Hs for submit@debbugs.gnu.org; Mon, 01 Jun 2020 14:00:33 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfojf-0003Mk-7Q for submit@debbugs.gnu.org; Mon, 01 Jun 2020 14:00:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfojd-00012a-Iz for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:00:30 -0400 Original-Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:44062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfojc-0008Cz-Fc for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:00:29 -0400 Original-Received: by mail-ed1-x52a.google.com with SMTP id l1so7110502ede.11 for ; Mon, 01 Jun 2020 11:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Zdw/LmM8aQddWe9vkQ5+Be5eijWaM0uSEfNko1dUneA=; b=eQx4741SaeqOhD963ZSHvwbVF32KY5pG7k5ulESPnaoZlnyI616/WmNpe+Xwm87+zG oWsyuZMQbCZImB6mONNQ85nMW/+J2c6NbCrQiPzY2PrujxrLFuu6eiDiizmtbBwKh2n2 H6oD1qRv0lrAWxvuCuYTcikyWZTlEBIrzekNDUMl5K4j58tduN89gkW/UNNFVbm8DyYb P0KtRPxlHDnnhjNDTIJXLnk1QD5efsS8Scy5eZoqL/usaxWPEVq8Bcor/E3PJ2aHE9Q3 Im9W9FIt6EkJZV6ywlrx0YICFhYBe+bWrIU0Ve0VRE+pjN69e9ldsVpjz2UnoaEaa+M3 hjaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Zdw/LmM8aQddWe9vkQ5+Be5eijWaM0uSEfNko1dUneA=; b=RpPjLXMCRfpDTAvcaqPJTYqovCZfWWo4wSPCNsZvFSj8Op0TabBBTgTWYwH63vEVZy 9f65t0WfH9q+cueT/kbgA9Ut6uZb5+fMoaRsP6PePhWFdSD0wz0tojYYP6Ix0DQW2Cmh YHdJ9pWMGiNBEty6G4TMS8dPHZQsKdZv3msvqVrmS1Ts37bn38bKc8porvXryfKKaKtk 6Z/W7o3JhuXFil8RflIr4efcNq+V/mL/C41dQl+A6d1mJPgB8WuoG3ek6xs0TNBUPO32 l9eNKvzHA4KzWTVN5NfPDwfMcOtJ0P2gKIB+ot3VH/cvE5YBLrCCtM4KgCiL6GoXYzuQ WAIQ== X-Gm-Message-State: AOAM531KbNFjCq/kFXPvWGLgxrtLLnPEtwVj95GU/jgf0ZKULwylmdGF ECXh3st+eHXJyEib/7U6CD5ebgXiDMXrB0+zhtf9UK2z X-Google-Smtp-Source: ABdhPJygEUB5EQNlH1AutK2d/CBZa7Uvfs6vKmcOoVRvDnIJwnKCLV63xElBtuA8yS6TjCau1NXb39IikjIzaowEGno= X-Received: by 2002:a50:d556:: with SMTP id f22mr23585034edj.307.1591034425991; Mon, 01 Jun 2020 11:00:25 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=bkleung89@gmail.com; helo=mail-ed1-x52a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:181359 Archived-At: --000000000000c9670e05a709915d Content-Type: text/plain; charset="UTF-8" With a file App.js that looks like: import * as React from "react"; import { render } from "react-dom"; const App = () => { return (

hello

); }; render(, document.getElementById("root")); If you open the file in JS mode (Emacs 27), and move point inside of "abc", calling M-: (c-beginning-of-defun) gives the following error: Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil) copy-hash-table(nil) c-forward-<>-arglist(nil) c-backward-<>-arglist(nil nil) c-looking-at-decl-block(99 nil) c-most-enclosing-decl-block((117 99 88 (40 . 50))) c-widen-to-enclosing-decl-scope((117 99 88 (40 . 50)) 1 234) c-beginning-of-defun() eval((c-beginning-of-defun) t) eval-expression((c-beginning-of-defun) nil nil 127) funcall-interactively(eval-expression (c-beginning-of-defun) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression) Manually invoking C-M-a inside the double quotes should end the same way. In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: NixOS 20.09 (Nightingale) --000000000000c9670e05a709915d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


With a file App.js that looks like:

import = * as React from "react";
import { render } from "react-do= m";

const App =3D () =3D> {
=C2=A0 return (
=C2=A0 =C2= =A0 <div>
=C2=A0 =C2=A0 =C2=A0 <h1 id=3D"abc">hell= o</h1>
=C2=A0 =C2=A0 =C2=A0 <SearchParams />
=C2=A0 =C2= =A0 </div>
=C2=A0 );
};

render(<App />, document.g= etElementById("root"));


If you open the file in JS mod= e (Emacs 27), and move point inside of
"abc", calling

M= -: (c-beginning-of-defun)

gives the following error:

Debugger= entered--Lisp error: (wrong-type-argument hash-table-p nil)
=C2=A0 copy= -hash-table(nil)
=C2=A0 c-forward-<>-arglist(nil)
=C2=A0 c-back= ward-<>-arglist(nil nil)
=C2=A0 c-looking-at-decl-block(99 nil)=C2=A0 c-most-enclosing-decl-block((117 99 88 (40 . 50)))
=C2=A0 c-wide= n-to-enclosing-decl-scope((117 99 88 (40 . 50)) 1 234)
=C2=A0 c-beginnin= g-of-defun()
=C2=A0 eval((c-beginning-of-defun) t)
=C2=A0 eval-expres= sion((c-beginning-of-defun) nil nil 127)
=C2=A0 funcall-interactively(ev= al-expression (c-beginning-of-defun) nil nil 127)
=C2=A0 call-interactiv= ely(eval-expression nil nil)
=C2=A0 command-execute(eval-expression)
=
Manually invoking C-M-a inside the double quotes should end the same wa= y.

In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version = 3.24.20)
Windowing system distributor 'The X.Org Foundation', ve= rsion 11.0.12008000
System Description: NixOS 20.09 (Nightingale)
--000000000000c9670e05a709915d--