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

Using use-package to load airline-themes breaks emacsclient #25

Closed
justinjk007 opened this issue Apr 29, 2017 · 6 comments
Closed

Using use-package to load airline-themes breaks emacsclient #25

justinjk007 opened this issue Apr 29, 2017 · 6 comments

Comments

@justinjk007
Copy link

(use-package powerline
  :config
  (use-package airline-themes
    :config
    (if (daemonp)
        (add-hook 'after-make-frame-functions
                  (lambda (frame)
                    (select-frame frame)
                    (load-theme 'airline-solarized-alternate-gui)))
      (load-theme 'airline-solarized-alternate-gui))
    ))

This is what I have in my config

In the past when I was not using use package this is what I used and this cleared all problems with emacsclient failing

;;source --> https://github.com/AnthonyDiGirolamo/airline-themes
(add-to-list 'load-path "~/.emacs.d/elpa/airline-themes")
(require 'airline-themes)
(if (daemonp)
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (select-frame frame)
                (load-theme 'airline-solarized-alternate-gui)))
  (load-theme 'airline-solarized-alternate-gui))

Any clue how to fix this thanks

@AnthonyDiGirolamo
Copy link
Owner

I'm not sure if you can nest use-package reliably. Try this:

(use-package powerline)

(use-package airline-themes
  :after powerline
  :config
  (if (daemonp)
      (add-hook 'after-make-frame-functions
                (lambda (frame)
                  (select-frame frame)
                  (load-theme 'airline-solarized-alternate-gui)))
    (load-theme 'airline-solarized-alternate-gui)))

For what it's worth I am using almost the same in my config but without using the :after property. It is a nice way to define load order though.

@justinjk007
Copy link
Author

justinjk007 commented Apr 29, 2017

Doing that I get the same error on terminal when trying to start the client, which is

*ERROR*: Unable to find theme file for `airline-solarized-alternate-gui'

No problem with the just emacs thou, only problem is the client works for the first time, then if we close it and start the client again, it spits out the error and vanishes.

@AnthonyDiGirolamo
Copy link
Owner

Hmm, I'm not sure what's going on. I tried your use-package invocation exactly as is within my config and am not getting that error.

I launch emacs --daemon and then start emacsclient -c. A new frame is created with the *scratch* buffer but the airline modeline is not applied there (or in *messages*). If I open a new file or buffer it appears correctly then.

Why is the after-make-frame-functions hook needed in this case? Does loading the theme once not behave as expected?

I'll try cloning your dotfiles and see if I can reproduce it.

@justinjk007
Copy link
Author

Thanks, I am not that good with elisp, this is a solution I found somewhere when I first started using emacsclient , and that worked. When I recently migrated to use-package it stopped working again.

I launch emacs --daemon and then start emacsclient -c. A new frame is created with the scratch buffer but the airline modeline is not applied there (or in messages). If I open a new file or buffer it appears correctly then.

Yes, that is the behavior I am used to too. But now its not working anymore.

@justinjk007
Copy link
Author

justinjk007 commented May 3, 2017

@AnthonyDiGirolamo
Problem Solved, I had these in my custom set variables

 '(custom-theme-load-path
   (quote
    ("~/.emacs.d/elpa/airline-themes-20170425.1646"
     "~/.emacs.d/elpa/solarized-theme-1.2.2" custom-theme-directory t)))

but the directory I was referring had the old version number. I corrected that and the theme loads like it is supposed to even in emacsclient. Thanks

But I should ask you, is there any way to completely remove this custom-theme-load-path or at least move it to use-package so I can keep track of it every-time a new update comes?

Thank you very much for sticking around anyways.

@justinjk007
Copy link
Author

I fixed this long time ago...why is this still open ..lol

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

No branches or pull requests

2 participants