seagle0128 / doom-modeline

A fancy and fast mode-line inspired by minimalism design.
https://seagle0128.github.io/doom-modeline/
GNU General Public License v3.0
1.29k stars 159 forks source link

[Bug] Should IRC buffers be shortened when there's enough space? #729

Closed Thaodan closed 2 months ago

Thaodan commented 3 months ago

Thank you for the bug report

Bug description

Before #728 circe bufers were not shortened. Now buffers are shortened all the time even when there's enough space.

It would be better if doom-modeline would follow the settings/behavior of tracking.el

Steps to reproduce

  1. Have irc segment enabled
  2. Use circe (not really relevant necessarily
  3. Visit irc buffer

Expected behavior

Shorten buffer names only when there isn't enough space

OS

Linux

Emacs Version

30 (gccemacs)

Emacs Configurations

github.com/thaodan/emacs.d

Error callstack

No response

Anything else

No response

seagle0128 commented 3 months ago

Please check if irc is in doom-modeline-always-visible-segments, and the value of doom-modeline-window-width-limit.

Thaodan commented 3 months ago

Will that make the segment visible outside of IRC buffers?

Thaodan commented 3 months ago

doom-modeline-always-visible-segments is nil. doom-modeline-window-width-limit is 85.

seagle0128 commented 3 months ago

doom-modeline-always-visible-segments is nil. doom-modeline-window-width-limit is 85.

Then you should decrease doom-modeline-window-width-limit to shorten IRC buffer names.

Thaodan commented 3 months ago

The problem is not that they are shortened but that they are shortened also when threshold isn't reached.

seagle0128 commented 3 months ago

For irc buffers, it's by design. If you don't like it, please use this.

cc @seanfarley

(defun doom-modeline--tracking-buffers (buffers)
  "Logic to convert some irc BUFFERS to their font-awesome icon."
  (mapconcat
   (lambda (b)
     (propertize
      (funcall doom-modeline-irc-stylize b)
      'face '(:inherit (doom-modeline-unread-number doom-modeline-notification))
      'help-echo (format "IRC Notification: %s\nmouse-1: Switch to buffer" b)
      'mouse-face 'doom-modeline-highlight
      'local-map (make-mode-line-mouse-map
                  'mouse-1
                  (lambda ()
                    (interactive)
                    (when (buffer-live-p (get-buffer b))
                      (switch-to-buffer b))))))
   buffers
   (doom-modeline-vspc)))
seagle0128 commented 2 months ago

@Thaodan Please upgrade to the latest and test this.

(setq 'doom-modeline-irc-stylize #'identity)