From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: indentation Date: Tue, 27 Apr 2021 16:31:05 -0400 Message-ID: References: <20210427090348.67C9B5D0@centrum.cz> <20210427202932.DFDEF50D@centrum.cz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25521"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 27 22:32:03 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 1lbUNH-0006Yu-Cc for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 22:32:03 +0200 Original-Received: from localhost ([::1]:49436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbUNG-0001ae-E3 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 16:32:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbUMT-0001YO-1i for help-gnu-emacs@gnu.org; Tue, 27 Apr 2021 16:31:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbUMP-0003eH-4i for help-gnu-emacs@gnu.org; Tue, 27 Apr 2021 16:31:12 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E809E100222; Tue, 27 Apr 2021 16:31:07 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 79BFE1000CF; Tue, 27 Apr 2021 16:31:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1619555466; bh=GSo2dLw9IQFvqtTb9A08L2kJbY9JQtVvUFhnIJ5g2YY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aVmdw8K7Zz1L3a+wqMuK06toeWlbF96lCITIMTQTkcjDSEvlhJOZuqhMARg68t5cj jwlWcQxUT2xADRdjNfI+2cJUMeJC4piLn9HeX4jbnrn4krnK+z/HpzSNM+NLTfFJaR bMEJAEcfiYp7Ub6h/NbJQWGsUmc/xVwzyOLowRKhAQc0bXauCA3rRsFgZ5hwPlX8K3 OutvpU+KbWi6LgM/RhZOV6CHwWrtZON5W7PbRiGQlWDXES5VM2e6lB3nFQA7FmhrSq GJENJvJrLEVZdeuEgdR7Q7sMXAZhEv+t98FfwlOrwIosf2GXPHPJC9Wug3Ug2vXlYf u7j5hyIEN2ONg== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6D657120207; Tue, 27 Apr 2021 16:31:06 -0400 (EDT) In-Reply-To: <20210427202932.DFDEF50D@centrum.cz> (ptlo@centrum.cz's message of "Tue, 27 Apr 2021 20:29:32 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca 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, RCVD_IN_DNSWL_MED=-2.3, 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:129178 Archived-At: > I have a comment starting with ! in column 1, and a F90 code on next line > starting around column 7. When I hit enter inside the comment, the rest of > the comment is now on new line and aligned according to the *next* line (the > F90 code). Without knowing more about the content of your code and comment (and F90's syntax) I'm not sure if column 7 is the right choice for the indentation of the new line, but it sounds reasonable. > Moreover the start of the comment, instead of left alone -- is > equally aligned too, i.e. the ! moved to around col. 7. I expect the same happens if you just hit TAB instead of RET, right? If so, the problem is not directly linked to the electric-indent-mode, and is instead either a bug in f90-mode's indentation code or maybe it's controlled by a config var in `f90-mode` (since it sounds to me that comments in column 1 are an old F77 convention which you may or may not want to follow in F90 code). > This all happens even when above the comment was another comment > starting e.g. in col. 1, not another F90 code, meaning that the > indentation is governed by what follows not precedes. It's probably neither: the indentation rules probably looks at preceding *code* rather than preceding comments ;-) > Crazines squared, isn't it? There's always some twisted logic behind craziness. Stefan