* Improve force redisplay advice
By unconditionally advising `split-window' we ensure that redisplay:
1. Always triggers in the right window, so it solves an issue with
`org-attach' calling `fit-window-to-buffer' from a different window.
2. It's not tied to a buffer that may outlive its popup, so it solves
the issue with `org-set-tags-command' which buffer kept lurking around
with `doom-modeline--size-hacked-p' set to t.
As all known workarounds, this will trigger a quick sequence
redisplay -> fit -> redisplay that causes some little flickering when
the window effectively changes size in-between (which is usually the
case with popups).
Moreover, `fit-window-to-buffer' always transforms a height in pixels
to a height in characters and this operation unavoidably rounds up
to the next integer height in characters when the mode-line is of a
different size than the default character, hence introducing some
small amount of padding at the bottom of the window.
In order to avoid small but yet unpleasant visual artifacts whenever
possible, we only trigger a redisplay when it is strictly required,
that is when the mode-line height effectively differs from the default
character height.
To facilitate the construction of a "vanilla height" modeline when
`doom-modeline-height' <= 0 and `doom-modeline-icon' is nil we ensure
that this simpler modeline will be created, no matter the platform.
* Allow unhacked modeline with icons
Allow a modeline with default height to have icons.
It's recommended to also set `all-the-icons-scale-factor' to 1 in
order to ensure that the modeline will indeed have default height.
This looks nicer, and it also makes sure it is not possible to try to
draw an image with a negative height for the middle part (which might
happen if window-start and buffer-size are out of sync).
Only showing the buffer encoding and EOL style when they are
interesting (not at their default values) makes them stand out more when
needed, and frees up space when not. Users currently cannot hide the
coding-system and EOL segments separately, and would have to watch for
changes to `buffer-file-coding-system` to toggle visibility. Since
doom-modeline reads these values already anyway, we can easily add
support.
Add a new value `'nondefault` for `doom-modeline-buffer-encoding` to
enable this feature.
Add two new settings to set the default. Detecting the user's defaults
is tricky: Emacs does not use a single variable for the default coding
system but a prioritized list, and hooks can (and do, on Windows) change
the defaults. For now, hardcode reasonable "default defaults" and allow
the user to customize them.
Reorganize slightly to minimize work done if we choose not to display a
segment. Behavior when the new feature is not used should be unchanged.
Switch from an XPM to a PBM bitmap: PBM is easier to generate and easier
for Emacs to decode. Emacs has PBM support built-in so it's always
available (keep the `image-type-available-p` check in case this changes).
Stop creating a temporary list-of-lists to iterate over.
Rename `doom-modeline--make-xpm` to `doom-modeline--make-image` because
it's no longer creating an XPM, and the type of the bitmap should not
matter to callers.
There is a face for the number part of
notifications (`doom-modeline-unread-number`), however, none for the
notification itself. For symmetry, we introduce
`doom-modeline-notification` as a face for notifications. We also set
the default value to `doom-modeline-warning` to keep the previous
behavior.
Signed-off-by: Waqar Hameed <whame91@gmail.com>
Instead of using `tab-width` for space indentation size, the correct indentation size variable is
tried detected per major mode. If nothing can be found, it will fall back to `tab-width` as before.