From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15596: Let's improve the default workings of electric-indent-mode. Date: Sun, 13 Oct 2013 22:16:18 -0400 Message-ID: References: <524CDA92.1030107@dancol.org> <20131003094543.GA3211@acm.acm> <83zjqn5cri.fsf@gnu.org> <20131012145415.GA3987@acm.acm> <20131013123659.GB2621@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381717038 12648 80.91.229.3 (14 Oct 2013 02:17:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 02:17:18 +0000 (UTC) Cc: 15596@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 14 04:17:21 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VVXii-0004ZT-So for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2013 04:17:21 +0200 Original-Received: from localhost ([::1]:35071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXii-0000Kz-9G for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Oct 2013 22:17:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXiY-0000Ks-73 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:17:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVXiQ-0003pT-Ru for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:17:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXiQ-0003pP-OB for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VVXiP-0001MN-WD for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Oct 2013 02:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15596 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15596-submit@debbugs.gnu.org id=B15596.13817169875173 (code B ref 15596); Mon, 14 Oct 2013 02:17:01 +0000 Original-Received: (at 15596) by debbugs.gnu.org; 14 Oct 2013 02:16:27 +0000 Original-Received: from localhost ([127.0.0.1]:47105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVXhr-0001LN-5G for submit@debbugs.gnu.org; Sun, 13 Oct 2013 22:16:27 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:25047) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVXho-0001L9-98 for 15596@debbugs.gnu.org; Sun, 13 Oct 2013 22:16:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCqNl/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFMCqNl/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35427328" Original-Received: from 76-10-163-101.dsl.teksavvy.com (HELO pastel.home) ([76.10.163.101]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Oct 2013 22:12:18 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 1775A60646; Sun, 13 Oct 2013 22:16:18 -0400 (EDT) In-Reply-To: <20131013123659.GB2621@acm.acm> (Alan Mackenzie's message of "Sun, 13 Oct 2013 12:36:59 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79232 Archived-At: > These are surely bad ideas. `electric-indent-mode' is a global mode, so > creating buffer local copies of it will lead to confusion. It's not meant for purely interactive use (and indeed it requires Elisp coding), and for programmatic uses there's no reason why it should lead to confusion. > What does M-x electric-indent-mode do when there's a buffer local > value of e-i-m? If it toggles the global binding, it will appear not > to have worked in the current buffer. Presumably the user who added the buffer-local binding knows what it does. > If it toggles the local binding, it is no longer a global mode. Indeed, that would be a bug. > I think I was a bit unclear. I meant have the _variable_ e-i-m set to t > by default, but have the electricity disabled by default by the new > buffer local variable `electric-indent-enabled-flag'. But the new > variable `electric-indent-inhibit' can do this anyhow. I'm not sure I understand what we're talking about, then: when you wrote "make `electric-indent-mode' t by default" I understood it to mean that the default behavior of Emacs in most modes should be to auto-indent. > As I reported in emacs-devel, I had trouble in Text Mode with e-i-m. Maybe we should make text-mode disable electric-indent-mode by default? > Surely e-i-inhibit should be t by default. Electric indentation is > useful in (?most) programming modes, but probably not very much in text > modes, or things like Outline Mode. In practice, it's already the case for those modes, AFAIK (tho not by setting e-i-inhibit, because that feature existed before e-i-inhibit). > How about having e-i-inhibit t by default, but setting it to nil in > `prog-mode'? I could consider that. But if we can do without it, that would be preferable, since many programming modes don't derive from prog-mode (yet), and several non-programming modes support indentation (e.g. latex-mode, change-log-mode). Stefan