Setting Racket Geiser Emacs Path - emacs

I'm trying to get Geiser's REPL to work in Emacs, but it doesn't seem to be able to find Racket.
racket is on my path, but anytime I type
run-geiser
followed by
racket
it complains:
Unable to start REPL: Searching for program: no such file or directory, racket
I read in the Geiser docs that I may have to manually tell Geiser where to find racket, but I can't tell where to configure this property of Geiser.
Thanks for your help.

Ok, so I added:
(setq geiser-racket-binary "/home/user/racket/bin/racket")
to my .emacs file after loading geiser.el.
I was expecting a configuration file somewhere to set this.
Thanks.

I know this is an old question, but for future people having a hard time getting it to find the Racket executable despite it being in your path, you can simply use the executable-find function.
This searches your path and returns the absolute path to the executable, which is what the geiser-racket-binary function wants. So this is an alternative to explicitly setting the absolute path:
(setq geiser-racket-binary (executable-find "Racket"))

In Windows, adding the location of the Racket executable to the "path" environment variable which is part of Windows will allow Geiser/Emacs to find the Racket Executable.

Related

How to set executable path for a package on a configuration file on Emacs?

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")))

Emacs: using geiser and Racket

My .emacs file contains this line of code:
(setq geiser-racket-binary "C:/Program Files/Racket/Racket.exe")
My steps:
M+x run-geiser
Select racket
I get errors, "Searching for program: No such file or directory, Racket.exe"
Getting this to work has been a hassle and, maybe at this point, I am just missing something ridiculously easy, but I am just not seeing it.
Picture of my error messages and file path
I am using a PC.
Without getting a chance to look at your PC and see if you if you actually have Racket installed at that location, I suspect the problem is that you are using forward slashes (/) rather than back slashes (\) in your path. Try changing the line to:
(setq geiser-racket-binary "C:\\Program Files\\Racket\\Racket.exe")
Another solution would be to use racket-mode to edit your files rather than Geiser. It seems to do a better job at editing Racket files in Emacs.

What to do if I cannot find my emacs init file?

I am trying to add haskell-mode to emacs by following these instructions:
http://doc.gnu-darwin.org/haskell-mode/installation-guide.html
This involves that I add some code to my ~/.emacs init file. However, my issue is that I cannot locate my emacs init file. I tried using find commands to locate it, as so:
find . -name "*emacs*"
find . -name "~/.emacs"
However none of these appear to be very successful, as I get either too many results, or no results.
So, given my situation, since I cannot locate my ~/.emacs init file, does this mean it does not exist? In that case, would it be smart to create one myself using the emacs editor? If so, are there any outstanding things I should know before attempting to create one?
C-x C-f ~/.emacs will take you to it.
See the Emacs manual, nodes Init File and Find Init.
To open your emacs init file, type M-: (find-file user-init-file) RET. If you only want to see its path, you can use C-h v user-init-file RET.
You can also create it yourself, if I'm not wrong installing emacs doesn't create automatically the file all the times. Just type in the terminal with your text editor (vim, vi, nano, etc) of preference:
vim ~/.emacs
And edit it the way you want :-)

Emacs, anything and the Everything search tool under Windows 7

I am struggling to get Everything working with anything in Emacs 24.3.1 on Windows 7. Ultimately I want to use anything-locate to browse code directories and subdirectories, as recommended in answers to this question. I did once, briefly, seem to have anything-locate working but I changed something and cannot get it back.
When I enter M-x anything-locate (or, using helm, M-x helm-locate) I get a pattern: prompt but when I enter a search term I get an error message like this:
Locate
'es' is not recognized as an internal or external command,
operable program or batch file.
I assume but do not know for sure that this is related to es.exe which is the command line version of Everything. In my init file I have this:
(add-to-list 'load-path "~/.emacs.d/.emacs.d/elpa/everything")
(setq everything-ffap-integration nil)
(setq everything-cmd "~/.emacs.d/.emacs.d/elpa/everything/es.exe")
(require 'everything)
...and I have edited everything.el so that the
(defcustom everything-cmd "c:/Programme/Everything/es.exe" "Path to es.exe."
line now reads:
(defcustom everything-cmd "~/.emacs.d/.emacs.d/elpa/everything/es.exe" "Path to es.exe."
(EDIT Please note that despite the "~/" convention used above, in reality the paths are fully qualified with c:/blah/blah/blah/.emacs.d/)
I expected this to allow Emacs to find es.exe. And yet it still throws the error message. Any thoughts on how to fix this?
I know this is old, but I found this question when I ran into the same problem with helm, so it might be useful.
The problem was a conflict between how emacs specifies PATH, and how windows does it (similar to juanleon's suggestion).
The solution was to remove all forms that modified the path in emacs, and instead just add es.exe to the windows path.
es.exe is an extra download at the bottom of the voidtools download page, below the old versions, took me a while to find.
It is possible that windows shell (whatever it is) does not know how to expand "~/" (even if emacs does understand it).
A very quick test would be to copy the es.exe in "c:\es.exe" and then repeat the test with the proper change in the configuration of everything-cmd; if it works then just use the whole path.

Emacs configuration for dirtree

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.