From unknown Sat Aug 16 14:25:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24337: 25.1; Indentation regression for 'if' in shell-script mode Resent-From: Phil Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Aug 2016 09:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24337 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24337@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.147254778014213 (code B ref -1); Tue, 30 Aug 2016 09:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Aug 2016 09:03:00 +0000 Received: from localhost ([127.0.0.1]:44042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1beewd-0003hA-O4 for submit@debbugs.gnu.org; Tue, 30 Aug 2016 05:03:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1beewc-0003gx-47 for submit@debbugs.gnu.org; Tue, 30 Aug 2016 05:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beewR-0003bd-3O for submit@debbugs.gnu.org; Tue, 30 Aug 2016 05:02:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beewQ-0003bZ-W9 for submit@debbugs.gnu.org; Tue, 30 Aug 2016 05:02:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beewO-00012x-Ei for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2016 05:02:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beewJ-0003a9-0C for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2016 05:02:43 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:36904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beewI-0003a1-PQ for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2016 05:02:38 -0400 Received: by mail-wm0-x235.google.com with SMTP id i5so24048953wmg.0 for ; Tue, 30 Aug 2016 02:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=4SHcAvxzKmL6PwefBCVoHtftrrIyR7CdgptWS31QdxA=; b=RirQ6vwF1C2DuFMFpyx1V3C/QU7PRE9z8WnscSBduDw8kshM7O/roaalzUxw8oK4hS ndNvDHHYEo/uNJ0ky4BTrAkvXb3xlGh/zGtZ+0OEB3BbptTDzC9tmoGB/qn8KjmCCedJ s2aVg47RlNigU0HXrzWBeV5mcuAOPw/6Yq7sgKk9Q9Snpn5/gqseWaJwXNIPe0Xuwz5d Usj/WuRYda/LkdgHi+0jbaH5kQjrfg3EoQ3lPEnQIgjs9+KXdY3k5WzLk5J5/5+4W2gc 6drCgaheKCcchWtBuBfZZQRvKrHS0qy0awvNhh7NKVsti7Z2p3O+ZCh1V1v/pzdoNSoT LkFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=4SHcAvxzKmL6PwefBCVoHtftrrIyR7CdgptWS31QdxA=; b=mHUY9q0CW/p+KcSiq70J9+hgjf1tfbRBGgkCH18MRq6TegBq05Ad0vAvHh+ZawXwrs Vrwxip3NIpLTYgHTpXkJ17ebu8z/eI420cvcoPiYOloMzwNmJGqj5xLg5MHKlFBUmelQ DIwRq9EMABW0LoqEqnz6rM8GILWd6kJW8l4UZx3Un3WsGRz0DGtyesOjx7D9VaL6mL1e 7q2fde0LTDT2cD3JJkWRA6XcUs8I23e/oGlgJp6SabY5L5W5hGV50wLMOnu6xnTr7RcF AyV1SVNTqF/wkgL+0sWHwvKewD5RckptxbkXj40p5NUwhDpyKc3VbH457n1mqL1NGeEC 1+Fw== X-Gm-Message-State: AE9vXwMJ4aA9ByMHCJYPKWx5huOPIDSQS9yjaLtDaEJiaZ+fdO6t3kmwys9RUJ9QLoaFcw== X-Received: by 10.194.175.38 with SMTP id bx6mr2098996wjc.47.1472547757287; Tue, 30 Aug 2016 02:02:37 -0700 (PDT) Received: from phst-glaptop2 ([2001:4c50:32f:d100:d816:c6fe:2360:ad03]) by smtp.gmail.com with ESMTPSA id r16sm17574194wme.16.2016.08.30.02.02.35 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 30 Aug 2016 02:02:36 -0700 (PDT) From: Phil Date: Tue, 30 Aug 2016 11:02:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) 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.8 (---) Create a file /tmp/foo.sh with the following contents: #!/bin/bash if true; then xxx fi while true; do yyy done # Local Variables: # sh-basic-offset: 2 # End: Then, start Emacs with 'emacs -Q' and visit that file. Reindent the entire file (C-x h TAB). Expected behavior: The statements 'xxx' and 'yyy' remain indented by 2 spaces (the basic indent offset set in the file-local variable). Actual behavior: 'yyy' remains at 2 spaces, 'xxx' incorrectly gets 4 spaces of indentation. This is a regression from previous Emacs versions (e.g. Emacs 24.3). In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2016-08-30 built on unknown Repository revision: 17197d0ae9eac100b56078b2a48964b29710b76e Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 14.04 LTS Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Shell-script Minor modes in effect: sh-electric-here-document-mode: t 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 blink-cursor-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 Setting up indent for shell type bash Indentation variables are now local. Indentation setup for shell type bash Mark set [2 times] Indenting region...done Saving file /tmp/foo.sh... Wrote /tmp/foo.sh Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils sh-script smie executable apropos 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 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 95145 5677) (symbols 48 20205 0) (miscs 40 345 131) (strings 32 17143 4898) (string-bytes 1 485673) (vectors 16 12839) (vector-slots 8 454828 3870) (floats 8 162 172) (intervals 56 268 0) (buffers 976 22) (heap 1024 30747 1134)) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 09 13:18:08 2016 Received: (at control) by debbugs.gnu.org; 9 Sep 2016 17:18:08 +0000 Received: from localhost ([127.0.0.1]:54857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biPRH-0002TI-Tr for submit@debbugs.gnu.org; Fri, 09 Sep 2016 13:18:08 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:37822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biPRG-0002Sq-9D for control@debbugs.gnu.org; Fri, 09 Sep 2016 13:18:06 -0400 Received: by mail-it0-f46.google.com with SMTP id i184so23602845itf.0 for ; Fri, 09 Sep 2016 10:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:to:from:subject; bh=PpC9ZRknR8a8hvYDJSo44kMEUPLYpf3fqu+vvt/rLoI=; b=cHZSEjrEA3lOocAfhScSMJKpZCXMgCCrIXAI3rcE9+iQzWPGWZNNauae28pTWsHJ9x Kyr1eGqfGm7tukQ4StJ7K1pg+yuXLKnYexJc6Jx+03Lqlp6qxiSrIYwPFRb3CqeDiwCo eINMPH00KluJEwm9+HVMorF95aCRgBiTKDlxnVWKXfyanWrtaWc5MecbD7E6MkoWFdPQ JAGwTovKWkCsa5XZhpQV173Xchtt9vARUeTKQ/UI15TrapSfLBeW15e4dpr59CjBFM+M 2iIVlVPfdMmZiB2RxPZUdTaSUr/RfAJ88yqcPRqQ1iODx0myP2r9X4oOWIUSfiBXuUcn aJ5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:message-id:to:from:subject; bh=PpC9ZRknR8a8hvYDJSo44kMEUPLYpf3fqu+vvt/rLoI=; b=YE7XpYtZaESlRyz96kjKpZUgJgWE5lI38IETqnqQhxmOePMN4rSkhiuDt7NoUhBIDH WJJcutwJ7lfulYW9tcEV8gpaq/Ryz4FVChYEz0eFmeimtVRNJdKbFz9522WhsxplfaiW 8R0bgUEO81QSQJIeT4FDHcXTk3NWu8R2EQAJBJ6+KP+9X3TJIBARrElJhan6VdidvaRy cN/BozTK/FDDeg9PnyNS5cJQLskQ6dvqa318CvofUTyIoC3OcrwtbBnACufGdQv4dVcU VNqwCcjzdrB9CQnzOdAkrFf6eF7/8BsXwfamYqg6oI+C4MbsF2drwipI6gUSkwkotrFs hbRA== X-Gm-Message-State: AE9vXwOmIyuJVXSywUJfqHeG3dRZM3vBvxjEcxkSDSnp6eWDEvloQ3uHfkbwqWeEZnTw7w== X-Received: by 10.157.47.183 with SMTP id r52mr6277771otb.178.1473441480476; Fri, 09 Sep 2016 10:18:00 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id m205sm1785807itg.8.2016.09.09.10.17.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Sep 2016 10:18:00 -0700 (PDT) Date: Fri, 09 Sep 2016 11:17:17 -0600 Message-Id: <87oa3xouw2.fsf@gmail.com> To: control@debbugs.gnu.org From: Alex Subject: control message for bug #21751 X-Spam-Score: -0.7 (/) 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: -0.7 (/) forcemerge 21751 24337 From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 08:17:38 2017 Received: (at control) by debbugs.gnu.org; 26 Aug 2017 12:17:38 +0000 Received: from localhost ([127.0.0.1]:56113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dla1y-0000vm-LM for submit@debbugs.gnu.org; Sat, 26 Aug 2017 08:17:38 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dla1x-0000vb-KO for control@debbugs.gnu.org; Sat, 26 Aug 2017 08:17:37 -0400 Received: by mail-it0-f46.google.com with SMTP id f1so4869207ith.0 for ; Sat, 26 Aug 2017 05:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=IF8EMJPwhiBwuITazJm9ljQ6CMfORSLTnB8LXTqpFu8=; b=FVOXPTIToyglrDczTndvB/aDPlt/Cmxg3zHY/l1EI+baHtw+O6TRqzkniV1SQwLOVS hyML1AQ16r3wO5NLy04LjSephSYdR99tOWAy2RhGeVhFurUJOiMSujWE7IpqndzWF6AA FliPvePHmIrRK3zzb09gUVTrF+NXLb59WGx+Ok3z5vJlkkAhFunrY0ZasNZqfKT6SCar EO19UM7NiTk+EG/BSyoQ3IL2ug+GDvVCdJiSGBIsGKzZIxXDI5KXOz3j0+LRNEAz4tFv GS07YkS3a7hPAiyYJEq5LxlSFOH1JFOVCmUbVP+80oTtIUZRX6cqId5KIXyqQBpk7uV8 HbWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=IF8EMJPwhiBwuITazJm9ljQ6CMfORSLTnB8LXTqpFu8=; b=X1oPFkaa+0XYB8Aj1hFOuShJaWrS4EIBoVGwuTKzvVWUN2UaAJLteDWskuHKnU+MNF mjIxFrz+F3p7DQQDVIQEK9dQct84K+KPzR0LQ6tVioLpTslVMflm3wJXY2TIKEC46qZk ZUcbjpsYCTOyxWQxObeGaKQhnO67WBXu101Na53Jacv2Dsn+ExNE31U5b6YKGZtxJp68 IlF73yozxZ1YaJ+xLX1BhoPLpg3QQwZxQRE7qk/tdmk/TRE8VGTXMIHPRwxK0QiyiZ0e Z1k5IG5szMEswypFVISfWldL3bsSgoShBvOSbSNMTWnG3lLuEcNmB/NwTZu9VuTASA0o j/Jw== X-Gm-Message-State: AHYfb5gKV11M8/MTRS3OIg66EG8Wx2rI5w1yAVZMW8I+KFv+CZTDCb2m 7V88Y4A/CqJpiZee X-Received: by 10.107.11.71 with SMTP id v68mr1135564ioi.301.1503749852186; Sat, 26 Aug 2017 05:17:32 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id m100sm3893197iod.5.2017.08.26.05.17.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Aug 2017 05:17:31 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #21751 Date: Sat, 26 Aug 2017 08:19:12 -0400 Message-ID: <871snya5dr.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) 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: 0.7 (/) tags 21751 + confirmed quit From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 30 19:48:57 2017 Received: (at control) by debbugs.gnu.org; 30 Aug 2017 23:48:57 +0000 Received: from localhost ([127.0.0.1]:35423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnCjB-0005oK-2N for submit@debbugs.gnu.org; Wed, 30 Aug 2017 19:48:57 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:37073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnCj9-0005o4-AM; Wed, 30 Aug 2017 19:48:55 -0400 Received: by mail-io0-f169.google.com with SMTP id d78so11577342ioe.4; Wed, 30 Aug 2017 16:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=674t4lC2woNUvIdfEleUX+tZAlc+r3wvH+TIJ60yFwM=; b=Gjxz638Qv8SCAA3E74xV+A3iZDvhW5OiCdCFiDWw6r7xrABFcqAf8aJt0oXp8btbN8 naiiKiCnfrHEeWD7c8aiXVP1NLLAohXYvQV7HDFBNcubFnHdYrg/LjDEk4xzOo/ReoDM CQJvXcVtP5Dxv8izwXKoX8W9/s4Ol5+oz9aKGj6BxfGTJtdUcKg4FxcfIziB2faHsQNd Z0r2OSvfrLAhCqOEEFDbgpPju1TeDsIgy4cpkAc5//tbEb1JQlGSmhiYcKO2ynLwxByM jdNWLXLI4Ygvyt/0ALzIeuvXS042YpwMOPtXk8JZermeMgTrs9wrw52ENLD5Trq2JH5q Wbcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=674t4lC2woNUvIdfEleUX+tZAlc+r3wvH+TIJ60yFwM=; b=hfrH2XShEgJNhU6Z+YthOX+rkpszob/UgGe6zoFdEgRVj0a0BKsKfp6FTdYk3XyruW 9bKk8ZGomVclAA2qWm61uKzNMRLvu+ORU9+Z+8dYsuv/qJiNcovKqdCilSSbzT4DBz6k Q78Wx+qNeJ1hY8z4MCyZyRMkMJmuz2FtSJ/JPfyJRLqASJ2lyaXbZnNoTXmmMHcInqwO 1KZfjwWBK9ivLDK0SyOFdZiPDeMm9ZqyUtVXU5l1dyXN64nJjWW3aDSaLw6sZtARY7tN tFFFbCbTJLDco9yEy8MukC+aGceXo6DhnIu5xqu5WlzqzmmiWFKgyUuQBNdvjzTkewMo lumg== X-Gm-Message-State: AHYfb5gQk415WUsY7+U/DPD2f8+AtA4UfK3vJR8wUgm/KTGvhW/297bX L3FcDCqpO/s2RSeJ X-Received: by 10.36.25.199 with SMTP id b190mr3752380itb.58.1504136929602; Wed, 30 Aug 2017 16:48:49 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id y202sm1446724itc.2.2017.08.30.16.48.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2017 16:48:48 -0700 (PDT) From: npostavs@users.sourceforge.net To: Bob Proulx Subject: Re: bug#21751: 24.5; Undesirable sh-mode indent References: <87y4esm6js.fsf@hysteria.proulx.com> <874lsua5fi.fsf@users.sourceforge.net> Date: Wed, 30 Aug 2017 19:50:30 -0400 In-Reply-To: <874lsua5fi.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 26 Aug 2017 08:18:09 -0400") Message-ID: <87y3q07gzd.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control Cc: Phil , 21751@debbugs.gnu.org, Oleksandr Gavenko 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.1 (--) --=-=-= Content-Type: text/plain tags 21751 + patch quit npostavs@users.sourceforge.net writes: > I guess sh-indentation should be made into an obsolete alias for > sh-basic-offset? Here's a patch --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Make-sh-indentation-into-an-alias-for-sh-basic-of.patch Content-Description: patch >From 2205b597476083579bd3e50b20bc2ce42ca54520 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 30 Aug 2017 19:42:47 -0400 Subject: [PATCH v1] Make sh-indentation into an alias for sh-basic-offset (Bug#21751) * lisp/progmodes/sh-script.el (sh-indentation): Redefine as obsolete variable alias for `sh-basic-offset'. (sh-mode, sh-smie--indent-continuation) (sh-smie-rc-rules, sh-basic-indent-line): Replace `sh-indentation' with `sh-basic-offset'. --- lisp/progmodes/sh-script.el | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index ca31635dbc..2cf7e15540 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -593,11 +593,7 @@ sh-assignment-regexp (sexp :format "Evaluate: %v")))) :group 'sh-script) - -(defcustom sh-indentation 4 - "The width for further indentation in Shell-Script mode." - :type 'integer - :group 'sh-script) +(define-obsolete-variable-alias 'sh-indentation 'sh-basic-offset "26.1") (put 'sh-indentation 'safe-local-variable 'integerp) (defcustom sh-remember-variable-min 3 @@ -1623,7 +1619,7 @@ sh-mode (setq-local skeleton-pair-alist '((?` _ ?`))) (setq-local skeleton-pair-filter-function 'sh-quoted-p) (setq-local skeleton-further-elements - '((< '(- (min sh-indentation (current-column)))))) + '((< '(- (min sh-basic-offset (current-column)))))) (setq-local skeleton-filter-function 'sh-feature) (setq-local skeleton-newline-indent-rigidly t) (setq-local defun-prompt-regexp @@ -2018,7 +2014,7 @@ sh-smie--indent-continuation (forward-line -1) (if (sh-smie--looking-back-at-continuation-p) (current-indentation) - (+ (current-indentation) sh-indentation)))) + (+ (current-indentation) sh-basic-offset)))) (t ;; Just make sure a line-continuation is indented deeper. (save-excursion @@ -2039,13 +2035,13 @@ sh-smie--indent-continuation ;; check the line before that one. (> ci indent)) (t ;Previous line is the beginning of the continued line. - (setq indent (min (+ ci sh-indentation) max)) + (setq indent (min (+ ci sh-basic-offset) max)) nil))))) indent)))))) (defun sh-smie-sh-rules (kind token) (pcase (cons kind token) - (`(:elem . basic) sh-indentation) + (`(:elem . basic) sh-basic-offset) (`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) (sh-var-value 'sh-indent-for-case-label))) (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case")) @@ -2254,8 +2250,8 @@ sh-smie-rc-backward-token (defun sh-smie-rc-rules (kind token) (pcase (cons kind token) - (`(:elem . basic) sh-indentation) - ;; (`(:after . "case") (or sh-indentation smie-indent-basic)) + (`(:elem . basic) sh-basic-offset) + ;; (`(:after . "case") (or sh-basic-offset smie-indent-basic)) (`(:after . ";") (if (smie-rule-parent-p "case") (smie-rule-parent (sh-var-value 'sh-indent-after-case)))) @@ -2496,7 +2492,7 @@ sh-modify (defun sh-basic-indent-line () "Indent a line for Sh mode (shell script mode). -Indent as far as preceding non-empty line, then by steps of `sh-indentation'. +Indent as far as preceding non-empty line, then by steps of `sh-basic-offset'. Lines containing only comments are considered empty." (interactive) (let ((previous (save-excursion @@ -2520,9 +2516,9 @@ sh-basic-indent-line (delete-region (point) (progn (beginning-of-line) (point))) (if (eolp) - (max previous (* (1+ (/ current sh-indentation)) - sh-indentation)) - (* (1+ (/ current sh-indentation)) sh-indentation)))))) + (max previous (* (1+ (/ current sh-basic-offset)) + sh-basic-offset)) + (* (1+ (/ current sh-basic-offset)) sh-basic-offset)))))) (if (< (current-column) (current-indentation)) (skip-chars-forward " \t")))) -- 2.14.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 25 19:43:28 2017 Received: (at control) by debbugs.gnu.org; 25 Sep 2017 23:43:28 +0000 Received: from localhost ([127.0.0.1]:59206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwd27-0001fv-NA for submit@debbugs.gnu.org; Mon, 25 Sep 2017 19:43:27 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:34334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwd26-0001fd-Ie; Mon, 25 Sep 2017 19:43:26 -0400 Received: by mail-io0-f196.google.com with SMTP id g32so3708922ioj.1; Mon, 25 Sep 2017 16:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jp2re7hqelRnbbZ5e+ewRZY9aUbValb1loS4ATAt4tI=; b=E5XgDSD2FzY3WTJEmdI6KHeL69cheOZQ+EB7RPio/L2fMYZGrMo/uWL8LiDxsAiUs1 HbYb+OrbfcIWppEKU37mcl+8ydmH86n6XXF1zLrK/9ucUYXuN9dRM/imjxhdZeMPQROy lHuHDs3RuWrnAOiOYW12dT600mu0sWHMYed8Sgk0plYmmsH/Dn0gqi9TvWH0zVRqu5/8 3ahqJHHLxcdyWU0UKsWZ2F4HssRfJHRy0Q4YcpIS5K0ftzIOeY3soDHXXvB+6CtpPXHV 0RzE3ySZnkFu92v7/gdDJJnq9QuL7LkCmuLTvu0fP6ipdwHhDOiv71TaMM3YTUVw+tXz NRnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jp2re7hqelRnbbZ5e+ewRZY9aUbValb1loS4ATAt4tI=; b=b0yJRVyDnrBYwpz9XW9qixXsoNlIg2ZAN5PUgpb7Iaxgr7Z2SV93NINg2g367TOG8R XLhsLxOigEwjtOOmW5EUbOuoKqtrM3aT52tjqNNEs6G+dhYO16o7FX7iUWaCFZ1sioA9 Gpxur48yHHPklVSFWCwpiUQGQ4iI4WeiyV6375IssoJCj7/Xg2Qpd9oSErO2i/CO5E8C 5SoI1zWIrVlEolxB5Cr5nvml07httQp8rSW++Y5j0AkTeW3Ql9TSNNdlheOwLTAVBSXG O7hFVW0mqapwHcD/A6Y0NDEEh5QSPL9wBSkYz4Uv2zmafB9V6HrXU+tEsrxcVCZq6kcs xqxw== X-Gm-Message-State: AHPjjUgFF6yumspSQLCFBP+lMZMO37dnwq/nWHzmlikCqXi5+pkz0M1U 69XP5vA8spFfk2gpgurI8ieV2g== X-Google-Smtp-Source: AOwi7QDpvTNIxGkUdsp0L83QNhNG2Q6jK1s7xiFs2All0p+3c1Xu0MAvugERke+u9gvS1B+/w/CIow== X-Received: by 10.107.29.149 with SMTP id d143mr12396791iod.201.1506383001034; Mon, 25 Sep 2017 16:43:21 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k133sm3826944itd.0.2017.09.25.16.43.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 16:43:20 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#21751: 24.5; Undesirable sh-mode indent References: <87y4esm6js.fsf@hysteria.proulx.com> <874lsua5fi.fsf@users.sourceforge.net> <87y3q07gzd.fsf@users.sourceforge.net> <83mv6dz29p.fsf@gnu.org> Date: Mon, 25 Sep 2017 19:43:19 -0400 In-Reply-To: <83mv6dz29p.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Sep 2017 15:57:38 +0300") Message-ID: <87efqugx9k.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control Cc: p.stephani2@gmail.com, gavenkoa@gmail.com, bob@proulx.com, 21751@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: -2.1 (--) tags 21751 fixed close 21751 26.1 quit Eli Zaretskii writes: >> > I guess sh-indentation should be made into an obsolete alias for >> > sh-basic-offset? >> >> Here's a patch > > Thanks. If there are no objections in a few days, please push. It's more than a few days (I was travelling, and then waiting to see if anything unexpected would turn up from Bug#24848), but pushed to emacs-26 now. [1: f5e72b04d9]: 2017-09-25 19:39:19 -0400 Make sh-indentation into an alias for sh-basic-offset (Bug#21751) http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f5e72b04d930215f6e770e2fe9e02ad6debf03ad