unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
@ 2014-02-16 17:12 Alan Mackenzie
  2014-02-18 16:40 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alan Mackenzie @ 2014-02-16 17:12 UTC (permalink / raw)
  To: 16770

Hi, Emacs.

1. Start emacs -Q.
2. Visit, successively, two random buffers foo and bar.
3. In buffer foo, do M-x electric-indent-local-mode.
4. In buffer bar, do M-x electric-indent-mode.

Both buffers now have e-i-mode disabled.

5. Still in buffer bar, do M-x electric-indent-mode.

This, being a global mode, should enable e-i-mode in all buffers.  But
in buffer foo, electric-indent-mode remains disabled.  This is a bug.

Suggestion for a fix: make electric-indent-local-mode a self-sufficient
minor mode, and define electric-indent-mode with
define-globalized-minor-mode.

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
  2014-02-16 17:12 bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode Alan Mackenzie
@ 2014-02-18 16:40 ` Stefan Monnier
  2014-02-18 18:26 ` Stefan Monnier
  2019-09-30  4:00 ` Stefan Kangas
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-02-18 16:40 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 16770

> Suggestion for a fix: make electric-indent-local-mode a self-sufficient
> minor mode, and define electric-indent-mode with
> define-globalized-minor-mode.

I don't think it's worth the trouble.


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
  2014-02-16 17:12 bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode Alan Mackenzie
  2014-02-18 16:40 ` Stefan Monnier
@ 2014-02-18 18:26 ` Stefan Monnier
  2014-03-20 18:09   ` Stefan
  2019-09-30  4:00 ` Stefan Kangas
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2014-02-18 18:26 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 16770

> 1. Start emacs -Q.
> 2. Visit, successively, two random buffers foo and bar.
> 3. In buffer foo, do M-x electric-indent-local-mode.
> 4. In buffer bar, do M-x electric-indent-mode.

> Both buffers now have e-i-mode disabled.

> 5. Still in buffer bar, do M-x electric-indent-mode.

> This, being a global mode, should enable e-i-mode in all buffers.  But
> in buffer foo, electric-indent-mode remains disabled.  This is a bug.

Actually, upon further consideration, I don't think this one is a bug.
The behavior you want would make sense, but the current one also
makes sense.  At step 3 the user specifically requested to disable
electric-indent in `foo' so changing the global setting should not
affect it.

So the real problem is that electric-indent-local-mode is not consistent
in this regard (it sometimes remembers a local setting even if it's
equal to the global setting, and sometimes treats a local setting equal
to the global setting as meaning "obey the global setting").

Worse:

   (electric-indent-mode -1)
   (electric-indent-local-mode 1)
   (electric-indent-mode 1)
   (electric-indent-mode -1)

leaves us with a buffer where electric-indent-mode is locally t but
there is no electric indentation.


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
  2014-02-18 18:26 ` Stefan Monnier
@ 2014-03-20 18:09   ` Stefan
  2016-02-05 20:10     ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan @ 2014-03-20 18:09 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: 16770

>    (electric-indent-mode -1)
>    (electric-indent-local-mode 1)
>    (electric-indent-mode 1)
>    (electric-indent-mode -1)

> leaves us with a buffer where electric-indent-mode is locally t but
> there is no electric indentation.

I think I fixed this, now, as well as the "C-j is newline even after
disabling electric-indent-local-mode".


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
  2014-03-20 18:09   ` Stefan
@ 2016-02-05 20:10     ` Glenn Morris
  0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2016-02-05 20:10 UTC (permalink / raw)
  To: 16770; +Cc: Alan Mackenzie, Stefan


It seems to me that the issues here that were going to get fixed, did,
so I suggest closing it.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode
  2014-02-16 17:12 bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode Alan Mackenzie
  2014-02-18 16:40 ` Stefan Monnier
  2014-02-18 18:26 ` Stefan Monnier
@ 2019-09-30  4:00 ` Stefan Kangas
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2019-09-30  4:00 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Alan Mackenzie, 16770-done, Stefan

Glenn Morris <rgm@gnu.org> writes:

> It seems to me that the issues here that were going to get fixed, did,
> so I suggest closing it.

OK, closing this now.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-30  4:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 17:12 bug#16770: Erroneous interaction between electric-indent-mode and electric-indent-local-mode Alan Mackenzie
2014-02-18 16:40 ` Stefan Monnier
2014-02-18 18:26 ` Stefan Monnier
2014-03-20 18:09   ` Stefan
2016-02-05 20:10     ` Glenn Morris
2019-09-30  4:00 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).