From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nikolay Kudryavtsev Newsgroups: gmane.emacs.help Subject: Re: Debugging SMIE for sh-script.el Date: Thu, 2 Sep 2021 15:07:11 +0300 Message-ID: <04ae9f30-5e65-d7de-501e-92d557ddf84c@gmail.com> References: <87k0jz9rri.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 To: =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 02 14:24:54 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLlm2-0004ry-A8 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 02 Sep 2021 14:24:54 +0200 Original-Received: from localhost ([::1]:60578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLlm1-00089C-2d for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 02 Sep 2021 08:24:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLlV3-0005XF-7h for help-gnu-emacs@gnu.org; Thu, 02 Sep 2021 08:07:21 -0400 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:35463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLlV0-0000hy-8I for help-gnu-emacs@gnu.org; Thu, 02 Sep 2021 08:07:20 -0400 Original-Received: by mail-lj1-x22f.google.com with SMTP id y6so3118061lje.2 for ; Thu, 02 Sep 2021 05:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=ZskO4WP91Nm0FKz+C8QvqkE/C0OT0PQ73J6xs640vHs=; b=XrlobmIeK/ee39dCt/GGayja/qdrR6GSXCzBDjJUH2fU7nsM4WDgZJkemXaCLBRD6t 4bgk8lDDz1f1pV/Ud9j7nYA+8HXmbwQaOmHkrjrq0b+4hqvoMEzogm/44bDyPgptuoDh GLMQpctfVAwADoiPmLHJN7jwxGRQP9vfLgIXBEMb3fVEMkDMyip+8EGsIFSZrgMFOaWA eR2n0EDQrShC0D0IFvGgsGBcvW/HRD4jmNIkegWPEYDjYbotxCQTAT2m9MEW+iU7LHho vXvacxq7WAqRTLCMEAAl6DKcU/inHk2F0hbynv312aVmz3bUTCdd/onkFxkhnhJM34jA L1+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ZskO4WP91Nm0FKz+C8QvqkE/C0OT0PQ73J6xs640vHs=; b=hk3QHE/N5JL0Jn52KhXDVz9406Iip9f8K2gGBwQBq0Jcp9WnxIgRGB2X+zE/DbAl/7 AnmIhEpTTvtOQyyrtzQEyCifY7KX/IoraYMzW4pfaVsbED+6M4MSmDPSX1r/frKhrDnx GNX7lu8Wf8ivZ3Cy6+HIaZc3BsstJ4H1KBKlIZ7E4f90bjX9UP0Y9JmRzBSd1XljXUsG FTAAbwpSEUIt8s9Uc/2d+Zt5XbkPqRpBUpgSrZBJojQeEAQEQdrK6xJDuwUNKZgCODvY GOyl9VWVFG/rlmLAIWGcxPqbuDS8GN8zqMw7SIztR09fAmtgo6WzY8Gb4foooYK7/PbE gQlg== X-Gm-Message-State: AOAM532N/TYb4Q3g+ZJVotQ+xuOAUZ96H65WcoTyN4NMQPl3pEcgvas6 djrbQ4CuTBluyQJOfpyIl+kqmezGjbI= X-Google-Smtp-Source: ABdhPJwQL6/Fk1Kv+zWI0WE/l7MOQQHnV7iGrECwP2KWwEHiZKhtVoBtaan6m5lUby5UcQ61k1I3eg== X-Received: by 2002:a05:651c:1596:: with SMTP id h22mr2286702ljq.448.1630584434877; Thu, 02 Sep 2021 05:07:14 -0700 (PDT) Original-Received: from [192.168.1.72] ([2.92.126.172]) by smtp.gmail.com with ESMTPSA id b12sm180257lfb.42.2021.09.02.05.07.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Sep 2021 05:07:14 -0700 (PDT) X-Google-Original-From: Nikolay Kudryavtsev In-Reply-To: <87k0jz9rri.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=nikolay.kudryavtsev@gmail.com; helo=mail-lj1-x22f.google.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-2.225, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132855 Archived-At: SMIE funcalls smie-indent-functions until one of them returns non-nil. If we do smie-config-show-intent on your line we get: Rules used: :list-intro "" -> nil This means that our line has been indented by the default logic of smie-indent-exps. If we go through it we'll see that it's trying to align with the first arg of sexp which it thinks is "/bar". So in effect it's treating your expression as if it was: ({foo} /bar            --baz \ --quux) P. S. Incidentally I've spent like the entire last week writing SMIE indentation logic for some proprietary language with a really terrible syntax, and I'm not even close to getting it done, so that's how I know this stuff.