emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] fix/bug-2034 21904f5: Support mode line constructs for


From: Stefan Monnier
Subject: Re: [Emacs-diffs] fix/bug-2034 21904f5: Support mode line constructs for 'mode-name' in c-mode (bug#2034)
Date: Tue, 03 Jul 2018 17:03:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> +  (unless c-modeline-flags
> +    (setq mode-name (list "" mode-name (list 'c-modeline-display-flags
> +                                          'c-modeline-flags))))
> +  (setq c-modeline-flags
> +     (format "/%s%s%s%s%s"
> +             (if c-block-comment-flag "*" "/")
> +             (if c-electric-flag "l" "")
> +             (if (and c-electric-flag c-auto-newline)
> +                 "a" "")
> +             (if c-hungry-delete-key "h" "")
> +             (if (and
> +                  ;; (cc-)subword might not be loaded.
> +                  (boundp 'c-subword-mode)
> +                  (symbol-value 'c-subword-mode))
> +                 ;; FIXME: subword-mode already comes with its
> +                 ;; own lighter!
> +                 "w"
> +               "")))

At that point, why use `format` here instead of using mode-line
constructs for everything, as in:

    (setq c-mode-line-flags
          '("/"
            (c-block-comment-flag "*" "/")
            ...))

Then c-update-modeline doesn't need to be called repeatedly since the
refresh is done automatically by force-mode-line-update.


        Stefan



reply via email to

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