From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: newline-and-indent vs. electric-indent-mode Date: Mon, 25 Jan 2021 13:59:35 +0200 Message-ID: References: <87wnw5yt58.fsf@hajtower> <01d07f6d-cc4c-2f54-4bae-a611bba7be93@yandex.ru> <66b7932d-4cee-9628-fae0-168ee6ebc041@yandex.ru> <801ef866-4212-5b74-350e-9942953174fe@yandex.ru> 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="32085"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: Madhu , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 25 13:00:23 2021 Return-path: Envelope-to: ged-emacs-devel@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 1l40Xf-0008E2-1L for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Jan 2021 13:00:23 +0100 Original-Received: from localhost ([::1]:44076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l40Xd-0000kP-Qf for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Jan 2021 07:00:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l40X0-0000IX-SG for emacs-devel@gnu.org; Mon, 25 Jan 2021 06:59:42 -0500 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:40398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l40Wy-0005bY-Qy for emacs-devel@gnu.org; Mon, 25 Jan 2021 06:59:42 -0500 Original-Received: by mail-ed1-x531.google.com with SMTP id a14so3643986edu.7 for ; Mon, 25 Jan 2021 03:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aZD/+SjxT/dEbt0rgwFzqTm4QnmTNjjOtKCJ4ajKa+U=; b=PVhDHAsKVKlbJb6MjO31vajHs9fM3MVAJsb663V3ciNcblI0SLvA3ubLBMGdxxvGJ7 kqVul0m/CYVkx64OJLgwhrAjsbnj3tYv8Xvs7dNDngqV2Z+H4t1yM+I0K69WNq49wltN NeBV2DizC8Xmonnd/Gx3PUIuiSUF5EFnUj9igOzx2ak3wGbtzSLDkZlwN4XXSOv+w/6M Px14vENPaHLvkQ9ya7floDNz+gg72IrUUmOBvcEzopQNoRn7D3lmQScg25vM+baHYN3U VyCY4P8Z6R6rtVqb8KGPQGAyTtHc7n6MaNL8dmg5dK/f1Crxzhe7gAJhXakenM15robm 4CMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aZD/+SjxT/dEbt0rgwFzqTm4QnmTNjjOtKCJ4ajKa+U=; b=aeS9AacVWKS4dsocmr1a3K6Clf7aNGYiXSeox9I3nLGgFxIfPkxuJqfkuwDSS6TyZQ 79Xv1ofoU8fYn3ghU5NT8KurWRb5xxxV1ikaNI3jznbSkOP4oDNEyUXQfiWhHV8qaThY nMr49j0tqwdeY6jG4YMLNRfo3OUio6C5ZamkQYYikLy3QCmImu9ymc+Nd9hzP377Qh/y G7w/9k41yWI/KoaSLPFXvuLA0eqYO1wCIOA4o94qJ6mPHa561Q6q7eLWnlY8R9nyVuu4 vQIOs8ogWuxRvwUl4EZvCSSR7b3RxrMKJg0NMNg6NH0iBsMq6FUjyd7bTZZx1SJxXXAU FR9Q== X-Gm-Message-State: AOAM530EXjO5iUeH+iBDiwczmwwObh6nfp5yNC/3pw31PLyGvmISW9LU iYWNodBvAOGcEI1maWF+jPA4CJEi4uk= X-Google-Smtp-Source: ABdhPJy3+1mkIm3GMz0rdwhI9oZnSFzY6r4itePhh8tJuhLJ4BMVWpJ4pKZIevRFtV3Fvn7JzyDn8g== X-Received: by 2002:a50:8741:: with SMTP id 1mr112624edv.349.1611575978576; Mon, 25 Jan 2021 03:59:38 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p16sm10259936edw.44.2021.01.25.03.59.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jan 2021 03:59:37 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=raaahh@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:263380 Archived-At: On 25.01.2021 12:45, Madhu wrote: > * Dmitry Gutov <801ef866-4212-5b74-350e-9942953174fe@yandex.ru> : > Wrote on Mon, 25 Jan 2021 04:29:55 +0200: > >> On 25.01.2021 03:56, Madhu wrote: >>> I used to be benefit from emacs indentation by binding RET to >>> newline-and-indent and remain in control of indentation. >> >> How was it different? >> newline-and-indent can lead to "spurious whitespace" just the same. > > This is true now, and I'm not able to say with certainty what the > difference was 10 years ago (if it indeed was different) It wasn't different before electric-indent-mode was introduced. > IIRC the way to deal with it was that if the next event after a > newline-and-indent is *not* a self-insert-command, then empty whitespace > on that line should have be cleaned up. I've always had to use a third-party mode to clean up that whitespace, such as https://github.com/purcell/whitespace-cleanup-mode (most recently). But what you're suggesting should be easy enough to implement in your personal config too, creating a wrapper for newline-and-indent.