mode-icons icon indicating copy to clipboard operation
mode-icons copied to clipboard

Some icons like read-only indicator don't work in daemon mode

Open Thaodan opened this issue 5 years ago • 4 comments

When starting emacs as --daemon vs. normal some icons are not displayed.

Emacs:28.x Mode-icons: latest melpa

See this screenshot (left daemon, right regular): Screenshot_20201226_064623

Thaodan avatar Dec 26 '20 04:12 Thaodan

I think the bug is related to https://github.com/ryuslash/mode-icons/commit/e29ab2899226c0c2afe00d774de541d1534d0cf7

Before that they work but scale weird (https://user-images.githubusercontent.com/1747359/102846453-aef30c80-4418-11eb-83df-4053db8d9f17.png)

Thaodan avatar Dec 26 '20 04:12 Thaodan

Hi! Thanks for reporting this issue. Sorry I haven't been able to get to helping you yet.

Is this still a problem for you? I've been trying to reproduce this and I don't seem to be able to. I just have (mode-icons-mode) in my init file and I also use Emacs 28.x (specifically GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.17.4) of 2021-02-04) and everything seems to look fine here, I think.

2021-02-05-124751_99x63_scrot

ryuslash avatar Feb 05 '21 20:02 ryuslash

I've looking into this again when reworking my init.el (now init.org). I noticed this related to the modeline mode you use, for example if I just use powerline the icons work. However If use smart-mode line the mentioned icons don't work.

This the fragment of my emacs config that sets up mode-icons:

** Smart-Mode-Line
   #+begin_src emacs-lisp
      (use-package smart-mode-line
       ;; :after powerline
        :init
        (setq sml/no-confirm-load-theme t)
        (setq sml/theme 'respectful)
        (sml/setup)
        (sml/apply-theme 'powerline))
   #+end_src

** Mode-icons: Show icon instead of mode name if aviable

   #+begin_src emacs-lisp
      (use-package mode-icons
        :after smart-mode-line
        :config
        ;;
        (mode-icons-mode))
   #+end_src
``

Thaodan avatar Sep 14 '22 17:09 Thaodan

Hello again!

Great find! Ok... What I think is happening is that mode-icons tries to find out if the %* construct is in the mode-line-modified variable, which is how by default the read-only indicator is added to the mode-line. From a very quick look it seems like smart-mode-line doesn't use this construct but instead has its own way to determine and display whether a buffer is read-only or not. So mode-icons can't tell that it's showing a read-only indicator at all...

Do you know of a way to hook in to smart-mode-line so that you can alter the display of its read-only indicator? If so you might be able to add something from mode-icons into it.

ryuslash avatar Nov 04 '22 04:11 ryuslash