I'm currently trying to get dirtree for Emacs working. I'm unfamiliar with configuration files and I'm having trouble getting it to work. Currently I have dirtree.el, along with the other required files, inside of my .emacs.d directory, and I've added the following lines to my .emacs file.
(add-to-list 'load-path "~/.emacs.d/")
(autoload 'dirtree "dirtree" "Add directory to tree view")
I don't get any errors when I open Emacs, but when I type M-x dirtree, I get a message saying there is no match. Can anyone see what I'm missing in order to get this to work correctly?
The dirtree that I'm using can be found at: http://www.emacswiki.org/emacs/dirtree.el
The error is in the autoload declaration suggested by the library. It does not include the interactive flag to tell Emacs that it is a command (interactive function), and only commands may be invoked via M-x.
The corrected declaration is:
(autoload 'dirtree "dirtree" "Add directory to tree view" t)
I've tried to load it on my machine. It seems that dirtree requires a second module called tree-mode (which I don't have installed). Did you install that one too? If not, you may have the same error.
By the way, you shouldn't have to add ~/.emacs.d to your load path; I'm reasonably sure it's there by default.
Related
I want to use "ediprolog" package on Emacs. I followed installation and usage instruction here https://www.metalevel.at/ediprolog/ and he says:
The two most important configuration options are:
ediprolog-system, either scryer (default) or swi
ediprolog-program, the path of the Prolog executable.
So I tried C-X , customize-group , ediprolog and checked the configuration file. The files looks like this:
To be honest I have no idea how, where can I edit to add the prolog executable path ~/.cargo/bin/scryer-prolog. In addition, Emacs says You can't edit this part of the Custom buffer when I tried to type something on the file.
And as I can expected, when I run ediprolog-dwim, "view-echo" says ediprolog-run-prolog: No prompt from: scryer-prolog, probably because I don't set the path on a configuration file.
I'm noob to Emacs and the package also, sorry about that, but I'm really struggling to achieve this step. Your comments must be really helpful for me. Thanks.
Try adding the path to the exec-path variable in emacs: when emacs forks off a subshell, this variable is added to the PATH that is passed to the subshell:
(add-to-list 'exec-path (expand-file-name (substitute-in-file-name "$HOME/.cargo/bin")))
It's probably very easy but I simply can't get a running scheme REPL in emacs.
First I installed MIT scheme and added
(setq scheme-program-name "my/path/to/bin/mit-scheme.exe")
to my init.el. But when I typed M-x run-scheme RET I got the error
Required feature ‘scheme’ was not provided
So I installed quack and added (require 'quack) to my init.el
Now when I start emacs I get the same error:Required feature ‘scheme’ was not provided
Am I missing a step?
Update
Maybe it simply doesn't work under windows:
Running Scheme under gnu-emacs If you want to run Scheme as an
inferior process in gnu-emacs or xemacs (again, this is not an option
on Windows machines), then you'll need to:
Download the xscheme.elc file. This is a byte-compiled elisp file that tells emacs how to run and interact with MIT Scheme. (Source file
is xscheme.el in case you're interested.)
This file should replace the xscheme.elc file that comes with emacs. You'll have to find the appropriate directory on your system.
On my Mandrake Linux system, this is the directory:
/usr/share/emacs/21.3/lisp. (This step is not necessary if you are
running MIT/GNU Scheme from the CS department machines.)
Add the following line to your ~/.emacs file
(load-library "xscheme")
Source (from 2005): http://www.cs.rpi.edu/academics/courses/fall05/ai/scheme/starting.html
Following doesn't work either
Quick Setup
Here is the short list of instruction's for those of you who want to
get started in a hurry. An explanation of each step follows below.
Open up emacs (or any other editor) in you home directory.
Open up the file ".emacs" and add the following line: (set-variable (quote scheme-program-name) "stk")
Save the file. You only need to do steps 1-3 once. If you were editing the file in Emacs, restart Emacs.
Start up Emacs and type the following sequence of keys:
M-x
run-scheme
A new buffer will open up with stk started inside of it.
Source: http://www-users.cs.umn.edu/~gini/1901-07s/emacs_scheme/
The error "required feature scheme was not provided" means that the first "scheme.el" found in your load-path does not contain a provide statement. Either your Emacs installation is broken (unlikely), or (more likely) you've installed some random scheme.el that hides the default one. Find it and remove it. Eg try M-x list-load-path-shadows.
I'm trying to setup emacs to be my GO IDE by following this tutorial with this code . I'm running into problems when I have to have emacs generate a file
From within Emacs, run M-x update-file-autoloads, point it at the go-mode.el file and tell it to generate a go-mode-load.el file.
I get this error when I enter the path of the file (location ~/.emacs.d/go-mode/go-mode.el)
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I did a locate on this file and see I do have it but not at the path specified path above
$ locate loaddefs.el
/usr/share/emacs/23.3/lisp/loaddefs.el
...
If I had to guess I would say some kind of path problem. Do I have to set a path variable somewhere?
I installed emacs through apt-get install emacs23
I'm on Ubuntu 12.04
Thanks
EDIT
The process I'm doing to get the error.
M-x update-file-autoloads Enter
Update autoloads for file: ~/.emacs.d/go-mode/go-mode.el Enter
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I had the same problem and finally got it working. Open your scratch buffer (or any other empty file) and type in the following two lines
(setq generated-autoload-file "~/.emacs.d/go-mode/go-mode-load.el")
(update-file-autoloads "~/.emacs.d/go-mode/go-mode.el")
Then evaluate both lines by putting the cursor at then of each line and type in C-x C-e to evaluate the line before the cursor. Do this for both lines. Then make sure to open go-mode-load.el and save the buffer - apparently emacs does not do this by default.
Once you've done this you can continue to follow the instructions at http://www.honnef.co/posts/2013/03/writing_go_in_emacs/
Disclaimer: I am sure there is a better way to do this and lisp experts will shriek at my answer. I have no clue about lisp and how to use lisp in emacs. I just did an informed guess :-)
Just recently hit this while attempting to get go-mode.el set up on my raspberry pi. Luckily, I had already generated a go-mode-load.el file successfully on my Mac and was able to take a look at that.
In there I saw this comment:
;; To update this file, evaluate the following form
;; (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads "go-mode.el"))
So I cd'ed into the directory where I had downloaded go-mode.el, then touched a new file called go-mode-load.el, opened it up in emacs, pasted in that line of code, evaluated it with C-x C-e and it worked like a charm.
EDIT
Wasn't able to get the generated file working until I added these lines to the end. As of writing this I haven't taken the time to figure out why they are needed but adding them fixed the problem:
(provide 'go-mode-load)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; go-mode-load.el ends here
(Not an answer, but needs formatting)
Is there a local definition of `generated-autoload-file' in go-mode.el? If so, it will write there, so you need to remove that line.
;; update-file-autoloads docs
update-file-autoloads is an interactive compiled Lisp function in
`autoload.el'.
(update-file-autoloads FILE &optional SAVE-AFTER OUTFILE)
Update the autoloads for FILE.
If prefix arg SAVE-AFTER is non-nil, save the buffer too.
If FILE binds generated-autoload-file' as a file-local variable,
autoloads are written into that file. Otherwise, the autoloads
file is determined by OUTFILE. If called interactively, prompt
for OUTFILE; if called from Lisp with OUTFILE nil, use the
existing value ofgenerated-autoload-file'.
Return FILE if there was no autoload cookie in it, else nil.
Checkout the actual installation instructions from the go-mode-el GitHub webpage. It looks like there have been some changes which are not reflected in the tutorial.
Just try to either use ELPA or follow the manual instructions:
(add-to-list 'load-path "/place/where/you/put/it/")
(require 'go-mode-autoloads)
I'm new to Emacs. I recently got a dot-emacs configuration from GitHub. Cloned the repo in my home directory as .emacs.d
This is for setting up a clojure environment. When i open Emacs and enter
M-x nrepl-jack-in, the minibuf displays 'No Match'
What am I doing incorrectly? Thanks!
It's possible that nREPL isn't being loaded. Add the following to your init.el:
(autoload 'nrepl-jack-in "nrepl" nil t)
You should be able to run it now with M-x nrepl-jack-in.
If the command doesn't work you'll need to do some troubleshooting.
make sure that nREPL is actually installed. You'll need both the Emacs library and the nREPL server.
check for any errors during startup. Launch Emacs from the terminal using the --d flag:
emacs --d
You will get a backtrace if anything goes wrong during the startup.
verify that your init.el is actually being loaded. Add the following code to the end of your init.el and restart Emacs.
(message "---> LOADED")
This will show in your *Messages* buffer if everything is being loaded.
Edit:
Looks like your init.el isn't being loaded. Check your home folder for files called .emacs or .emacs.el, which might be getting loaded instead.
Otherwise it could still be a path issue. Open a terminal and make sure this is the file you expect:
less ~/.emacs.d/init.el
I installed dired+ through list-packages (the folder was put in the elpa folder), and put '(add-to-list 'load-path "~/.emacs.d/elpa/")' in my init file (which I created myself), and '(require 'dired+) under. When I open emacs, I get an error telling me there's an error in my init file. If I remove the '(require 'dired+) line, the error stops, but again dired+ doesn't work when I call dired mode. The actual folder that was downloaded when I installed it is 'dired+-20130206.1702'. So I tried '(require dired+-20130206.1702), which again gave me an error on startup.
I'm at my wits end. I've tried everything I can think of, gone through the GNU emacs docs, googled the problem, looked at the answers here at Stack, and no luck. Does anyone have any suggestions? I'm using Windows XP.
It's impossible to say for certain without seeing all the code, but you appear to be quoting your forms for no reason.
i.e., these:
'(add-to-list 'load-path "~/.emacs.d/elpa/")
'(require 'dired+)
should be:
(add-to-list 'load-path "~/.emacs.d/elpa/")
(require 'dired+)
However that should just make them ineffectual, rather than causing errors directly.
Show us the code and the error message.
Edit:
Adding the /dired+/ to the end seemed to fix it ... Although I have no idea why. Any thoughts?
load-path holds a list of directories in which Emacs will look for libraries. It does not automatically descend into sub-directories, so you need to specify all relevant directories for your libraries. Your dired+ library is clearly in the ~/.emacs.d/elpa/dired+/ directory.
For menubarplus, you will similarly need to check to see which directory the library is in.
To be honest, I had thought that the package management in Emacs 24 would take care of this automatically; but as I've not been using it, I'm not certain.
Edit 2:
Yes, I suspect you have some other problem here. I just experimented with installing a library via the package manager (albeit from the default package repository, which doesn't include a dired+ package), and after restarting Emacs load-path contained the path for the new library without any intervention on my part.
I think Phils answered your question wrt loading Dired+ (specify the right directory, the one where you put dired+.el).
Wrt Menu-bar+, the feature name is menu-bar+, not menubarplus and not menu-barplus. So change your (require 'menubarplus) to (require 'menu-bar+).