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, 17 Feb 2014 19:11:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> +  ;; In Emacs 24.4 onwards, prevent Emacs's built in electric indentation 
> from
> +  ;; messing up CC Mode's, and set `c-electric-flag' if 
> `electric-indent-mode'
> +  ;; has been called by the user.
> +  (when (boundp 'electric-indent-inhibit) (setq electric-indent-inhibit t))
> +  (when (and (boundp 'electric-indent-mode-has-been-called)
> +          (> electric-indent-mode-has-been-called 1))
> +    (setq c-electric-flag electric-indent-mode))

Could you explain what problem this is trying to avoid?

> +  ;; 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?


        Stefan



reply via email to

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