Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong character guides colour with f90-mode-hook in client sessions #67

Open
agreselin opened this issue Dec 10, 2019 · 3 comments
Open
Labels

Comments

@agreselin
Copy link
Contributor

agreselin commented Dec 10, 2019

With the following init.el,

(package-initialize)
(setq highlight-indent-guides-method 'character)
(add-hook 'f90-mode-hook 'highlight-indent-guides-mode)

after launching a client frame indentation guides are shown in black instead of grey:
Screenshot from 2019-12-10 17-30-04
If f90-mode-hook is replaced with prog-mode-hook, indentation guides get the right colour:
Screenshot from 2019-12-10 17-30-18

How to reproduce

With the init.el above, run emacs --daemon && emacsclient -c file.f90.

This issue only happens in emacsclient sessions. Launching Emacs with emacs file.f90 I get the right colour even with f90-mode-hook in my init file.

I'm on Emacs 26.2, highlight-indent-guides v. 20190108.3.

@agreselin
Copy link
Contributor Author

Update

The behaviour I'm getting is quite weird: I tried to work around the issue by enabling highlight-indent-guides-mode from the prog-mode-hook and disabling it with (highlight-indent-guides-mode -1) in the hook of modes where I don't want it. It works for LaTeX, shell, Markdown and other mode hooks, but calling (highlight-indent-guides-mode -1) from emacs-lisp-mode-hook got me back the black guides again.

The thing that works best seems to be just adding (highlight-indent-guides-mode) to init.el. 🤔

Btw, thank you for your great work :-)

@agreselin
Copy link
Contributor Author

agreselin commented Dec 16, 2019

This looks like a better solution:

(defun highlight-indent-guides-auto-set-faces-with-frame (frame)
  (with-selected-frame frame
    (highlight-indent-guides-auto-set-faces)))
(if (daemonp)
    (add-hook 'after-make-frame-functions #'highlight-indent-guides-auto-set-faces-with-frame))

@DarthFennec
Copy link
Owner

Hm ... I'm having trouble reproducing this on my macos, I don't think the package I'm using supports the -c option for emacsclient. I'll have to take a closer look later on my linux system. Thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants