From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22564: Fundamental mode isn't fundamental enough. Date: Sun, 01 May 2022 09:16:08 +0300 Message-ID: <83h7697p7b.fsf@gnu.org> References: <20160205125559.GC7727@acm.fritz.box> <20160205215301.GG7727@acm.fritz.box> <87ee1isi8r.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8457"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, larsi@gnus.org, johnw@gnu.org, 22564@debbugs.gnu.org, rgm@gnu.org To: rms@gnu.org, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 01 09:35:46 2022 Return-path: Envelope-to: geb-bug-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 1nl47O-0001wu-6G for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 May 2022 09:35:46 +0200 Original-Received: from localhost ([::1]:54728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nl47M-0002O3-Rn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 May 2022 03:35:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nl2tC-0006p1-It for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 02:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nl2tC-0004oZ-5Q for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 02:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nl2tB-0002jt-VR for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 02:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2022 06:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22564 X-GNU-PR-Package: emacs Original-Received: via spool by 22564-submit@debbugs.gnu.org id=B22564.165138578910486 (code B ref 22564); Sun, 01 May 2022 06:17:01 +0000 Original-Received: (at 22564) by debbugs.gnu.org; 1 May 2022 06:16:29 +0000 Original-Received: from localhost ([127.0.0.1]:59387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nl2sf-0002j4-5v for submit@debbugs.gnu.org; Sun, 01 May 2022 02:16:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nl2sP-0002id-7p for 22564@debbugs.gnu.org; Sun, 01 May 2022 02:16:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nl2sI-0004fX-SM; Sun, 01 May 2022 02:16:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uE+wZ6LkqipnoDNxP76EjRB8sT2GQ+Ku+l6yZDpI+XI=; b=bstU1VbPSz+IEOD5lj7E R+OSQTl9UZ71hE5J+JcMljKiYPE4/WYVCChbBzsZcSbsX51LtbVcCWUSUPnyXQCtR3uJHt/dl32SG eIeKl/mkOO7G5ntZFxOksgnwZM3dGFYqV3XIl78WEV8zSzjMXRIGAYeWi8oQO2V4jGWFtwBVRGEfU 8UVvhzB9p7qTwcIEfa3qQ2ofi2AMq1c8xUQh7YWuwOiJbjGVhnPQRWtg9sI7JkK55ijo0MsURhNPP jFnv3ISlLVprj9S7MdgXwVFWG8GyEBHsRcbmQQcr5TftOnpqs5OMqblIrjzN3U266zRm6f3MZG9lS 36PHoteQFARm7w==; Original-Received: from [87.69.77.57] (port=3720 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nl2sF-0005Av-Jk; Sun, 01 May 2022 02:16:03 -0400 In-Reply-To: (message from Richard Stallman on Sat, 30 Apr 2022 21:53:03 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231091 Archived-At: > From: Richard Stallman > Date: Sat, 30 Apr 2022 21:53:03 -0400 > Cc: jwiegley@gmail.com, johnw@gnu.org, 22564@debbugs.gnu.org, acm@muc.de, > rgm@gnu.org > > The doc string of `electric-indent-mode' is deficient -- it fails to say > what it will concretely do in an uncustomized Emacs. All it says is this: > > When enabled, this reindents whenever the hook ‘electric-indent-functions’ > returns non-nil, or if you insert a character from ‘electric-indent-chars’. > > To see what that concretely does, you have to look at those variables. > That's asking too much, for a beginner. The difficulty is that the hook and the characters vary significantly from major mode to major mode. The latter one, for example, can in some modes include characters that are very unintuitive, like ':'. We could say something like The electric characters normally include the newline, but can also include other characters as needed by the major mode; see `electric-indent-chars' for the actual list. Would this help? > This doc string should say where to find the specifics of what it > does in Fundametal mode. Why is that important? Fundamental mode is not supposed to be used frequently by Emacs users, so why single out that mode, and why specifically for this minor mode? > I looked at them and found that `electric-indent-chars' has TAB (10) in it. > However, TAB has a global binding, `indent-for-tab-command'. 10 is not TAB, it's C-j (newline). > What, then, does Electric Indent mode alter in Fundamental mode? Does > it alter anything? It does. As a simple example, try this in fundamental mode, on an empty line: C-u 10 SPC C-u 10 x C-j > Was there a concrete motive for proposing to disable it in > Fundamental mode? We enabled it by default in every mode (in Emacs 24), so Fundamental mode is also affected. I don't remember the motives; perhaps Stefan (CC'ed) does. > We need to help users find out these > things. Is there a way, other than by reading electric.el? Not really. > The doc string also fails to say what, concretely, reindenting does, or even > what controls what reindenting does. So it needs a lot of improvement. The problem is that this feature is implemented with so many opaque hooks and variables which modes can set and override that it's hard to describe its workings in a way that is both accurate and general enough to cover all the modes which employ those hooks and those variables. The workhorse is electric-indent-post-self-insert-function; please take a look at what it does and how, and I think any improvement of the doc string based on what you see there (and the many rabbit holes down which it will lead you) will be most welcome.