[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7307: 24.0.50; Mode line had more than just dashes removed
From: |
Stefan Monnier |
Subject: |
bug#7307: 24.0.50; Mode line had more than just dashes removed |
Date: |
Mon, 08 Nov 2010 13:28:17 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> How about something like the following patch?
Looks pretty good. It should probably come together with a Lisp part
that removes the current mode-line-format change.
> This builds the string
> dynamically by filling decode_mode_spec_buf to the desired length,
> dispensing with an additional lots_of_<foo> string. AFAICT this gives
> good results (though I admittedly haven't been able to find a case where
> lots_of_filler (replacing lots_of_dashes) is used; what is such a
> case?).
I guess the lots_of_filler case is when you use things like "%5-".
> I also exposed the string character variable mode_line_filler to Lisp,
> so it could be customizable, but I haven't been able to figure out how
> to update the mode line with a new character.
That's because you re-initialize mode_line_filler each time.
Instead you should initialize it once and "for all" in init_xdisp.
But indeed, that exposes another problem: being global, you won't be
able to have "----" in tty frames and " " in GUI frames in the
same process.
> Also, I don't know the right way to set the default value: I assume it
> shouldn't be done in decode_mode_spec() as below but at the top level
> together with the DEFVAR, but then how can it be associated with the
> window whose mode line is being constructed?
Indeed. You could use a terminal property instead of (or additionally
to) a global variable, or you could let the global variable be a cons
cell where the car is the char to use for GUI frames and the cdr is for
tty frames :-(
Stefan