I'm having difficulty following the instructions for installing speedbar on Emacs.
step 1. Put Lisp:sr-speedbar.el in your load-path, add
(require 'sr-speedbar)
ok put "sr-speedbar.el" in my load-path. (first of all I am making the assumption my load-path is my .emacs.d directory in my root directory.
I go to this link: http://www.emacswiki.org/emacs/sr-speedbar.el
hit the download button, which I end up having to copy/paste the entire file, save it as sr-speedbar.el inside my .emacs.d directory.
~/.emacs.d now has sr-speedbar.el and my .emacs file has the below code:
1 (add-to-list 'load-path "~/.emacs.d/evil")..
2 (require 'evil)..
3 (evil-mode 1)
4 (require 'sr-speedbar)
~
~
so i close out emacs, open it back up and get this error:
Warning (initialization): An error occurred while loading `/Users/johncurry/.emacs':
File error: Cannot open load file, sr-speedbar
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
so I $ emacs --debug-init
Debugger entered--Lisp error: (file-error "Cannot open load file" "sr-speedbar"$
require(sr-speedbar)
eval-buffer(#<buffer *load*> nil "/Users/johncurry/.emacs" nil t) ; Reading$
load-with-code-conversion("/Users/johncurry/.emacs" "/Users/johncurry/.emacs"$
load("~/.emacs" t t)
#[0 "^H\205\262^# \306=\203^Q^#\307^H\310Q\202;^# \311=\204^^^#\307^H\312$
command-line()
normal-top-level()
sr-speedbar-open returns no match inside emacs. Any idea how to get this wrong? I'm sure it's just me not understanding the instructions, but I need help with this.
I had the same problem. When I checked the load path of emacs I found that the ~/.emacs.d directory wasn't part of the path.
You can check you load-path use the following command
C-h v load-path RET
To add the path I added the following to my .emacs file.
;; Add the ~/.emacs.d/lisp directory and all subdirectories to the load path of emacs
(let ((default-directory "~/.emacs.d/lisp/"))
(normal-top-level-add-subdirs-to-load-path))
I already had some files in the .emacs.d directory so I add a lisp directory so I wouldn't break anything.
I then reloaded my .emacs file and everything worked.
To reload your .emacs file use the following command
M-x load-file RET .emacs RET
source: https://www.emacswiki.org/emacs/LoadPath
Related
I run the following command (M-x):
Install package: haskell-mode
Then I get the error:
[No match]
My .emacs is:
(require 'package)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-archives
(quote
(("gnu" . "http://elpa.gnu.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")))))
(package-initialize)
And I ran also M-x package-refresh-contents.
How can I debug this error?
I removed "rm -rf" the dir "~/.emacs.d/" then it worked.
Brand-new Emacs 24.5 64-bit install on Win7 did not seem to include an init.el file and I needed one for settings for a plug-in I want to use, so I created one in Emacs at C:\Users\brinklec\AppData\Roaming.emacs.d. Restarting Emacs, got the apparently famous
Warning (initialization): An error occurred while loading `c:/Users/brinklec/AppData/Roaming/.emacs.d/init.el':
File error: Cannot open load file, no such file or directory, use-package
I did not initially understand the reference to "use-package" at the end of the error, and the preceding wording apparently misled me to think it was init.el that Emacs was saying it c ould not load.
Manual load gives the same error. However, Emacs can open and successfully resave the file.
I saw a bunch of similar issues, but all seemed to involve other files referenced in an already existing and successfully loaded init.el. I thought my issue was different, but now maybe not?
Contents of my init.el come from recommended config for ENSIME plug-in (verbatim except for first comment line below):
;;; ~/.emacs.d/init.el
;; global variables
(setq
inhibit-startup-screen t
create-lockfiles nil
make-backup-files nil
column-number-mode t
scroll-error-top-bottom t
show-paren-delay 0.5
use-package-always-ensure t
sentence-end-double-space nil)
;; buffer local variables
(setq-default
indent-tabs-mode nil
tab-width 4
c-basic-offset 4)
;; modes
(electric-indent-mode 0)
;; global keybindings
(global-unset-key (kbd "C-z"))
;; the package manager
(require 'package)
(setq
use-package-always-ensure t
package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("org" . "http://orgmode.org/elpa/")
("melpa" . "http://melpa.org/packages/")))
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
Debug output from --debug-init:
Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory" "use-package")
require(use-package)
eval-buffer(#<buffer *load*> nil "c:/Users/brinklec/AppData/Roaming/.emacs.d/init.el" nil t) ; Reading at buffer position 841
load-with-code-conversion("c:/Users/brinklec/AppData/Roaming/.emacs.d/init.el" "c:/Users/brinklec/AppData/Roaming/.emacs.d/init.el" t t)
load("c:/Users/brinklec/AppData/Roaming/.emacs.d/init" t t)
#[0 "\205\262
Adding the following expression right before the final (require 'use-package) seems to have resolved the error (though I'm also no longer getting the helpful greeting screen on startup):
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
I'm an Emacs beginner. I just installed a Emacs on Linux. I want to integrate Emacs with gdb.
Based on some instruction from the internet, I downloaded 2 .el files: multi-gdb-ui.el and multi-gud.el. I put these 2 files in
/tmp/test/emacs/multi-gdb-ui.el
and
/tmp/test/emacs/multi-gud.el
I created a new .emacs file. I only put the following lines in it:
[root#localhost ~]# cat .emacs
(setq gdb-many-windows t)
;; this is used for GDB
(load-library "/tmp/test/emacs/multi-gud.el")
(load-library "/tmp/test/emacs/multi-gdb-ui.el")
Then I launched Emacs. But I got many errors. It asked me to launch it with --debug-init,
so I ran the following:
emacs --debug-init
I got these errors:
Debugger entered--Lisp error: (void-variable overlay-arrow-variable-list)
add-to-list(overlay-arrow-variable-list gud-overlay-arrow-position)
eval-buffer(#<buffer *load*<2>> nil "/tmp/test/emacs/multi-gud.el" nil t)
load-with-code-conversion("/tmp/test/emacs/multi-gud.el" "/tmp/shili/emacs/multi-gud.el" nil nil)
load("/tmp/shili/emacs/multi-gud.el")
load-library("/tmp/shili/emacs/multi-gud.el")
eval-buffer(#<buffer *load*> nil "~/.emacs" nil t)
load-with-code-conversion("/root/.emacs" "~/.emacs" t t)
load("~/.emacs" t t)
#[nil "^H\205\227^# ▒=\203^Q^#▒^H▒Q\2025^# ▒=\203'^#▒▒▒▒#\203#^#▒\2025^#▒\2025^# ▒=\2031^#▒\2025^#▒^H▒Q^Z▒^S▒\n▒\211#\210^K▒=\203F^#▒^S^K\203\210^#▒^K!▒\232\203$
command-line()
normal-top-level()
So how can I load these 2 .el files successfully?
The issue appears to be caused because the folders containing the source files at issue have apparently not been added to the load-path of Emacs. In this particular case, the original poster may either add the following directories to the load-path (i.e., /tmp/shili/emacs/ and /tmp/test/emacs/); or, the source files at issue may be placed inside an Emacs directory that is already wired with the load-path.
The following links contain relevant documentation relating to the load-path, which may be helpful in that regard:
http://www.emacswiki.org/emacs/LoadPath
http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html
I an new to emacs...so i was trying to install ya-snippets
for this first i downloaded the ya-snippet tar file and then uzipped it and then kept it .emacs.d/packages/
and then added the following code to my .emacs file
;; yasnippet
(add-to-list 'load-path
"~/.emacs.d/packages/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
but my obtaining the following error ...
Warning (initialization): An error occurred while loading `/home/nitesh/.emacs':
Symbol's function definition is void: yas-global-mode
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
please tell me the error and as i am new to emacs and please tell what each line is doing my .emacs file written to configure yasnippet ?
and please tell me what to add to .emacs file for ya -snippet to use all c/c++ snippets that comes default with it?
Step One: Place the following two lines near the top of your .emacs file and restart Emacs:
(require 'package)
(package-initialize)
Step Two: M-x list-packages
Step Three: Select Yasnippet with the left mouse click and then click Install, and click Yes.
Step Four: Open up your .emacs file and place this underneath package-initialize
(require 'yasnippet)
(yas-global-mode 1)
Step Five: Restart Emacs and have fun coding. The mode-line will display yas when that minor mode is active.
I want to byte-compile some el files in my .emacs.d directory.I wrote a file like this:
cl.el:
(add-to-list 'load-path "~/.emacs.d/slime/")
(require 'slime)
and someother code.when i byte-compile it,the error is:
Error: Cannot open load file: slime
however,i really put the slime package in the directory.
and i use the batch-byte-compile also find that all el files contain
(require '***)
will result out the similar error
~ does not get expanded; use an absolute path, or (add-to-list 'load-path (expand-file-name "~/.emacs.d/slime/")).
This is unrelated to byte compilation, per se.