From unknown Sat Jun 21 03:22:51 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#53817 <53817@debbugs.gnu.org> To: bug#53817 <53817@debbugs.gnu.org> Subject: Status: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line Reply-To: bug#53817 <53817@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:22:51 +0000 retitle 53817 28.0.91; sh-mode indent misses on 'if test;then' when 'then' = is on 'if' line reassign 53817 emacs submitter 53817 Doug Maxey severity 53817 minor tag 53817 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 03:25:09 2022 Received: (at submit) by debbugs.gnu.org; 6 Feb 2022 08:25:09 +0000 Received: from localhost ([127.0.0.1]:36338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGcr5-00016P-GZ for submit@debbugs.gnu.org; Sun, 06 Feb 2022 03:25:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:42332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGZRt-0001Lu-5J for submit@debbugs.gnu.org; Sat, 05 Feb 2022 23:46:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGZRs-0006QP-MQ for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 23:46:52 -0500 Received: from [2600:1700:b900:9fe0::1:a1] (port=12525 helo=mail.maxeygroup.tech) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGZRm-000180-Ql for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 23:46:50 -0500 Received: from lyle (lyle.internal.maxeygroup.tech [IPv6:fd72:6977:7ac0:ffee:0:0:1:2e]) (authenticated bits=0) by mail.maxeygroup.tech (8.17.1/8.17.1) with ESMTPSA id 2164b0Z6032290 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Sat, 5 Feb 2022 22:37:14 -0600 From: Doug Maxey To: bug-gnu-emacs@gnu.org Subject: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line Date: Sat, 05 Feb 2022 22:37:00 -0600 Message-ID: <87czk0zk43.fsf@maxeygroup.tech> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2600:1700:b900:9fe0::1:a1 (failed) Received-SPF: pass client-ip=2600:1700:b900:9fe0::1:a1; envelope-from=emacs-bugs@maxeygroup.tech; helo=mail.maxeygroup.tech X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 06 Feb 2022 03:25:06 -0500 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: -2.4 (--) Howdy, Just took 28.0.91 out for a spin, and I like that it seems much more responsive. However, lots'o bash gets written here, and one of my idioms is: if test;then do something fi ^ In emacs-28, when I type the 'fi', the start column is still indented, point is placed in column 4. If 'then' gets moved to the line *after* 'if test', OR if a space is inserted between the ';' and 'then', '; then' if test; then it's all good again and point is set correctly at column 1. if test then : fi ^ OR if test; then : fi ^ CONFIGURATION NOTES: The settings for sh-mode all appear to be at the defaults, and a check of my init code only shows (setq sh-shell-path "/bin/bash" sh-find-file-modifies nil) On further observation, it seems the smie engine thinks the code which is legal bash has a syntax error, which would be the missing whitespace after the ';'. I can see this by the block start not being highlighted when at the end of the block (the final 'fi' in the if-else-fi) when the space is missing after the ';', which "heals" when the space is inserted. Thanks for looking into this. ++doug NO CRASH In GNU Emacs 28.0.91 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4) of 2022-02-05 built on bdbe8fdf7a5d41b7ba009c5aa8e267d7 Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 35 (Workstation Edition) Configured using: 'configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB Important settings: value of $EMACSLOADPATH: $HOME/.config/emacs/lisp:$HOME/sb/bats-mode:$HOME/lfin/lisp:/usr/local/lisp/packages: value of $LANG: C value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Shell-script Minor modes in effect: magit-auto-revert-mode: t flyspell-mode: t yas-minor-mode: t global-git-commit-mode: t shell-dirtrack-mode: t dwm-time-keys: t which-function-mode: t savehist-mode: t save-place-mode: t global-whitespace-mode: t global-auto-revert-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-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 blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: /usr/local/lisp/packages/xcscope-1.5/xcscope hides /usr/share/emacs/site-lisp/xcscope /usr/local/lisp/packages/yaml-mode-0.0.15/yaml-mode hides /usr/share/emacs/site-lisp/yaml-mode/yaml-mode /usr/local/lisp/packages/transient-0.3.7/transient hides /usr/share/emacs/28.0.91/lisp/transient $HOME/.config/emacs/lisp/sieve-mode hides /usr/share/emacs/28.0.91/lisp/net/sieve-mode Features: (shadow sort mail-extr emacsbug sendmail cus-edit cus-start wid-edit help-fns radix-tree pcase jka-compr files-x tabify vc-cvs vc-rcs vc bug-reference magit-submodule magit-obsolete magit-popup magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff magit-core magit-autorevert magit-margin magit-transient magit-process misearch multi-isearch vc-git diff-mode vc-dispatcher sh-script smie executable flyspell ispell yasnippet-snippets yasnippet yaml-mode git-commit with-editor shell pcomplete server log-edit message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-mode transient cl-extra help-mode format-spec magit-git magit-section magit-utils crm dash vlc-minor-mode dwm-time-keys edmacro kmacro cperl-mode facemenu perl-stuff mouse-copy mkwdlist generic local-generic generic-x ffap thingatpt dwm gud easy-mmode derived cc-mode cc-fonts cc-guess cc-menus cc-styles cc-align cc-cmds cc-engine cc-vars cc-defs dwm-c-mode vscode-dark-plus-theme which-func imenu savehist saveplace grep whitespace autorevert filenotify desktop frameset cus-load clang-rename clang-include-fixer let-alist clang-format xml rx warnings compile text-property-search comint ansi-color ring pp info finder-inf package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer 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 composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 499443 47296) (symbols 48 27392 1) (strings 32 149217 10619) (string-bytes 1 4315046) (vectors 16 57071) (vector-slots 8 1142242 88614) (floats 8 116 295) (intervals 56 8513 232) (buffers 992 31)) -- take care, ++doug -- *Doug Maxey From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 18:51:09 2022 Received: (at 53817) by debbugs.gnu.org; 6 Feb 2022 23:51:09 +0000 Received: from localhost ([127.0.0.1]:40261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrJF-00086Q-IL for submit@debbugs.gnu.org; Sun, 06 Feb 2022 18:51:09 -0500 Received: from quimby.gnus.org ([95.216.78.240]:33304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrJA-00085s-MY for 53817@debbugs.gnu.org; Sun, 06 Feb 2022 18:51:08 -0500 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=Mqn4AovCvZsv06vWgZv4d1WR4ztSX7eKidNZzVOXqMc=; b=hDhVFxY81Q3y6DxYWiiRGyn59D hqWbfMhOIwLAuURSi1vtV3oBMlh4FL1SjTtxohvmbobIQqWIlPEaDhCiOCAusntJ7wIBzbZwoPcM6 Ij9YEXkbJpepzeykxc7abCwX/zSG8aNmC9ISbtBIylB37MZJdpRrzg2V+qRghN761nCE=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGrIy-0001EP-WD; Mon, 07 Feb 2022 00:50:56 +0100 From: Lars Ingebrigtsen To: Doug Maxey Subject: Re: bug#53817: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line References: <87czk0zk43.fsf@maxeygroup.tech> X-Now-Playing: The Rolling Stones's _Black and Blue_: "Cherry oh Baby" Date: Mon, 07 Feb 2022 00:50:49 +0100 In-Reply-To: <87czk0zk43.fsf@maxeygroup.tech> (Doug Maxey's message of "Sat, 05 Feb 2022 22:37:00 -0600") Message-ID: <87y22n367a.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Doug Maxey writes: > However, lots'o bash gets written here, and one of my idioms is: > > if test; then > do something > fi > ^ > The problem seems to be here: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53817 Cc: Stefan Monnier , 53817@debbugs.gnu.org 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: -3.3 (---) Doug Maxey writes: > However, lots'o bash gets written here, and one of my idioms is: > > if test;then > do something > fi > ^ > The problem seems to be here: (defun sh-smie--default-backward-token () [...] (progn (skip-syntax-backward ".w_'") (or (not (zerop (skip-syntax-backward "\\"))) (when (eq ?\\ (char-before (1- (point)))) Semi-colons have punctuation syntax, so we're skipping back over the entirety of "test;then" instead of stopping after "then". This looks easy enough to fix, but the overall logic of that function is somewhat obscure to me, so I've added Stefan to the comments; perhaps he has some comments. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 18:51:12 2022 Received: (at control) by debbugs.gnu.org; 6 Feb 2022 23:51:12 +0000 Received: from localhost ([127.0.0.1]:40264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrJH-00086f-Ph for submit@debbugs.gnu.org; Sun, 06 Feb 2022 18:51:12 -0500 Received: from quimby.gnus.org ([95.216.78.240]:33320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrJG-00086G-GF for control@debbugs.gnu.org; Sun, 06 Feb 2022 18:51:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type: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=lK3RjHyZbeHPhdy6FxEmSbx6Ex35CmenXYJWHeqIQ70=; b=TB2IivE9jLrI4hi2NxYjyb5U5P jkRxp1TMw6pSB8Y4Vww5g5K6R+Z/IBy0bf3qrqBWeUQviiZGozkIkzTAqh82/+3PE+a2ZVPUN8fZD cfliRVCmWA9UZj8mVr+T03siyoJ67Y14d5iSEpZPcUgf0YiUE+XnPhaRRCGOlnDx0RZw=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGrJ8-0001EU-7u for control@debbugs.gnu.org; Mon, 07 Feb 2022 00:51:04 +0100 Date: Mon, 07 Feb 2022 00:50:58 +0100 Message-Id: <87wni73671.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #53817 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 53817 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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: -3.3 (---) tags 53817 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 19:11:49 2022 Received: (at 53817) by debbugs.gnu.org; 7 Feb 2022 00:11:49 +0000 Received: from localhost ([127.0.0.1]:40305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrdE-0002So-PO for submit@debbugs.gnu.org; Sun, 06 Feb 2022 19:11:49 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrcy-0002SK-Ik for 53817@debbugs.gnu.org; Sun, 06 Feb 2022 19:11:47 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 81858100189; Sun, 6 Feb 2022 19:11:26 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0F90110000D; Sun, 6 Feb 2022 19:11:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1644192685; bh=ok9TCPBZVuBDf2Sr9/AgUVUE+cRntmsLtlInFIek76k=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TWYBKJ2cTM36JgDCBs7WPPOOxc5GhcYvKNFriol+z4h4uaoA4ORNlKARgbDz4q/Nc wwUX5oF22xEvS8giALuKXw7yhj2nqIkbasz7T3rKPXsp+Mo2iVu0AAQ2cE1KKjXr9E LZ0QighfEqQbBLr5eBJgaLswSSycpiVK/3D0Stdd8UKOx1oonHvVEl7pv4tifjh+R9 XnzQ7y4pxoe3AHccywp/cf868M79tQR/AkrqSqREp0/YaxlmY04XiD9E/bb3Hj6x6z KRreS+7+LBD51vOIOBVyN2OuQr66cYUTBMpK+IQj9Iuuimi1OajYJv/7gRWBgylIu2 DLTBuh4rR/mfw== Received: from ceviche (76-10-138-212.dsl.teksavvy.com [76.10.138.212]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AB19A120315; Sun, 6 Feb 2022 19:11:24 -0500 (EST) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#53817: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line Message-ID: References: <87czk0zk43.fsf@maxeygroup.tech> <87y22n367a.fsf@gnus.org> Date: Sun, 06 Feb 2022 19:11:23 -0500 In-Reply-To: <87y22n367a.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 07 Feb 2022 00:50:49 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53817 Cc: Doug Maxey , 53817@debbugs.gnu.org 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: -3.3 (---) > (defun sh-smie--default-backward-token () > [...] > (progn (skip-syntax-backward ".w_'") > (or (not (zerop (skip-syntax-backward "\\"))) > (when (eq ?\\ (char-before (1- (point)))) > > Semi-colons have punctuation syntax, so we're skipping back over the > entirety of "test;then" instead of stopping after "then". We should indeed only skip over "then", and then only over ";" and then only over "test". > This looks easy enough to fix, but the overall logic of that function is > somewhat obscure to me, so I've added Stefan to the comments; perhaps he > has some comments. The sh syntax is fairly nasty to parse, especially backwards, so I can't give you any general comment here. I'd try something and then see if it breaks any tests (including looking at test/manual/indent/shell.sh). For sure, I'd recommend adding a regression test. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 20:02:43 2022 Received: (at 53817) by debbugs.gnu.org; 7 Feb 2022 01:02:43 +0000 Received: from localhost ([127.0.0.1]:40405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGsQU-0004OT-I7 for submit@debbugs.gnu.org; Sun, 06 Feb 2022 20:02:43 -0500 Received: from mail.maxeygroup.tech ([70.231.4.161]:12525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGrg8-0002Xy-Bp for 53817@debbugs.gnu.org; Sun, 06 Feb 2022 19:14:49 -0500 Received: from [10.11.45.164] (php.internal.maxeygroup.tech [10.11.45.164]) by mail.maxeygroup.tech (8.17.1/8.17.1) with ESMTP id 2170Ek4P188704; Sun, 6 Feb 2022 18:14:46 -0600 Message-ID: <14f63bd0e8e26669615c2661dfe53f43420a0aca.camel@maxeygroup.tech> Subject: Re: bug#53817: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line From: Doug Maxey To: Stefan Monnier , Lars Ingebrigtsen Date: Sun, 06 Feb 2022 18:14:45 -0600 In-Reply-To: References: <87czk0zk43.fsf@maxeygroup.tech> <87y22n367a.fsf@gnus.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-flhOq5yb523YyV/ObgCM" User-Agent: Evolution 3.42.3 (3.42.3-1.fc35) MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53817 X-Mailman-Approved-At: Sun, 06 Feb 2022 20:02:41 -0500 Cc: Doug Maxey , 53817@debbugs.gnu.org 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: -1.0 (-) --=-flhOq5yb523YyV/ObgCM Content-Type: multipart/alternative; boundary="=-OUNIwG1PnDjthbABt7ZD" --=-OUNIwG1PnDjthbABt7ZD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2022-02-06 at 19:11 -0500, Stefan Monnier wrote: > > (defun sh-smie--default-backward-token () > > [...] > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (pro= gn (skip-syntax-backward ".w_'") > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (not (zerop (skip-syntax-backwa= rd "\\"))) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (when (eq ?= \\ (char-before (1- (point)))) > >=20 > > Semi-colons have punctuation syntax, so we're skipping back over > > the > > entirety of "test;then" instead of stopping after "then". >=20 > We should indeed only skip over "then", and then only over ";" and > then > only over "test". >=20 > > This looks easy enough to fix, but the overall logic of that > > function is > > somewhat obscure to me, so I've added Stefan to the comments; > > perhaps he > > has some comments. >=20 > The sh syntax is fairly nasty to parse, especially backwards, so I > can't > give you any general comment here.=C2=A0 I'd try something and then see i= f > it > breaks any tests (including looking at test/manual/indent/shell.sh). >=20 > For sure, I'd recommend adding a regression test. just a further point, if it helps, this was fine in 27.2. =C2=A0 >=20 >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Stefan >=20 --=-OUNIwG1PnDjthbABt7ZD Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
On Sun, 2022-02-06 at 19:11 -0500, Stefan Mon= nier wrote:
(defun sh-smie--default-backward-token ()
[...]
            (progn= (skip-syntax-backward ".w_'")
     =             &nb= sp; (or (not (zerop (skip-syntax-backward "\\")))
  = ;            &n= bsp;        (when (eq ?\\ (char-before (= 1- (point))))

Semi-colons have punctuation syn= tax, so we're skipping back over the
entirety of "test;then" = instead of stopping after "then".

We should indeed only skip over "then", and then only over ";" and then
only over "test".

This looks easy enough to fix, but the overall logic of that fun= ction is
somewhat obscure to me, so I've added Stefan to the = comments; perhaps he
has some comments.

The sh syntax is fairly nasty to parse, especially bac= kwards, so I can't
give you any general comment here.  I= 'd try something and then see if it
breaks any tests (includi= ng looking at test/manual/indent/shell.sh).

Fo= r sure, I'd recommend adding a regression test.
=
just a further point, if it helps, this was fine in 27.2.
 


        Stefan

=

--=-OUNIwG1PnDjthbABt7ZD-- --=-flhOq5yb523YyV/ObgCM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgEFqv+KdzexjaJ05sIZSRoIHzIkFAmIAZHUACgkQsIZSRoIH zImVqg//U0R6aAJggg5AZSOPfXIor6ghf+q6hEj4Bx23L1O4tQhICZp/zw3h8Liu rhkbypR9QF/ltrppyo2KRYu1goOdsqHb+dzcM21xhg0+Oc6phA94l1h1akxsG/EF Dou6IVtBVz1r73w0mzGBR7lmC4HFupCj1pnifp8r5wgODpI1cRwyy/3ENTylbWxd RPi4vh+ilhm8zmEGVN14hvmvora/JX7iDwKD2mBeq+e9SxMT/1CuYyzOhqLwPrtH tiduT97AEmsPljQxC2U+sCLypgQPSUuU7c0rBfGRBrf2GN9opIv8V+EiTJQIwttg yael0rGfmg0812PsLJeQN+CwkyuMdxQ3fArYthn9H/saV8Pc2kIAkVFi99wqEKcD p8EeGglpvs4sC+v/2NkdD7tt+eshVrYvRdtd06u7lIM/PB8uvMPGVQ6TdWPp8TuN bRoLwzQ0gU8mrTY8tsoBD09cYRb/z0V35fDiau3FDwyY4NruQBpSB9jd0rK+iM2w xmcnCFCWfrcAABVyOq8msVwlGbnOwUcg020m3JviVDlDRrLyDm6R790d5M8dIiko APD/FmDOZhBK5+lq/X5SNRsEpHpeQ3MNufePhea8J0OACqUONkXT9DZ9DO9A3w8H ouFJxFCHfYNRc5DDGBzCXX5A00NmKXuLsE9Ep9xqpKDg4u3nxm0= =FBpa -----END PGP SIGNATURE----- --=-flhOq5yb523YyV/ObgCM-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 03:16:21 2022 Received: (at 53817) by debbugs.gnu.org; 7 Feb 2022 08:16:21 +0000 Received: from localhost ([127.0.0.1]:40807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzC8-0005Oz-V3 for submit@debbugs.gnu.org; Mon, 07 Feb 2022 03:16:21 -0500 Received: from quimby.gnus.org ([95.216.78.240]:36992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzC4-0005Oe-Dv for 53817@debbugs.gnu.org; Mon, 07 Feb 2022 03:16:19 -0500 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=1Fj8v1h9bPtdkT6y2dm+gLGgTmu4kpRjPNIQ91oIjdA=; b=dTHIBdqKrpyGe8eluFqEC8rQDu bgFCTFJbR3lVwBR8tgTPZJL562B5uKXMo+HTkgDyz337j7BOBn018rpt3fxnRTego2ktBfMxWz47/ vys2UtvodoGO43h6lHNTGP6zbe5wfucs0oulmTG4i3KWetVhywoK2TUWrYaaNuE0uWxo=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGzBs-0006Is-0x; Mon, 07 Feb 2022 09:16:07 +0100 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#53817: 28.0.91; sh-mode indent misses on 'if test;then' when 'then' is on 'if' line References: <87czk0zk43.fsf@maxeygroup.tech> <87y22n367a.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEVaYGV+i5X///8Q RDtnAAAAAWJLR0QCZgt8ZAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+YCBwgNOQ9mnhsA AADrSURBVCjPbdJNDoQgDAXg10T2ksB9IBn2krT3v8q8IqCZjBvz2T+sAgl2YV2EvpANkGODeUfa ENiOqCAfGzG0c8HkrHhg97CEYFZEpWwAYYM54VrggbLeaMaR8QMUHsO8qLcBtuaB2J8QY9FJVMKK R/igo+TL8xyG6l0JL0QjwoLOiDmKIvGuC2LzcoypP2h/IqOoT/igHeFLyJOGzwNwM680fUUgDp3w nXhkfIu84Os/60R0xPyKSB4NLFLJN9Q5TPrFHbNDRLUYPaP58pmm0fQK3cKcAw2m54KEXgtr7r8m N/4ID/hN0wbwBaiKX524r8YGAAAAQXRFWHRjb21tZW50AENSRUFUT1I6IGdkLWpwZWcgdjEuMCAo dXNpbmcgSUpHIEpQRUcgdjYyKSwgcXVhbGl0eSA9IDkwCnd1XskAAAAldEVYdGRhdGU6Y3JlYXRl ADIwMjItMDItMDdUMDg6MTM6NTcrMDA6MDBWfNayAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTAy LTA3VDA4OjEzOjU3KzAwOjAwJyFuDgAAAABJRU5ErkJggg== X-Now-Playing: Yes's _Going For the One_: "Awaken" Date: Mon, 07 Feb 2022 09:16:01 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 06 Feb 2022 19:11:23 -0500") Message-ID: <87bkzjxfb2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > The sh syntax is fairly nasty to parse, especially backwards, so I can't > give you any general comment here. I'd try something and then see if it > breaks any tests (including looking at test/manua [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53817 Cc: Doug Maxey , 53817@debbugs.gnu.org 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: -3.3 (---) Stefan Monnier writes: > The sh syntax is fairly nasty to parse, especially backwards, so I can't > give you any general comment here. I'd try something and then see if it > breaks any tests (including looking at test/manual/indent/shell.sh). > > For sure, I'd recommend adding a regression test. I've now tweaked the loop, and it fixes the issue and doesn't seem to break anything in the manual test tile. (And I added some automatic tests.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 03:16:25 2022 Received: (at control) by debbugs.gnu.org; 7 Feb 2022 08:16:25 +0000 Received: from localhost ([127.0.0.1]:40810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzCD-0005PF-6P for submit@debbugs.gnu.org; Mon, 07 Feb 2022 03:16:25 -0500 Received: from quimby.gnus.org ([95.216.78.240]:37006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzCB-0005Oq-W7 for control@debbugs.gnu.org; Mon, 07 Feb 2022 03:16:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type: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=uphmA1adjfOUdhKtb2pYEFWKYTkIT7lzM5tlOEbWGP8=; b=Hq/Pmz9/E9+FR5SUqiOxp9Wdi5 BmlrY7r1kMr9lQYfhB4HRcflmVJQSOfNpoVPz8t2ZJN9A7KG566SMzp/oLwD7w0oaOEhJOaZyZqNV KFRwfTBi5DvfHeU039HCNPMtLo16jOhD6dNBbjwilvNQ2vW87+sVkBulhGaZPpT3DRYA=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGzC3-0006Iz-Jb for control@debbugs.gnu.org; Mon, 07 Feb 2022 09:16:18 +0100 Date: Mon, 07 Feb 2022 09:16:14 +0100 Message-Id: <87a6f3xfap.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #53817 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 53817 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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: -3.3 (---) close 53817 29.1 quit From unknown Sat Jun 21 03:22:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 07 Mar 2022 12:24:06 +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