From unknown Sun Jun 22 11:33:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#22063 <22063@debbugs.gnu.org> To: bug#22063 <22063@debbugs.gnu.org> Subject: Status: 25.0.50; js-mode, incorrect indentation of functions with keyword names Reply-To: bug#22063 <22063@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:33:33 +0000 retitle 22063 25.0.50; js-mode, incorrect indentation of functions with key= word names reassign 22063 emacs submitter 22063 Jordon Biondo severity 22063 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 14:49:20 2015 Received: (at submit) by debbugs.gnu.org; 30 Nov 2015 19:49:20 +0000 Received: from localhost ([127.0.0.1]:33237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3URr-0003BZ-VD for submit@debbugs.gnu.org; Mon, 30 Nov 2015 14:49:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3Tgd-00024F-WA for submit@debbugs.gnu.org; Mon, 30 Nov 2015 14:00:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3TgZ-0000ix-DO for submit@debbugs.gnu.org; Mon, 30 Nov 2015 14:00:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TgZ-0000it-Ad for submit@debbugs.gnu.org; Mon, 30 Nov 2015 14:00:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TgY-0001dn-55 for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 14:00:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3TgU-0000hd-4a for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 14:00:26 -0500 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:38709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TgT-0000hX-Ul for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 14:00:22 -0500 Received: by igbxm8 with SMTP id xm8so79609609igb.1 for ; Mon, 30 Nov 2015 11:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=appropos-com.20150623.gappssmtp.com; s=20150623; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=c0cvhghiMxL/+IFakcWCXH3P6oSELFytDBeIxhLNV/0=; b=tM82R8Bvis5iRSLALSoHCTbUpCQgql2fyvdYHgFxm84uj745KzHVaOfSNMmqoep9BV pSGI2cCHYeZQKUAlp0rtC833Z48JSEVvsknJjxzsNcyzjnd2TvttiUH71qPBBEOk+YSf H9hJxjIuMdaHsXK9/4dA+qvsjYRZZCaD31LnmJR0w24flQQoSwcYVt8JbQ05OzkD97Ny +F6fPPx/PyKehskMVwoR061/u2WYUNId5/zHYJxXl9mJMmdrdBgFi02JDXziNw9EkrUx rFtCeJowZ6MH9cGEVmqYyR6Y/Uc0dwLWzikKClsfAPCTONkmAIEUSFROaWhnSDrdnkEW ianw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; bh=c0cvhghiMxL/+IFakcWCXH3P6oSELFytDBeIxhLNV/0=; b=Ghor9jCEALgJC5FHpGxdK4qZEyood+9q+siKZ+f31RL951n9FQfzMPX9Hj4F509p1G npUZ8jk30t//I3A7gRGrF1cM8W8CJdLMX1Re76Q4hfmNG1ISGf0tX4706I2302lvMVFN fmKHdLrC5l70Nqo8CkoerYnGS/vKLBCuw5TdgAhTgoGJpao17Lm7M2rGYIzAny+a9Mj7 UsNL/WtHQqkdfWV0sQJYEl4jayjtOPIHwuapZkci33YVxBuk7xi0suJSTfUCzAMkUUfv o5fJXih+jsPa9b75gx3ua75WhNcyYQtzvRa1lHoUVOY3qLOomngeFK+iIV4cPa2Bl7z3 J2GQ== X-Gm-Message-State: ALoCoQkevybVjqzp3Dh9A5ifk5rtq6g0gigBQJDYNju9aOaDwGjcKAyyroqFKm1rdzahoi7ct+xN X-Received: by 10.50.60.2 with SMTP id d2mr18102575igr.87.1448910020628; Mon, 30 Nov 2015 11:00:20 -0800 (PST) Received: from [10.0.1.14] (50-199-46-234-static.hfc.comcastbusiness.net. [50.199.46.234]) by smtp.gmail.com with ESMTPSA id i69sm18090326iod.27.2015.11.30.11.00.19 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Nov 2015 11:00:19 -0800 (PST) From: Jordon Biondo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 25.0.50; js-mode, incorrect indentation of functions with keyword names Message-Id: Date: Mon, 30 Nov 2015 14:00:17 -0500 To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 30 Nov 2015 14:49:18 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (----) js-mode will incorrectly indent chained function calls when the function shares a name with a keyword. This is particularly problematic when writing js code using the ES6 Promise API which contains a `catch` function. The following example contains the correct, desired indentation: Foobar .find() .then((foo) =3D> { return 1; }) .catch((err) =3D> { return 2; }) .then((num) =3D> { console.log(num); }); The following example shows how Emacs currently indents the above code: Foobar .find() .then((foo) =3D> { return 1; }) .catch((err) =3D> { return 2; }) .then((num) =3D> { console.log(num); }); This is caused by the function being named `catch` which the current indentation support falsely assumes is the catch keyword. If you were to change the code from `.catch` to `.catch2` it would indent correctly. This problem is not limited to only the `catch` keyword. In GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.4.0, NS appkit-1348.17 = Version 10.10.4 (Build 14E46)) of 2015-07-14 on Jordons-MacBook-Pro.local Repository revision: 894a90671b9ebc37fb56abfcef6e422e954d6460 Configured using: `configure --prefix=3D/usr/local/Cellar/emacs/HEAD --enable-locallisppath=3D/usr/local/share/emacs/site-lisp --infodir=3D/usr/local/Cellar/emacs/HEAD/share/info/emacs --without-dbus --without-gnutls --with-ns --disable-ns-self-contained' Configured features: ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Javascript Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-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 line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Quit [2 times] Mark set Making completion list... [3 times] Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils js advice json imenu thingatpt cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs term/xterm xterm byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu seq cl-loaddefs pcase cl-lib cconv time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win term/common-win 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 cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 111616 7362) (symbols 48 21847 0) (miscs 40 83 155) (strings 32 22480 4769) (string-bytes 1 758400) (vectors 16 12850) (vector-slots 8 399482 2718) (floats 8 130 402) (intervals 56 233 0) (buffers 976 14)) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 22:43:05 2015 Received: (at 22063-done) by debbugs.gnu.org; 1 Dec 2015 03:43:05 +0000 Received: from localhost ([127.0.0.1]:33515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3bqL-0007qs-HA for submit@debbugs.gnu.org; Mon, 30 Nov 2015 22:43:05 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33243) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3bq0-0007q0-MN for 22063-done@debbugs.gnu.org; Mon, 30 Nov 2015 22:43:03 -0500 Received: by wmec201 with SMTP id c201so185930921wme.0 for <22063-done@debbugs.gnu.org>; Mon, 30 Nov 2015 19:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ya+C0ctM5dywtMkT9e84eJvaO1vr7q4EDTIxaMOMCkg=; b=OfXrxJcUq+fJ1wyiy9MZ1zAh26EC30qLg4hf+wgvcXC2MFsy2/TvdKzJPClOlBkZn/ bTL+W1Ev9S+lgHTANoTS/0tbr+l1l2F0+JKnNW3qmyfEoEtbSBHFhMuCGdHRO2pr1VWD icp6X0jGbA8uQwBhtlgIBUgc5ZrJteutpk4jjH5iMdHHaskavqq1eRJSYQfUn4I0NAUq JOPS0b7+LQ1c2Qgw3k7HEIjL3sSzQazOSKyNKzmjHn0nXErRBZM62aYZ36tHA+sbg8Nv Ws5cea1TSJ1SGW5truA1K10YlU3U/Hhy0TUQG8/ee9PNcIUJlMStIs/g+3ezxYoj6gxa yatg== X-Received: by 10.194.80.101 with SMTP id q5mr71639564wjx.59.1448941363586; Mon, 30 Nov 2015 19:42:43 -0800 (PST) Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id wh10sm49482247wjb.45.2015.11.30.19.42.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Nov 2015 19:42:42 -0800 (PST) Subject: Re: bug#22063: 25.0.50; js-mode, incorrect indentation of functions with keyword names To: Jordon Biondo , 22063-done@debbugs.gnu.org References: From: Dmitry Gutov Message-ID: <565D1731.6030701@yandex.ru> Date: Tue, 1 Dec 2015 05:42:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22063-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (/) Version: 25.1 On 11/30/2015 09:00 PM, Jordon Biondo wrote: > This is caused by the function being named `catch` which the current > indentation support falsely assumes is the catch keyword. If you were to > change the code from `.catch` to `.catch2` it would indent correctly. > This problem is not limited to only the `catch` keyword. Thanks for the report; should be fixed now in emacs-25 with 48471e9. From unknown Sun Jun 22 11:33:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Dec 2015 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator