Required feature ‘scheme’ was not provided (scheme REPL in emacs) - emacs

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.

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

My .emacs.el file is not loading, how can I get it to load? [duplicate]

I tried looking for the .emacs file for my Windows installation for Emacs, but I could not find it. Does it have the same filename under Windows as in Unix?
Do I have to create it myself? If so, under what specific directory does it go?
Copy and pasted from the Emacs FAQ, http://www.gnu.org/software/emacs/windows/:
Where do I put my init file?
On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Windows Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called .emacs.d/init.el. Many of the other files that are created by Lisp packages are now stored in the .emacs.d directory too, so this keeps all your Emacs related files in one place.
All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:
If the environment variable HOME is set, use the directory it indicates.
If the registry entry HKCU\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates.
If the registry entry HKLM\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
If C:\.emacs exists, then use C:/. This is for backward compatibility, as previous versions defaulted to C:/ if HOME was not set.
Use the user's AppData directory, usually a directory called Application Data under the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.
Within Emacs, ~ at the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with C-x C-f ~/.emacs.
There's further information at HOME and Startup Directories on MS-Windows.
It should be stored in the variable user-init-file. Use C-H v user-init-file RET to check. You can also open it directly by using M-x eval-expression RET (find-file user-init-file) RET
Open the file like this in Emacs for Windows:
C-x C-f ~/.emacs
More information in the Emacs Wiki
On my Vista box it's in C:\Users\<USER>\AppData\Roaming\
Note that it may NOT be enough to just type Ctrl-x Ctrl-f ~/.emacs and create the file.
It may be that your Emacs application uses a different place to store your init file, and if so, then creating the file ~/.emacs simply creates a useless file which your Emacs application ignores.
Also, you may want to do more than just access the .emacs init file, but you may want to know where it is, i.e., its pathname.
To get at this there are two methods:
Easy way: type Ctrl + H V user-init-file Return
Slightly trickier way:
You can find out where your system is storing its own .emacs file by:
Click options and scroll down to "Set Default Font..."
Change the font setting and click okay
On the options menu, go down to "Save Options"
When the options are saved, the system saves its .emacs file,
and you can read the file path in the minibuffer at the bottom of the Emacs screen
In Windows 7 put your init.el file in C:\Users\user-name\AppData\Roaming\.emacs.d\, where user-name is your user/login folder.
Take care so your init.el file won't be named init.el.txt. This is something Windows does if you create your file with some editor like Notepad.
On versions of Emacs on Windows above 22, it seems to have moved to
~/.emacs.d/init.el
, ~ being the value of your environment variable HOME (see Control Panel → System → Advanced → Environment variables).
The file itself might not exist. In that case just create it.
You must create an emacs initialization file. One is not automatically created.
I had a similar issue and this answer tracks down what I did.
My issue was my ~/.emacs.el file was not loading. Strange because this has always worked for me.
This question/answer helped me but I had to put my init file in the %USERPROFILE%\AppData\Roaming\.emacs.d\init.el because this is apparently the default behavior on Windows.
To troubleshoot this, I ran the following in the emacs *scratch* buffer.
user-emacs-directory
"~/.emacs.d/"
When I saw user-emacs-directory was ~/.emacs.d, I simply moved my .emacs.el file to %USERPROFILE%\.emacs.d\init.el. But this still didn't work.
I continued with expand-file-name as shown below:
(expand-file-name user-emacs-directory)
"c:/Users/pats/AppData/Roaming/.emacs.d/"
Got to love how Windows works. (not) So I moved my emacs.el file to the %USERPROFILE%\AppData\Roaming\.emacs.d\init.el and this worked. The file was now being read. But I got other errors because my initialization file loaded other (personal emacs) files (in ~/myenv/emacs/*.el.
Warning (initialization): An error occurred while loading ‘c:/Users/pats/AppData/Roaming/.emacs.d/init.el’:
Hum... Seems like all my files ~/myenv/emacs/*.el would need to be moved in order for this to work but I didn't want to do that. Then I realized that because the HOME environment variable was not set, emacs was performing its default behavior.
SOLUTION
Once I set my windows HOME environment variable to %USERPROFILE% everything began to work like it has for the past 25 years. :-)
To set the HOME environment variable, I typed WindowsKey+"edit environment variables for your account" to open the Environment Variables dialog box, and entered HOME=%USERPROFILE%.
Now my emacs initialization file .emacs.el is is back to its rightful place $HOME/.emacs.el and not in %USERPROFILE%\AppData\Roaming\.emacs.d\init.el
To be fair, if Windows had just one place to put files for user installed packages the solution of making HOME=%USERPROFILE\AppData\Roaming might be acceptable, but because some applications use %USERPROFILE%, some use %USERPROFILE\AppData\Roaming and others use %USERPROFILE\AppData\Local it just makes it difficult to know where to find your configuration files.
I prefer having everything in my %USERPROFILE% or $HOME directory.
Another similar question was here:
Emacs init.el file doesn't load
As kanja answered, the path to this file is stored in the user-init-file variable (or if no init file exists, the variable contains the default value for where to create it).
So regardless of which of the possible init file names you are using, and which directory it is in, you should be able to visit your init file with:
M-: (find-file user-init-file) RET
Or display its full path in the echo area with:
M-: (expand-file-name user-init-file) RET
On Emacs 23 and Windows 7 it only works if you set:
HKCU\SOFTWARE\GNU\Emacs\HOME
After Emacs 27.1, emacs has started respecting the $XDG_CONFIG_HOME. The init file or the init directory can now be found in $XDG_CONFIG_HOME/emacs/init.el.
In Windows $XDG_CONFIG_HOME could translate to %LOCALAPPDATA%.
In any case you can use the following emacs variables to find out the location of the your initialization file by M-x eval-expression
user-init-file
or the emacs configuration directory
user-emacs-directory
I've found that Emacs 22 will occasionally open either "C:\Documents and Settings\username\Application Data\.emacs", or just "C:\Documents and Settings\username\.emacs" on my XP machine. I haven't found an explanation for why it occasionally changes it's mind.
~ will always point to whatever the current instance of emacs thinks is HOME, but kanja's tip (C-h v user-init-file) will always tell you what ~/.emacs actually maps to.
On Windows 8.1, if Emacs is started from Windows Explorer, a shortcut or from cmd console it uses C:\Users\<USER>\AppData\Roaming.emacs init file. When I start Emacs from PowerShell, Emacs looks for its init file in C:\Users\<USER> folder. The fix to this issue was to set the HOME user environment variable (Control Panel\System and Security\System->Advanced system settings->Advanced->Environment variables) to C:\Users\<USER>. After this change, no matter how I start Emacs, it uses the same init file (see the accepted answer of this question)
On Windows XP it's:
C:\Documents and Settings\yourusernamehere\Application Data\
There is a list of directories based on your Windows version and extra information:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html
For WIndows7& Emacs26.3:
if HOME environment is set, then the .emacs file should be in that folder.
otherwise, it should be in c:\.
In both cases, if .emacs is not there, _emacs should be used.
This is because we cannot create .emacs file according to the windows file naming rules.(but we can download or copy it from somewhere else).

emacs not picking up my init.el file on windows

I have my emacs.d folder located at:
C:\Users\<loggedin_user>\AppData\Roaming\.emacs.d
In this folder, I have my init.el file but it is not being picked up by emacs.
Is there another step I am missing, do I need to set an environment variable or something?
When I enter C-x d ~/ RET I end up at
C:\Users\<loggedin_user>\AppData\Roaming\
If I move the init.el file there, it is still not picked up. I have a deliberate error in the file that is not causing emacs to crash when it is opened.
Most likely you have an old ~/.emacs file somewhere else which Emacs ends up using in preference to the other one.
You probably want to check the value of user-init-file which will tell you which file Emacs ended up using as "the ~/.emacs file".
I suggest you report this as a bug, requesting that when several files are found as possible init file, Emacs should not just pick the first and ignore the others but should at least emit a warning about the fact that it ignored the others.
This is tricky on Windows 10 but I solved since I was suffering from same issue.
I created an Environment Variable called HOME with the path C:/user/<username> in the box "User variables for " create a new one
Just open with double click any file that is by default opened with Emacs and it will take few seconds to load then take changed on the init.el
create an init.el with just one line of code like:set-background-color "honeydew"
to test this, first before doing something more complex.
Hope That It Helps!
On Windows, Emacs is started with some Properties defined, found when you right-click the executable on your windows system. There you can define the
execution-directory, e.g. "C:\Users\loggedin_user\" (in parantheses)
where emacs executes
and looks for the .xemacs (.emacs) directory, where it find its init.el. (I had to create an .emacs File in my Windows Home Directory, which is defined in the Windows HOME Environment)
And where you can define the startup instructions (like (setenv "HOME" "c:/Users/Username/") ) etc.
If you configure that, the next time, emacs starts from the directory, you defined, with the initialisation-file
Windows 10 and Emacs 27.1 could not find .emacs.d: one more possibility, in my case %HOME% was set like HOME=%HOMEDRIVE%%HOMEPATH%. This redirection seems not to work and emacs was using literally C:\Users\<loggedin_user>\%HOMEDRIVE%%HOMEPATH% for searching .emacs.d. I did not dare to edit %HOME% but created link:
C:\Users\username> cd %HOME%
You perhaps need to remove some files in C:\Users\<loggedin_user>\%HOMEDRIVE%%HOMEPATH% which emacs already created.
Create link:
C:\Users\<loggedin_user>\%HOMEDRIVE%%HOMEPATH%> mklink /d .emacs.d ..\.emacs.d

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 update-file-autoloads failing

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)