From unknown Sun Jun 22 07:57:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25465: 25.1.90; js-mode fix for regexp literal Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2017 04:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25465 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25465@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148462776930787 (code B ref -1); Tue, 17 Jan 2017 04:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2017 04:36:09 +0000 Received: from localhost ([127.0.0.1]:56057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTLVA-00080U-FJ for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTLV9-00080H-60 for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTLV2-0003re-7g for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTLV2-0003ra-4O for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTLUz-0000TW-TK for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTLUu-0003py-Sl for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:57 -0500 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:56539 helo=gproxy9.mail.unifiedlayer.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTLUu-0003pR-J4 for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:52 -0500 Received: from cmgw4 (unknown [10.0.90.85]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id A19311E0F2C for ; Mon, 16 Jan 2017 21:35:48 -0700 (MST) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id ZGbg1u0072f2jeq01Gbj2n; Mon, 16 Jan 2017 21:35:48 -0700 X-Authority-Analysis: v=2.1 cv=JsBi8qIC c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IgFoBzBjUZAA:10 a=zvSaYZTwSjLxR77CtgoA:9 a=zstS-IiYAAAA:8 a=pQs5aej7AAAA:8 a=GEaGH3MpMfJkKrC8d00A:9 a=VDEtfpoToLGKPWCa6wMA:9 a=27NBZwmv9I7gSGQp:21 a=Mt2tb7Quo4N1DPfg:21 a=4G6NA9xxw8l3yy4pmD5M:22 a=Aan7rn3zuj8km_mHUhxA:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AgeA1XuLp55He+/Xf5DvY+lLLoHvxQrNlQenT3LrWCE=; b=Xtb+i7x+VAbvxGkAktXLHaDpBt 1uRuiOa9s9606uvqLnbfuez931Cv9wQGzpnyrRbS/CDC+HXSZuNZu7R9NRsWDSgMEia4Uq52QHRLv mtT7UCo/TYQbJ3rgTu5icvxyw; Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:60226 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cTLUi-0003v2-51; Mon, 16 Jan 2017 21:35:40 -0700 From: Tom Tromey X-Attribution: Tom Date: Mon, 16 Jan 2017 21:35:38 -0700 Message-ID: <87lgua1exx.fsf@tromey.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1cTLUi-0003v2-51 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:60226 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) 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: -4.5 (----) --=-=-= Content-Type: text/plain This patch fixes one case where js-mode did not correctly recognize a regexp literal. This caused an indentation error in the Firefox developer tools code. Let me know what you think. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=P commit f76d42b87e8531d21072a51ac86c91ffae5ee36f Author: Tom Tromey Date: Mon Jan 16 14:02:45 2017 -0700 Fix JS regexp literal syntax propertization in expressions * lisp/progmodes/js.el (js-syntax-propertize): Recognize a regexp literal after "!", "&", and "|". test/lisp/progmodes/js-tests.el (js-mode-regexp-syntax): New test. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 54df391..2e5c6ae 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1720,10 +1720,10 @@ js-syntax-propertize ;; Distinguish /-division from /-regexp chars (and from /-comment-starter). ;; FIXME: Allow regexps after infix ops like + ... ;; https://developer.mozilla.org/en/JavaScript/Reference/Operators - ;; We can probably just add +, -, !, <, >, %, ^, ~, |, &, ?, : at which + ;; We can probably just add +, -, <, >, %, ^, ~, ?, : at which ;; point I think only * and / would be missing which could also be added, ;; but need care to avoid affecting the // and */ comment markers. - ("\\(?:^\\|[=([{,:;]\\|\\_\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" + ("\\(?:^\\|[=([{,:;|&!]\\|\\_\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" (1 (ignore (forward-char -1) (when (or (not (memq (char-after (match-beginning 0)) '(?\s ?\t))) diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 9bf7258..84749ef 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -59,6 +59,32 @@ * Load the inspector's shared head.js for use by tests that need to * open the something or other")))) +(ert-deftest js-mode-regexp-syntax () + (with-temp-buffer + ;; Normally indentation tests are done in manual/indent, but in + ;; this case we are specifically testing a case where the bug + ;; caused the indenter not to do anything, and manual/indent can + ;; only be used for already-correct files. + (insert "function f(start, value) { +if (start - 1 === 0 || /[ (:,='\"]/.test(value)) { +--start; +} +if (start - 1 === 0 && /[ (:,='\"]/.test(value)) { +--start; +} +if (!/[ (:,='\"]/.test(value)) { +--start; +} +} +") + (js-mode) + (indent-region (point-min) (point-max)) + (goto-char (point-min)) + (dolist (x '(0 4 8 4 4 8 4 4 8 4 0)) + (back-to-indentation) + (should (= (current-column) x)) + (forward-line)))) + (provide 'js-tests) ;;; js-tests.el ends here --=-=-= Content-Type: text/plain In GNU Emacs 25.1.90.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-12-20 built on bapiya Repository revision: 88cdf14b37a7344bb266e94512485e3cc738c23d Windowing system distributor 'Fedora Project', version 11.0.11900000 System Description: Fedora release 25 (Twenty Five) Configured using: 'configure --prefix=/home/tromey/Emacs/install/ --with-modules' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Article Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t which-function-mode: t erc-services-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-netsplit-mode: t erc-hl-nicks-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t savehist-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Mark set [7 times] Auto-saving...done Mark set Saving file /home/tromey/Emacs/trunk/test/lisp/progmodes/js-tests.el... Wrote /home/tromey/Emacs/trunk/test/lisp/progmodes/js-tests.el When done with a buffer, type C-x # Saving file /home/tromey/.newsrc-dribble... Wrote /home/tromey/.newsrc-dribble [2 times] (Saved .newsrc-dribble) Quit Load-path shadows: /home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/25.1.90/lisp/play/bubbles Features: (tcl url-http url-gw url-auth eww url-queue shadow emacsbug erc-notify gud ido cursor-sensor js2-mode etags shell goto-addr find-file bug-reference tabify man bbdb-sc supercite regi nnir xref project gnus-fun debug conf-mode shr-color apropos bbdb-message vc-mtn vc-hg mailalias mail-hist find-dired idutils derived shr dom gnus-html browse-url xml url-cache mm-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars texinfo eieio-opt speedbar sb-image ezimage dframe qp dired-aux term/xterm xterm log-view log-edit pcvs-util smerge-mode make-mode copyright dabbrev js sgml-mode json map cc-mode cc-fonts cc-guess cc-menus cc-cmds css-mode smie misearch multi-isearch add-log org-bullets org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view subr-x jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func whitespace vc-git diff-mode easy-mmode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs sort smiley gnus-cite flow-fill mm-archive gnus-bcklg gnus-async mail-extr gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-mua bbdb-com crm network-stream nsm starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache gnus-registry registry eieio-compat eieio-base gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo smtpmail sendmail gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message idna dired rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader mail-utils flyspell ispell diminish edmacro kmacro projectile grep compile ibuf-ext ibuffer dash appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs which-func imenu minimap autorevert filenotify cus-start cus-load status erc-services erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete pcomplete erc-track erc-match erc-netsplit erc-hl-nicks color erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend erc-compat format-spec auth-source eieio gnus-util mm-util help-fns mail-prsvr password-cache thingatpt pp warnings advice vc-dir ewoc vc vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs bbdb bbdb-site timezone ange-ftp comint ansi-color ring server savehist finder-inf dwarf-mode-autoloads gdb-shell-autoloads eieio-core lisppaste-autoloads pydoc-info-autoloads info-look cl-seq cl-macs cl weblogger-autoloads info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib bbdb-loaddefs time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1657056 442374) (symbols 48 129097 40) (miscs 40 30003 5701) (strings 32 466158 177867) (string-bytes 1 11826531) (vectors 16 104828) (vector-slots 8 2395381 129340) (floats 8 1067 1552) (intervals 56 123534 6010) (buffers 976 219) (heap 1024 291747 52322)) Tom --=-=-=-- From unknown Sun Jun 22 07:57:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25465: done References: <87lgua1exx.fsf@tromey.com> In-Reply-To: <87lgua1exx.fsf@tromey.com> Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2017 22:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25465 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25465@debbugs.gnu.org Received: via spool by 25465-submit@debbugs.gnu.org id=B25465.148469271014459 (code B ref 25465); Tue, 17 Jan 2017 22:39:01 +0000 Received: (at 25465) by debbugs.gnu.org; 17 Jan 2017 22:38:30 +0000 Received: from localhost ([127.0.0.1]:34147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTcOc-0003l9-4Y for submit@debbugs.gnu.org; Tue, 17 Jan 2017 17:38:30 -0500 Received: from gproxy4-pub.mail.unifiedlayer.com ([69.89.23.142]:60963) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTcOa-0003kw-I1 for 25465@debbugs.gnu.org; Tue, 17 Jan 2017 17:38:29 -0500 Received: (qmail 26421 invoked by uid 0); 17 Jan 2017 22:38:18 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy4.mail.unifiedlayer.com with SMTP; 17 Jan 2017 22:38:18 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id ZaeC1u01L2f2jeq01aeFDm; Tue, 17 Jan 2017 15:38:17 -0700 X-Authority-Analysis: v=2.1 cv=J7g5smXS c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IgFoBzBjUZAA:10 a=1hdqK-4IYftUmVsOWL0A:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XSNaofVCdyp2MQ0OfMfUewwk/yfb/KKqs8YzWNYB+uo=; b=HDq2DY2tlEqlB4DXKXLrnEMMJX qclFGbC4h+qxjlKjfJheVBpiJADQxBWTS7Gqw+A7t1GSZP7vOiw5ie32lzDyq7GRpj4646meLGJl2 lAEgWJBXAOFsQJqK510G/KRMa; Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:35104 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cTcOM-0008V8-Cc; Tue, 17 Jan 2017 15:38:14 -0700 From: Tom Tromey X-Attribution: Tom Date: Tue, 17 Jan 2017 15:38:11 -0700 Message-ID: <87tw8xia7g.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1cTcOM-0008V8-Cc X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:35104 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Spam-Score: -0.6 (/) 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.6 (/) Patch checked in. Tom From unknown Sun Jun 22 07:57:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tom Tromey Subject: bug#25465: closed (done) Message-ID: References: <878tq9htms.fsf@tromey.com> <87lgua1exx.fsf@tromey.com> X-Gnu-PR-Message: they-closed 25465 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 25465@debbugs.gnu.org Date: Wed, 18 Jan 2017 04:37:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1484714223-14681-1" This is a multi-part message in MIME format... ------------=_1484714223-14681-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25465: 25.1.90; js-mode fix for regexp literal which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25465@debbugs.gnu.org. --=20 25465: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25465 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1484714223-14681-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25465-done) by debbugs.gnu.org; 18 Jan 2017 04:36:31 +0000 Received: from localhost ([127.0.0.1]:34233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cThz5-0003nZ-8a for submit@debbugs.gnu.org; Tue, 17 Jan 2017 23:36:31 -0500 Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:47298) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cThz2-0003nI-Up for 25465-done@debbugs.gnu.org; Tue, 17 Jan 2017 23:36:29 -0500 Received: (qmail 16622 invoked by uid 0); 18 Jan 2017 04:36:15 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy7.mail.unifiedlayer.com with SMTP; 18 Jan 2017 04:36:15 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id ZgcA1u00X2f2jeq01gcDBk; Tue, 17 Jan 2017 21:36:13 -0700 X-Authority-Analysis: v=2.1 cv=J7g5smXS c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IgFoBzBjUZAA:10 a=2pmKH9aTdWYjYMD2bLIA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xqowQKzgYR2ad4FD09YIZms6bo+TKtVlBQyStDZr5JM=; b=FyCUoY5Qw+QE6EgNYg+cJLGNx+ olTwq5YIVxSsh+EZOBMM+xGQXqgRKpcAsI77KN38g2H2x3ne62Wj00Lu0ey+4HrI3dbb5st5OoC/s jJryvzYb03C4ruzcEd7LA1bXL; Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:35902 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cThym-0000t5-79; Tue, 17 Jan 2017 21:36:12 -0700 From: Tom Tromey To: 25465-done@debbugs.gnu.org Subject: done X-Attribution: Tom Date: Tue, 17 Jan 2017 21:36:11 -0700 Message-ID: <878tq9htms.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1cThym-0000t5-79 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:35902 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 25465-done 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.6 (/) I thought I'd closed this earlier but I guess not. Tom ------------=_1484714223-14681-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Jan 2017 04:36:09 +0000 Received: from localhost ([127.0.0.1]:56057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTLVA-00080U-FJ for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTLV9-00080H-60 for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTLV2-0003re-7g for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTLV2-0003ra-4O for submit@debbugs.gnu.org; Mon, 16 Jan 2017 23:36:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTLUz-0000TW-TK for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTLUu-0003py-Sl for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:57 -0500 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:56539 helo=gproxy9.mail.unifiedlayer.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTLUu-0003pR-J4 for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2017 23:35:52 -0500 Received: from cmgw4 (unknown [10.0.90.85]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id A19311E0F2C for ; Mon, 16 Jan 2017 21:35:48 -0700 (MST) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id ZGbg1u0072f2jeq01Gbj2n; Mon, 16 Jan 2017 21:35:48 -0700 X-Authority-Analysis: v=2.1 cv=JsBi8qIC c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IgFoBzBjUZAA:10 a=zvSaYZTwSjLxR77CtgoA:9 a=zstS-IiYAAAA:8 a=pQs5aej7AAAA:8 a=GEaGH3MpMfJkKrC8d00A:9 a=VDEtfpoToLGKPWCa6wMA:9 a=27NBZwmv9I7gSGQp:21 a=Mt2tb7Quo4N1DPfg:21 a=4G6NA9xxw8l3yy4pmD5M:22 a=Aan7rn3zuj8km_mHUhxA:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AgeA1XuLp55He+/Xf5DvY+lLLoHvxQrNlQenT3LrWCE=; b=Xtb+i7x+VAbvxGkAktXLHaDpBt 1uRuiOa9s9606uvqLnbfuez931Cv9wQGzpnyrRbS/CDC+HXSZuNZu7R9NRsWDSgMEia4Uq52QHRLv mtT7UCo/TYQbJ3rgTu5icvxyw; Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:60226 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cTLUi-0003v2-51; Mon, 16 Jan 2017 21:35:40 -0700 From: Tom Tromey To: bug-gnu-emacs@gnu.org Subject: 25.1.90; js-mode fix for regexp literal X-Attribution: Tom Date: Mon, 16 Jan 2017 21:35:38 -0700 Message-ID: <87lgua1exx.fsf@tromey.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1cTLUi-0003v2-51 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:60226 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: submit 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: -4.5 (----) --=-=-= Content-Type: text/plain This patch fixes one case where js-mode did not correctly recognize a regexp literal. This caused an indentation error in the Firefox developer tools code. Let me know what you think. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=P commit f76d42b87e8531d21072a51ac86c91ffae5ee36f Author: Tom Tromey Date: Mon Jan 16 14:02:45 2017 -0700 Fix JS regexp literal syntax propertization in expressions * lisp/progmodes/js.el (js-syntax-propertize): Recognize a regexp literal after "!", "&", and "|". test/lisp/progmodes/js-tests.el (js-mode-regexp-syntax): New test. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 54df391..2e5c6ae 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1720,10 +1720,10 @@ js-syntax-propertize ;; Distinguish /-division from /-regexp chars (and from /-comment-starter). ;; FIXME: Allow regexps after infix ops like + ... ;; https://developer.mozilla.org/en/JavaScript/Reference/Operators - ;; We can probably just add +, -, !, <, >, %, ^, ~, |, &, ?, : at which + ;; We can probably just add +, -, <, >, %, ^, ~, ?, : at which ;; point I think only * and / would be missing which could also be added, ;; but need care to avoid affecting the // and */ comment markers. - ("\\(?:^\\|[=([{,:;]\\|\\_\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" + ("\\(?:^\\|[=([{,:;|&!]\\|\\_\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" (1 (ignore (forward-char -1) (when (or (not (memq (char-after (match-beginning 0)) '(?\s ?\t))) diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 9bf7258..84749ef 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -59,6 +59,32 @@ * Load the inspector's shared head.js for use by tests that need to * open the something or other")))) +(ert-deftest js-mode-regexp-syntax () + (with-temp-buffer + ;; Normally indentation tests are done in manual/indent, but in + ;; this case we are specifically testing a case where the bug + ;; caused the indenter not to do anything, and manual/indent can + ;; only be used for already-correct files. + (insert "function f(start, value) { +if (start - 1 === 0 || /[ (:,='\"]/.test(value)) { +--start; +} +if (start - 1 === 0 && /[ (:,='\"]/.test(value)) { +--start; +} +if (!/[ (:,='\"]/.test(value)) { +--start; +} +} +") + (js-mode) + (indent-region (point-min) (point-max)) + (goto-char (point-min)) + (dolist (x '(0 4 8 4 4 8 4 4 8 4 0)) + (back-to-indentation) + (should (= (current-column) x)) + (forward-line)))) + (provide 'js-tests) ;;; js-tests.el ends here --=-=-= Content-Type: text/plain In GNU Emacs 25.1.90.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-12-20 built on bapiya Repository revision: 88cdf14b37a7344bb266e94512485e3cc738c23d Windowing system distributor 'Fedora Project', version 11.0.11900000 System Description: Fedora release 25 (Twenty Five) Configured using: 'configure --prefix=/home/tromey/Emacs/install/ --with-modules' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Article Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t which-function-mode: t erc-services-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-netsplit-mode: t erc-hl-nicks-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t savehist-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Mark set [7 times] Auto-saving...done Mark set Saving file /home/tromey/Emacs/trunk/test/lisp/progmodes/js-tests.el... Wrote /home/tromey/Emacs/trunk/test/lisp/progmodes/js-tests.el When done with a buffer, type C-x # Saving file /home/tromey/.newsrc-dribble... Wrote /home/tromey/.newsrc-dribble [2 times] (Saved .newsrc-dribble) Quit Load-path shadows: /home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/25.1.90/lisp/play/bubbles Features: (tcl url-http url-gw url-auth eww url-queue shadow emacsbug erc-notify gud ido cursor-sensor js2-mode etags shell goto-addr find-file bug-reference tabify man bbdb-sc supercite regi nnir xref project gnus-fun debug conf-mode shr-color apropos bbdb-message vc-mtn vc-hg mailalias mail-hist find-dired idutils derived shr dom gnus-html browse-url xml url-cache mm-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars texinfo eieio-opt speedbar sb-image ezimage dframe qp dired-aux term/xterm xterm log-view log-edit pcvs-util smerge-mode make-mode copyright dabbrev js sgml-mode json map cc-mode cc-fonts cc-guess cc-menus cc-cmds css-mode smie misearch multi-isearch add-log org-bullets org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view subr-x jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func whitespace vc-git diff-mode easy-mmode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs sort smiley gnus-cite flow-fill mm-archive gnus-bcklg gnus-async mail-extr gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-mua bbdb-com crm network-stream nsm starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache gnus-registry registry eieio-compat eieio-base gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo smtpmail sendmail gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message idna dired rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader mail-utils flyspell ispell diminish edmacro kmacro projectile grep compile ibuf-ext ibuffer dash appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs which-func imenu minimap autorevert filenotify cus-start cus-load status erc-services erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete pcomplete erc-track erc-match erc-netsplit erc-hl-nicks color erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend erc-compat format-spec auth-source eieio gnus-util mm-util help-fns mail-prsvr password-cache thingatpt pp warnings advice vc-dir ewoc vc vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs bbdb bbdb-site timezone ange-ftp comint ansi-color ring server savehist finder-inf dwarf-mode-autoloads gdb-shell-autoloads eieio-core lisppaste-autoloads pydoc-info-autoloads info-look cl-seq cl-macs cl weblogger-autoloads info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib bbdb-loaddefs time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1657056 442374) (symbols 48 129097 40) (miscs 40 30003 5701) (strings 32 466158 177867) (string-bytes 1 11826531) (vectors 16 104828) (vector-slots 8 2395381 129340) (floats 8 1067 1552) (intervals 56 123534 6010) (buffers 976 219) (heap 1024 291747 52322)) Tom --=-=-=-- ------------=_1484714223-14681-1--