emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Mon, 24 Feb 2014 22:24:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The other bit takes over the value of c-electric-indent-mode into CC
> Mode only when it has been set by the user, thus preventing
> electric.el's default overriding CC Mode's.

For that I think it's better to only obey electric-indent-mode if
Emacs>24.3 rather than use the electric-indent-mode-has-been-called crutch.

>> > +  ;; Emacs has en/disabled `electric-indent-mode'.  Propagate this 
>> > through to
>> > +  ;; each CC Mode buffer.
>> > +  (when (and (boundp 'electric-indent-mode-has-been-called)
>> > +       (> electric-indent-mode-has-been-called 1))
>> > +    (mapc (lambda (buf)
>> > +      (with-current-buffer buf
>> > +        (when c-buffer-is-cc-mode
>> > +          ;; Don't use `c-toggle-electric-state' here due to recursion.
>> > +          (setq c-electric-flag electric-indent-mode)
>> > +          (c-update-modeline))))
>> > +    (buffer-list))))
>> And could you also explain what this one is trying to avoid?
> Basically the same thing.  It's preventing an inopportune default (as
> contrasted with an explicit user setting) overriding CC Mode's default.

Looks quite different since it checks (>
electric-indent-mode-has-been-called 1), but if you say it's the same,
then I'll remove electric-indent-mode-has-been-called and let you check
Emacs's version instead.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]