frontmacs icon indicating copy to clipboard operation
frontmacs copied to clipboard

Definition of fringe-bitmap might have problems in mixed TTY/GUI sessions

Open Eli-Zaretskii opened this issue 7 years ago • 2 comments

This part of frontmacs-editing.el:

  ;; make the flycheck arrow look like an exclamation point.
  ;; but only do it when emacs runs in a window, not terminal
  (when window-system
    (define-fringe-bitmap 'flycheck-fringe-bitmap-double-arrow
        [0 24 24 24 24 24 24 0 0 24 24 0 0 0 0 0 0]))

is wrong: window-system is a global variable, whereas being on a text-mode terminal is a frame-specific attribute. A single Emacs session can have both GUI and TTY frames at the same time.

Eli-Zaretskii avatar Jan 04 '18 10:01 Eli-Zaretskii

Thanks @Eli-Zaretskii for a subtle catch! What would the proper way to do it be?

cowboyd avatar Jan 04 '18 15:01 cowboyd

One way is to define a hook function that would be called by flycheck when it is activated for a buffer, and in that function have a check for whether the frame is a GUI one.

Alternatively, does defining this unconditionally do any harm? Fringe settings are supposed to be ignored on TTY frames.

Eli-Zaretskii avatar Jan 04 '18 16:01 Eli-Zaretskii