When I boot I launch emacs --daemon
and it evaluates my .emacs with one exception:
(add-to-list 'load-path "~/.elisp/zenburn-emacs") ;fix loading issue
(require 'zenburn)
;;; color theme - zenburn?
(add-to-list 'load-path "~/.elisp/color-theme")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))
I know that the load-path stuff works because M-x zenburn loads the color scheme just fine once I launch emacsclient with emacsclient -nw.
Does anybody know what is up with (eval-after-load [snip - see above])?
Is this a bug?
System Info:
GNU Emacs 23.2.1
Installed in debian sid on2.6.32-5-amd64 Version: 23.2+1-7
Filename: pool/main/e/emacs23/emacs23_23.2+1-7_amd64.deb
And a tip from the current maintainer of Zenburn for Emacs(yours truly):
(add-to-list 'load-path "~/.elisp/color-theme")
(add-to-list 'load-path "~/.elisp/zenburn-emacs")
(require 'zenburn)
(zenburn)
You don't need to require color-theme since zenburn requires it internally. You do need, however, to call the zenburn function after you've required zenburn.
You're actually invoking the (zenburn) function when you type M-x zenburn and this is why the theme is getting applied just then instead of on startup.
You don't really say what isn't working?
(require 'zenburn) isn't enough to start the theme.
You need to call (color-theme-zenburn) as well (or its alias (zenburn), as you are doing interactively).
FWIW, here's how I load zenburn in my .emacs:
(require 'zenburn)
(zenburn)
Loads fine via emacsclient.
This is too long for a comment:
I have in my .emacs file the following line:
(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))
If I put for example
(color-theme-taylor)
after this line it works, if I put it before this line, it doesn't.
I.e.
(require 'color-theme)
(color-theme-initialize)
(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))
(color-theme-taylor)
works... perhaps your problem may have a similar cause...
Something like (progn (require 'color-theme) (color-theme-initialize)) should work. To see (eval-after-load "color-theme" '(progn (color-theme-initialize))) does what it should do, check if color-theme-initialize is appended to after-load-alist (describe-variable C-h v). If not, it could be a bug.
Related
I recently upgraded from the ada-mode built-in to Emacs for the updated elpa version (5.1.9) due to issues with compiling from within ada-mode with the earlier version (4.0.0).
In the updated package it is impossible to indent, with TAB performing no operation at all except to move all text on all lines to the leftmost column, regardless of whether it should be indented or not. No other type of indenting (ada-indent-current, ada-indent-region, or ada-indent-newline-indent) work either and neither does automatic indentation via RET.
There is no mention in *Messages* that there is any problem, and the built-in version has no trouble with the indentation.
I'm quite new to Emacs, but I've been trying to solve this problem for a while now with no solution in sight.
My init.el is below in case I've simply done something strange in my noviceness:
(package-initialize)
;; (setq package-enable-at-startup nil)
(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(add-to-list 'load-path "~/.emacs.d/lisp")
(global-linum-mode t) ;; Show line numbers
(autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(when (eq system-type 'darwin) ;; mac specific settings
(setq mac-option-modifier 'meta))
(setq exec-path-from-shell-check-startup nil)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(ac-config-default)
When I'm starting emacs as daemon I can not read comments (their color like background). But when I'm using emacs without --daemon switch everything is ok.
How to fix that weird issue?
;;; Custom color scheme related configurations
(if (< emacs-major-version 24)
(unless (eq system-type 'windows-nt)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/emacs-goodies-el/")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-hober)
)
)
(add-to-list 'load-path (concat dotfiles-dir "color-theme-solarized"))
(require 'color-theme-solarized)
)
(progn
(add-to-list 'custom-theme-load-path (concat dotfiles-dir "color-theme-solarized"))
(load-theme 'solarized-dark t)
)
)
just run emacs
run emacs -Q
run emacs --daemon
as you can see - totally different results.
and line numbers are also gone in emacs -Q and emacs --daemon cases.
To enable line numbers:
(global-linum-mode 1)
emacs version: GNU Emacs 24.4.1
I have Emacs24, i want to use some modes like auto-complete.
Here is the thing, I installed 'linum' before and it's just working very well but others not working.
My .emacs file
(add-to-list 'load-path "/root/.scripts")
(require 'linum)
(global-linum-mode 1)
(require 'package)
(add-to-list 'package-archives '("melppa" . "http://melpa.milkbox.net/packages/"))
(package-initalize)
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(require 'yasnippet)
auto-complete and yasnippet just doesn't working , i tried command 'auto-complete-mode' but its still same.
Any ideas ?
EDIT : I installed it from source not from ELPA and it worked.
I had a similar issue when I upgraded to Emacs 24. Have you tried running M-x auto-complete? When I did, I got an error message like the following:
gv-get: (popup-cursor ac-menu) is not a valid place expression
It turned out this was an already reported bug that can be fixed by recompiling your byte-code:
https://github.com/auto-complete/auto-complete/issues/222
https://github.com/auto-complete/auto-complete/issues/118
This solution worked for me:
$ find ~/.emacs.d/elpa -name '*.elc' | xargs rm
(to remove all compiled elisp in your elpa subdirectories)
... then, in an elisp interaction buffer, like scratch eval:
(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0)
... then re-start emacs.
I installed ac-math plugin as well as auto-complete. I ac-math.el in .emacs.d/plugins/auto-complete
I put this in my .emacs
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete/.")
(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/ac-dict/")
(require 'auto-complete-config)
(ac-config-default)
(require 'ac-math)
(add-to-list 'ac-modes 'latex-mode) ; make auto-complete aware of latex-mode
(defun ac-latex-mode-setup () ; add ac-sources to default ac-sources
(setq ac-sources
(append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands)
ac-sources)))
(add-hook 'latex-mode-hook 'ac-latex-mode-setup)
But I get the error "wrong type argument: integrep nil". Any help?
As far as auto-complete-mode is concerned there is a rather out-dated homepage: http://cx4a.org/software/auto-complete/
If you install from there you propably do not have an up to date version like eg the one that can be found on github ( https://github.com/auto-complete/auto-complete ). In that repository the branch for version 1.3 (the one that is available on the homepage) was not updated in the last three years.
I made the mistake of updating my existing ports with MacPorts -- now slime and swank-clojure no longer work. I get the following message when I invoke clojure-jack-in within emacs:
Versions differ: 2011-04-16 (slime) vs. 20100404 (swank). Continue? (y or n)
Entering y will bring up the slime REPL, but then when I try to evaluate an expression in the REPL, I get another message:
Not connected. Use `M-x slime' to start a Lisp.
What is going on here?
Here are the relevant portions of my init.el file:
;; slime
(setq inferior-lisp-program "/opt/local/bin/sbcl")
(add-to-list 'load-path
"/opt/local/share/emacs/site-lisp/slime"
"/opt/local/share/emacs/site-lisp/slime/contrib")
(add-hook 'slime-repl-mode-hook
(defun clojure-mode-slime-font-lock()
(require 'clojure-mode)
(let (font-lock-mode)
(clojure-mode-font-lock-setup))))
(require 'slime)
(slime-setup '(slime-repl))
(eval-after-load "slime" '(slime-setup '(slime-fancy slime-banner)))
;; clojure
(add-to-list 'load-path
"~/.emacs.d/elpa/clojure-mode-el"
"~/.emacs.d/elpa/paredit-22")
(require 'clojure-mode)
(defun turn-on-paredit () (paredit-mode 1))
(add-hook 'clojure-mode-hook 'turn-on-paredit)
swank-clojure only works with slime version 20100404:
https://github.com/technomancy/swank-clojure/issues/120#issuecomment-4862556
only option at this point is to downgrade version of slime.