From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.bugs Subject: bug#15478: cc-mode does not obey electric-indent-mode Date: Sat, 5 Oct 2013 22:04:00 -0700 Message-ID: References: <20130928201147.GC11317@acm.acm> <20130929091017.GA3161@acm.acm> <20131002200737.GA3895@acm.acm> <524CDA92.1030107@dancol.org> <20131003094543.GA3211@acm.acm> <83zjqn5cri.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158af4e81589e04e80b7820 X-Trace: ger.gmane.org 1381035913 7901 80.91.229.3 (6 Oct 2013 05:05:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Oct 2013 05:05:13 +0000 (UTC) Cc: gnu-emacs-bug@moderators.isc.org, Alan Mackenzie To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 06 07:05:16 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 1VSgWp-0006nl-Sz for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Oct 2013 07:05:16 +0200 Original-Received: from localhost ([::1]:53844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgWp-0005P7-Fg for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Oct 2013 01:05:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgWh-0005MW-Ud for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:05:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSgWc-000890-To for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:05:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgWc-00088M-Qf for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VSgWc-00006Z-GS for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Josh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Oct 2013 05:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15478 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.1381035893384 (code B ref -1); Sun, 06 Oct 2013 05:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Oct 2013 05:04:53 +0000 Original-Received: from localhost ([127.0.0.1]:57065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSgWS-000067-OL for submit@debbugs.gnu.org; Sun, 06 Oct 2013 01:04:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47805) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSgWR-00005z-0r for submit@debbugs.gnu.org; Sun, 06 Oct 2013 01:04:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSgWL-00082P-Rn for submit@debbugs.gnu.org; Sun, 06 Oct 2013 01:04:50 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgWL-00082L-Oy for submit@debbugs.gnu.org; Sun, 06 Oct 2013 01:04:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgWH-0005Iv-04 for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:04:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSgWA-00081Z-5E for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:04:40 -0400 Original-Received: from moderators.individual.net ([130.133.4.7]:47785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSgW9-00081P-Rs for bug-gnu-emacs@gnu.org; Sun, 06 Oct 2013 01:04:34 -0400 Original-Received: from mail-qc0-f178.google.com ([209.85.216.178]) by moderators.individual.net (Exim 4.80.1) for gnu-emacs-bug@moderators.isc.org with esmtp (envelope-from ) id <1VSgW9-000ieP-2i>; Sun, 06 Oct 2013 07:04:33 +0200 Original-Received: by mail-qc0-f178.google.com with SMTP id r5so3918488qcx.37 for ; Sat, 05 Oct 2013 22:04:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=fwk3uLdU5xfFDq2pDBGI4ktBFS+GKV1XwQeRLgvv868=; b=U4JIT+OnKc25ufkOZcya6dMGpJoaGyfzm4OqGYATzXbUGhYqLx2c6P/ugA2a9BKXV5 NX0fG/2c0SVGUQLKKxgxC1pLzxiZV+S44bftyElY+EF2Vx82ywLWRmQxrpklcwYTKnPP z8F/Zj+8YdFpz/+wqhEfh+Rf82Er/YqHfnJroZJ4IvUa5iXR5ptF8cmf+OUuoz4vZewb BTHHhZEEYgvErcYERk3TGGV6anpzybupua6VzqDSn5El+m1sRYBeZWZBv5M9k1Dlv/oB eg5bkCp6pATJ7mf7W6uEwkxr4AlmNCiUwrEB/u5P9o3L+OLQfbW8AZctHZnc8+l/CLEe 7FQg== X-Gm-Message-State: ALoCoQkE98ry1ZSfimY58p4aaOfOGWBLDYpdUkLOwLZNsibfV4LlfbhUgKN/+k6WDoy/1dHSv5rc X-Received: by 10.224.163.140 with SMTP id a12mr28583801qay.59.1381035870864; Sat, 05 Oct 2013 22:04:30 -0700 (PDT) Original-Received: by 10.49.38.162 with HTTP; Sat, 5 Oct 2013 22:04:00 -0700 (PDT) In-Reply-To: <83zjqn5cri.fsf@gnu.org> X-Google-Sender-Auth: DMqNg5HSLLz65Yre53ghCGjNnSk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:78952 Archived-At: --089e0158af4e81589e04e80b7820 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Oct 5, 2013 at 7:55 PM, Eli Zaretskii wrote: > > From: Stefan Monnier > > Date: Sat, 05 Oct 2013 21:10:01 -0400 > > Cc: gnu-emacs-bug@moderators.isc.org > > For people who don't like electric-indent-mode, CC-mode's > > c-electric-flag sucks just as much. > Who are they, except for you? Why don't we hear any complaints about > that, except from you? c-electric-flag is a variable defined in `cc-engine.el'. Its value is t Automatically becomes buffer-local when set. Documentation: Not documented as a variable. Do you hear many complaints about other undocumented variables? C-c C-l runs the command c-toggle-electric-state, which is an interactive compiled Lisp function in `cc-cmds.el'. It is bound to C-c C-l, . (c-toggle-electric-state &optional ARG) Toggle the electric indentation feature. Optional numeric ARG, if supplied, turns on electric indentation when positive, turns it off when negative, and just toggles it when zero or left out. This is the command that Alan has claimed solved the problem back in 2005 and makes it easy for newbies to easily disable electricity. I don't believe that is so. Neglecting the fact that newbies are unlikely to be familiar with Emacs' "electric" term of art and thus unlikely to even make the connection between "c-toggle-electric-state" and the behavior they're trying to disable, this docstring makes no mention whatsoever of `c-electric-flag', nor does it describe how to disable electric behavior permanently. (One might reasonably assume that the global setting would govern here, but as we know it does not.) Perhaps the newbie would have enough Lisp to make the leap from that docstring to adding (c-toggle-electric-state -1) to her init file, but since that function is not autoloaded it would likely only result in a cryptic error message. She could overcome this with an appropriate (require ...) or (eval-after-load ...) form, but of what feature? Should she read the CC Mode source to untangle the dependencies in order to find the appropriate top-level feature (and maybe go down the rabbit hole of investigating how the unfamiliar `cc-require' differs from `require')? I could only manage to disable this feature permanently by reading the source and setq-default'ing (because it's not customizable either) an undocumented variable. I suspect that if you don't hear many complaints about this behavior it's because the procedure to disable it is beyond the ability of most newbies who might wish to do so--perhaps they don't even realize that it's possible--and that a good number of them move on to some other editor as a result. Others of us read the source code and find the right magic undocumented variable to nilify to make editing C stop being annoying without complaining to anybody. --089e0158af4e81589e04e80b7820 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Sat, Oct 5, 2013 at 7:55 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > From:= Stefan Monnier <monnier@iro= .umontreal.ca>
> > Date: Sat, 05 Oct 2013 21:10:01 -0400
> > Cc: gnu-emacs-bug@moderators.isc.org<= /a>
> > For people who don't like electric-indent-mode, CC-mod= e's
> > c-electric-flag sucks just as much.
> Who are they, except = for you?=A0 Why don't we hear any complaints about
> that, except= from you?

=A0=A0=A0 c-electric-flag is a variable defined in `cc-en= gine.el'.
=A0=A0=A0 Its value is t
=A0=A0=A0
=A0=A0=A0=A0=A0 Automatically bec= omes buffer-local when set.
=A0=A0=A0
=A0=A0=A0 Documentation:
= =A0=A0=A0 Not documented as a variable.

Do you hear many complaints = about other undocumented variables?=A0

=A0=A0=A0 C-c C-l runs the command c-toggle-electric-state, which is an=
=A0=A0=A0 interactive compiled Lisp function in `cc-cmds.el'.
= =A0=A0=A0
=A0=A0=A0 It is bound to C-c C-l, <menu-bar> <C> = <Toggle...> <Electric mode>.
=A0=A0=A0
=A0=A0=A0 (c-toggle-electric-state &optional ARG)
=A0= =A0=A0
=A0=A0=A0 Toggle the electric indentation feature.
=A0=A0=A0 = Optional numeric ARG, if supplied, turns on electric indentation when
= =A0=A0=A0 positive, turns it off when negative, and just toggles it when ze= ro or
=A0=A0=A0 left out.

This is the command that Alan has claimed solved= the problem back in
2005 and makes it easy for newbies to easily disabl= e electricity.=A0 I
don't believe that is so.=A0 Neglecting the fact= that newbies are
unlikely to be familiar with Emacs' "electric" term of art an= d thus
unlikely to even make the connection between "c-toggle-elect= ric-state"
and the behavior they're trying to disable, this doc= string makes no
mention whatsoever of `c-electric-flag', nor does it describe how todisable electric behavior permanently.=A0 (One might reasonably assume
= that the global setting would govern here, but as we know it does
not.)= =A0 Perhaps the newbie would have enough Lisp to make the leap from
that docstring to adding
=A0 (c-toggle-electric-state -1)
to her in= it file, but since that function is not autoloaded it would
likely only = result in a cryptic error message.=A0 She could overcome
this with an ap= propriate (require ...) or (eval-after-load ...) form,
but of what feature?=A0 Should she read the CC Mode source to untangle
t= he dependencies in order to find the appropriate top-level feature
(and = maybe go down the rabbit hole of investigating how the unfamiliar
`cc-re= quire' differs from `require')?=A0 I could only manage to disable this feature permanently by reading the source and setq-default'ing (because it's not customizable either) an undocumented variable.=A0
I suspect that if you don't hear many complaints about this behav= ior
it's because the procedure to disable it is beyond the ability of most<= br>newbies who might wish to do so--perhaps they don't even realize tha= t
it's possible--and that a good number of them move on to some othe= r
editor as a result.=A0 Others of us read the source code and find the right=
magic undocumented variable to nilify to make editing C stop being annoying without complaining to anybody.

--089e0158af4e81589e04e80b7820--