-
Notifications
You must be signed in to change notification settings - Fork 49
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
Emacs startup problem in daemon mode when nlinum/linum configured to be enabled globally #4
Comments
I have seen issues with But the below works as of today: I have this in my init.el: If you want, you can use stuff from my (defconst modi/linum-mode-hooks '(verilog-mode-hook
emacs-lisp-mode-hook
cperl-mode-hook
c-mode-hook
python-mode-hook
matlab-mode-hook
sh-mode-hook
web-mode-hook
html-mode-hook
css-mode-hook
makefile-gmake-mode-hook
tcl-mode-hook)
"List of hooks of major modes in which a linum mode should be enabled.") Here's the relevant piece that enable nlinum only for those modes: (when global-linum-mode
(global-nlinum-mode -1))
(dolist (hook modi/linum-mode-hooks)
(add-hook hook #'nlinum-mode)) As I mentioned, I need to look into why global enabling of nlinum/linum doesn't work in daemon mode. |
I'll keep this issue open till we find a solution to be able to successfully start emacs in daemon mode with nlinum enabled globally. But in the meanwhile, let me know if the daemon startup issue is resolved for you if you enable nlinum only for selected major modes using their hooks. |
@joe9 Feel free to test out this method of linum activation. It now works fine for me on both emacs and emacsclient. FixExplanationDelay the loading of linum to 1 second after emacs becomes idle (after setting up the frame, etc). So it does not matter if you are starting emacs or emacsclient. Load the desktop only after linum has loaded. The problem earlier was that if your saved desktop had references to file buffers that had linum on at the time of saving the desktop, emacs would try to enable linum mode for those buffers even before linum was enabled or loaded. This solution makes sure that linum is loaded before the desktop is loaded. Summary
|
@joe9 I am closing this issue as I have tested global linum mode to work fine in an emacs daemon session now. Feel free to reopen it if you still see this problem. |
Thanks for fixing this. |
Sounds great. |
I use a single frame workflow. So I never needed to do Here's how I quickly tested the code by modifying my code at this line: ;; Do desktop setup after linum setup so that the desktop loaded files will show
;; linum if enabled for that major mode or if enabled globally
(with-eval-after-load 'setup-linum
(require 'setup-desktop)
(make-frame-command)) |
Nice to know! Thanks for the code. |
Just FYI, the same code might not work for you if you haven't delayed loading |
following piece code worked for me.
Those code make my emacs 24.5.1 daemon mode worked with nlinum-mode |
Thanks for sharing that. Since I posted the last time in this thread, I have made a big improvement in how to deal with daemon and linum/font-checking/etc. Solution: Start linum/nlinum in .emacs.d/setup-files/setup-linum.el Lines 166 to 178 in c5a7d1a
|
Hello,
I am sorry to raise this here.
I am trying to use the fix recommended by you here: http://debbugs.gnu.org/cgi/bugreport.cgi?msg=43;att=1;bug=18616
But, for some reason, nothing happens when I start emacs in daemon mode with that code snippet in my init.el. I am using GNU Emacs 24.4.1
Just want to check if the relevant code snippet is still valid.
Thanks again and Sorry for the bother,
This is the code snippet of what I tried:
The text was updated successfully, but these errors were encountered: