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
hooks added to prog-mode-hook in user-config is not run when filename is passed as an emacs argument #4741
Comments
The I don't have
Also, you might want to paste here the system information provided by |
@letheed I haven't checked why your code is not working, but in my ;; Activate column indicator in prog-mode and text-mode, except for org-mode
(add-hook 'prog-mode-hook 'turn-on-fci-mode)
(add-hook 'text-mode-hook 'turn-on-fci-mode)
(add-hook 'org-mode-hook 'turn-off-fci-mode 'append) And it's working. |
prog-mode-hook: (fci-mode highlight-indentation-mode spacemacs/load-yasnippet spacemacs//show-trailing-whitespace smartparens-mode rainbow-delimiters-mode spacemacs//enable-hs-minor-mode hl-todo-mode highlight-parentheses-mode highlight-numbers-mode clean-aindent-mode auto-highlight-symbol-mode linum-mode bug-reference-prog-mode goto-address-prog-mode) haskell-mode-hook: (spacemacs/init-haskell-mode ghc-init flycheck-mode spacemacs//init-company-haskell-mode company-mode) rust-mode-hook: (eldoc-mode racer-mode flycheck-mode spacemacs//init-company-rust-mode company-mode)
(defalias 'rust-parent-mode
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
System Info
((auto-completion :variables auto-completion-enable-sort-by-usage t)
bepo better-defaults
(c-c++ :variables c-c++-enable-clang-support t)
colors emacs-lisp git github
(haskell :variables haskell-enable-ghci-ng-support t)
markdown
(org :variables org-enable-github-support t)
shell shell-scripts syntax-checking
(rust :variables rust-enable-racer t)
yaml) @StreakyCobra I've tried replacing I should add that I tried deleting the .emacs folder and recloning the spacemacs git rep' to reinstall everything from scratch, keeping only the dotfile. |
I just had an idea and tried it: it turns out that the problem happens when I open a file by passing it's name as an argument to emacs as in |
@letheed If you want to use emacs in this way (i.e. calling |
@StreakyCobra Yeah, I understand that. To be honest, I've had an emacs server running as a systemd user service for months and I never use it. Old habits die hard I figure. |
It's exactly what I have right now :-)
Add this code to your (setq exec-path-from-shell-variables
(append exec-path-from-shell-variables
(list "TERM"
"RUST_SRC_PATH"
"…"
)))
(exec-path-from-shell-initialize)
My pleasure. It's closer to a hack than a real feature, but it's still better than nothing ;-) |
Ha ha you sir are a wizard... |
👍 |
Closing this issue as the problem was resolved. |
This doesn't solve the original problem! Please reopen |
I've added the following code in
dotspacemacs/user-config
:However, the modes aren't toggled on neither in Rust mode nor in Haskell mode anymore since 0.104 -> 0.105 I think. IFAIK that was the correct way to do it. The hooks run properly when I open the spacemacs dotfile though.
I've moved the code to
dotspacemacs/user-init
which I'm not sure is correct, but does the trick for now. However I'm getting the following error in the*Messages*
buffer:The text was updated successfully, but these errors were encountered: