Closed Horrih closed 6 months ago
Please check mode-line-right-align-edge
and try right-margin
.
Please check
mode-line-right-align-edge
and tryright-margin
.
Thank you for your answer. Setting this does take into account the right margin, but even then the results are weird. I used the following minimalist init.el
(require 'package)
(package-initialize)
(use-package doom-modeline
:custom (mode-line-right-align-edge 'window)
:init (doom-modeline-mode))
(defun my/add-margins()
(interactive)
(set-window-margins (selected-window) 0 10))
(keymap-global-set "C-r" #'my/add-margins)
With (mode-line-right-align-edge 'window)
, it aligns with the right margin
With (mode-line-right-align-edge 'right-margin)
, it aligns with twice the right margin
With both settings, it aligns with the window on the left, gets clipped by 10 on the right
Naively, I would expect the 'window setting to ignore margins for the modeline, and the 'right-margin setting to align the modeline with the margins on the right-side or both.
Thie behavior is exactly same as Emacs 30. See the documentation below.
mode-line-right-align-edge
Where mode-line should align to.
Internally, that function uses :align-to in a display property, so aligns to the left edge of the given area. See info node (elisp)Pixel Specification.
Must be set to a symbol. Acceptable values are:
- window: align to extreme right of window, regardless of margins or fringes
- right-fringe: align to right-fringe
- right-margin: align to right-margin
And I tried olivetti-mode
and it seemes working as expected.
With olivetti it works because they use the same margin on the left and the right, the margins move the modeline equally left and right, they cancel each other out so in this particular case it works.
Anyway if this is emacs 30's default behavior for aligning I'll close the request. Thank you for your time
Thank you for the bug report
doom-modeline
related packages.emacs -Q
.Bug description
Hello, I use margins to center the main window. This has the effect of clipping the modeline on the right. Substracting the left margin in doom-modeline-def-modeline() seems to fix the issue, however I am not confident enough to submit a PR, this function looks a bit tricky I'd mess it up.
Without margins :
With margins :
![image](https://github.com/seagle0128/doom-modeline/assets/36566033/2e5c18f8-608d-4bd9-a0c1-b609f7665619)
A partial work-around in the meantime is setting the following, but it does not look good :
Steps to reproduce
I use emacs 29.2 in TUI, on RHEL 9, doom-modeline from MELPA (20240307.717) Start emacs in TUI (emacs -nw) with the following init.el, then press Ctrl+r to apply a left margin
Expected behavior
Have the right modeline segments align to the right of the window instead of being clipped.
OS
Linux
Emacs Version
29 (gccemacs)
Emacs Configurations
Vanilla + basic config
Error callstack
No response
Anything else
No response