emacs-devel
[Top][All Lists]
Advanced

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

Re: Advice needed on modeline customization hack...


From: Stefan Monnier
Subject: Re: Advice needed on modeline customization hack...
Date: Sat, 15 Apr 2017 23:11:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> So I have been irritated for a while by the fact that when you turn
> on column-number-mode, that the displayed column starts at zero. GNU
> coding standards say that compilers and the like are to spit out error
> messages with column numbers starting at one, so what your modeline
> tells you and what your error message tells you are off by one.

FWIW there are other discrepancies in this area.  Some programs report
error's column number in terms of "bytes", others in terms of "chars",
and yet others in terms of "display columns" (e.g. counting TAB as
something like 8 spaces).  So there should be room for more customizability.

> Harder is this: short of redefining the entirety of the really, really
> long mode-line-position variable from bindings.el, which isn't
> something one wants to tell people to casually do in their .emacs
> (it's long and complicated as heck), I'm not quite sure how to do a
> practical customization here. Then again, I only half understand how
> the modeline format stuff works at all, and it seems semantically
> rich enough that some reasonable way to do this should exist.

I suggest adding a function `mode-line-substitute` which traverses the
mode-line-format looking for particular elements to replace with
something else.  So the user can do something like

    (mode-line-substitute "%c" "%C")


        Stefan




reply via email to

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