From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.help Subject: Re: indentation Date: Wed, 28 Apr 2021 10:36:34 +0200 Message-ID: <1c224366-0968-34b2-ddb8-b12c49940f59@gmail.com> References: <20210427090348.67C9B5D0@centrum.cz> <87v9889okp.fsf@posteo.net> <20210427174546.532D380B@centrum.cz> <8735vb3e60.fsf@yandex.com> <100082ce-c6a4-1923-fc89-1d466183afc8@gmail.com> <87y2d31rjp.fsf@yandex.com> <66a6a30a-d5bb-08a8-c3d2-cb615ad900f6@gmail.com> <87tunr1ool.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6548"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: ptlo@centrum.cz, Philip Kaludercic , help-gnu-emacs@gnu.org To: Colin Baxter Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 28 10:37:23 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 1lbfhB-0001bm-TR for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 28 Apr 2021 10:37:21 +0200 Original-Received: from localhost ([::1]:44362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbfhA-0001Qz-UO for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 28 Apr 2021 04:37:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbfgZ-0001QJ-RZ for help-gnu-emacs@gnu.org; Wed, 28 Apr 2021 04:36:43 -0400 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:43538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbfgW-0003qW-Q9 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2021 04:36:43 -0400 Original-Received: by mail-ej1-x62e.google.com with SMTP id l4so93354163ejc.10 for ; Wed, 28 Apr 2021 01:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=afIIgFK/nJ5HaRUPORVaVAsGPT7Q3UmbW+hiNzMRWCc=; b=VqKDK9Umlzin373me4X5L2UlWJ9sF+W+h1XXhjr51813GscGKYiX7xMKDdqyk78Lu8 qglqQSVnMVeWNr31UdnkAfO7+a0ak93mueseXjezfNYK8dRiyjxN1QrjPVQqLLubZ9NU jHlGqMyQ4Y6YEt5ovmM5C8rsvzlXO80YocIKLL1QcOZBaK567WLpisvzUIsFuJ76NVyG B1TvRlV8+N3Oy8qe4oYZwgU4bYjPL/qjEFL0eBQF+LsXAbgNGlCSe0ipfYnHvtSIq2Vy Etw7To2cgkgB+QGbI8G3gCDYwlpNZsszt/23Q9Sj/h/j/qyvMrJXz4PtY+HzHvPzx0CL HCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=afIIgFK/nJ5HaRUPORVaVAsGPT7Q3UmbW+hiNzMRWCc=; b=Ambg55XFe85qKzVCHvSKFC7/zAtylkaPteZqB5wCu2MTMgrBOPhLsvR4Fff7NCyAFu A1GbBo501nowNznWcwh+2YJ3BmBKG67zcoFEMxhWlrthfwPWwBtBs32GFA0OHPahNEu/ PpEZB1kjR1bAe+gRnT6+y66OEFBjt+LWX/LylJvl0faKrTKNFp7kVnVWbk3V08zjS/Cb UIgKPnnD/uS5hOghkENLH97qeOWTVOQW+SNunX5zmVz/RpE0Zx1pm4oYp4WGt6T5mfpc fKNDChJwYWzCBkTuqKZgKEHSm3feL2M5I6kGKVAYZqBZTNdOvlrPQB5ErgXd8eoGL6o7 nTmg== X-Gm-Message-State: AOAM530Hkiq6TCVWiPwbq6NJi2jJg2Fhp0oanSwZ/ifEvnJ/HCOlvqsC M267egG1nxTidezIoQNgWXXT4S87CYmExtfG5IU= X-Google-Smtp-Source: ABdhPJzMiV8JPGEjqanRoVtnLXam+dQScNZbwt32KEm0hEXEhSjDXdpa7DZngNIkZScxJCUYseiPKw== X-Received: by 2002:a17:906:e28c:: with SMTP id gg12mr10588309ejb.483.1619598995966; Wed, 28 Apr 2021 01:36:35 -0700 (PDT) Original-Received: from [192.168.2.103] (dslb-088-066-248-118.088.066.pools.vodafone-ip.de. [88.66.248.118]) by smtp.googlemail.com with ESMTPSA id s20sm4206162edu.93.2021.04.28.01.36.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 01:36:35 -0700 (PDT) In-Reply-To: <87tunr1ool.fsf@yandex.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=thibaut.verron@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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=-0.001, 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:129185 Archived-At: On 4/27/21 10:02 PM, Colin Baxter wrote: >>>>>> Thibaut Verron writes: > > On 4/27/21 9:00 PM, Colin Baxter wrote: > >> Hi Thibaut, > >> > >>>>>>> Thibaut Verron writes: > >> > On 4/27/21 6:06 PM, Colin Baxter wrote: > >> >>>>>>> writes: >> > Philip, this is it! I > >> disabled the electric-indent-mode and >> emacs > is again sane. I > >> didn't find this option before, looking >> in the > customization > >> groups from the menu. > >> >> > >> >> In F-90 I switch off electric-indent-mode via a > >> .dir-locals.el, >> viz > >> >> > >> >> #+begin_src elisp ((nil . ((f90-if-indent . 4) (f90-do-indent > >> >> . 4) (f90-program-indent . 4) (f90-associate-indent . 4) >> > >> (f90-critical-indent . 4) (f90-type-indent . 4) (eval add-hook >> > >> 'f90-mode-hook (lambda () (electric-indent-local-mode -1)))))) >> > >> #+end_src > >> > >> > Do you use a .dir-locals because you sometimes want to use > > >> electric-indent-mode in fortran? > >> > >> > If yes, I don't think this will do what you want, as the eval > >> form > will modify the global value of the hook. > >> > >> > However, if all you want is to never have electric-indent-mode > >> in > fortran, you can just have the add-hook form in your .emacs. > >> > >> The latter. I use a dir-local and do not put the hook in ~/.emacs > >> for the simple reason that I have other fortran (different > >> versions) directories where I want the electric-indent-mode. > > > Oh, I see. Then something like the following should work, without > > touching the hook for those other directories: > > > ((f90-mode . ((f90-if-indent . 4) (f90-do-indent . 4) > > (f90-program-indent . 4) (f90-associate-indent . 4) > > (f90-critical-indent . 4) (f90-type-indent . 4) (eval > > . (electric-indent-local-mode -1)))) > > > Best wishes, Thibaut > > Right - that's what I wrote except I don't need no f90-mode since there ain't > no non-fortran files in the directory. Ok, then the f90-mode bit is not necessary (but it doesn't hurt either). But the important change is the last line, setting the mode without modifying the hook. You can test it yourself: with what you wrote, open a file in the directory with the dir-locals, re-open it to make sure the hook is run (maybe not necessary if the variables are set for all modes), and indeed electric-indent-mode is off. But if you open another f90 file in one of your other directories, electric-indent-mode will be off there too. Best wishes, Thibaut