Update
Apparently, the auto-complete package is not the culprit.
Emacs fails to download melpa archive.
A quick google search indicates that this is a reappearing problem both on windows and unix machines.
As there are already threads concerning failed to download 'melpa' archive (none of which helped unfortunately) this thread may or may not be closed.
Inital Question
I'm trying to set up emacs for Common Lisp.
I installed sbcl and the slime package.
Some time ago I used to have auto completion for Common Lisp keywords in emacs such that - while typing - it suggested a word via a greyed out completion (TAB for acceptance) or via drop down or both. (I can't remember exactly.)
I'm struggling to get this working again.
At https://github.com/purcell/ac-slime it is suggested to first install auto-complete but when I type package-list-packages there is no such package. (But there are plenty named auto-complete-*).
(I set up Melpa with:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/")))
The provided link http://cx4a.org/software/auto-complete/ is dead as well.M-x install-package [RET] auto-complete [RET] also fails. Emacs says: [No match]
So my question is:
If there is no auto-complete package anymore, what is a good way to set up Common Lisp auto completion in emacs in the way mentioned above (greyed out word or dropdown)?
The current home-page for auto-complete is https://github.com/auto-complete/auto-complete
Installing it should be enough to allow you to use ac-slime (there is also a completion version using company).
Here is how I got it to work.
Download the .ZIP archive with repository here.
Unzip
Run M-x package-install-file
On the prompt, specify the path to the downloaded repository and the file named auto-complete.el.
Make sure that installation returns something along the lines of "Successful"
Add this line to your Emacs initialization file (.emacs):
(ac-config-default)
To auto-complete in SLIME, follow similar step to install ac-slime (requires SLIME and Auto-complete)
P.S. There is another package called company (stands for Complete Anything), which is quite good as an alternative. I am trying it out now. Getting it to work was very simple.
Related
I am trying to learn common lisp and following the installation process from https://lisp-lang.org/learn/getting-started/
The website says to add something to my ~/.emacs file, but I do not find it. Does someone now where I can find that?
enter image description here
Seems like you want to install a custom slime to use Common Lisp on Linux. Maybe one should install it from a given distribution, it would be easier.
I would suggest the following steps:
1. Setup Emacs to use MELPA repository:
M-x customize-variable
Customize Variable: package-archives
Then, simply add melpa with the URL https://melpa.org/packages
Then press the button Apply and Save.
2. Install slime from the package manager
M-x list-packages
Search for slime, press i for install and then press x to proceed. You should have a proper version of slime installed.
3. Happily hack Common Lisp!
EDIT:
I missed this installation method that you probably followed. In this case, I believe that the init directory has a typo and is missing a dot (.)
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
^
\---- HERE
(setq inferior-lisp-program "sbcl")
My ultimate goal is to get magit working again with Emacs 27.1 on openSUSE Tumbleweed, but the problem ahead of that is getting (melpa?) package management working - so that is really what this post is about. I run into these problems with other packages; magit is just the example, because want teh awesome. I had not installed any packages recently with Emacs 26.3, but my assumption is that it was OK. Magit was certainly working.
Attempt is to start from bare wood:
rm .emacs
rm -r .emacs.d
Need melpa to get magit, so I create a new .emacs with only this inside:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
Restarting emacs, the package-list command shows a ton of melpa stuff in there (yay!). Including magit!
So I install that (version 20200820.227) by clicking on the Install button, then "Yes" when it asks for confirmation. Here is what happens at the end of the "Messages" buffer:
Wrote /home/tcarroll/.emacs.d/elpa/magit-20200820.227/magit-autoloads.el [2 times]
Loading async...done
Contacting host: melpa.org:80
error in process sentinel: async-handle-result: End of file during parsing
error in process sentinel: End of file during parsing
At this point magit is "installed" - and magit-status even works. But if I restart Emacs, running magit-status results in:
load-history-filename-element: Wrong type argument: stringp, (require . info)
...and I don't actually get any Git status.
Some output I get that I don't recall ever getting when starting Emacs 26.3:
Warning: game dir '/var/games/emacs': Permission denied
Loading loadup.el (source)...
dump mode: nil
Using load-path (/usr/share/emacs/27.1/site-lisp /usr/share/emacs/site-lisp /usr/share/emacs/27.1/lisp /usr/share/emacs/27.1/lisp/emacs-lisp /usr/share/emacs/27.1/lisp/progmodes /usr/share/emacs/27.1/lisp/language /usr/share/emacs/27.1/lisp/international /usr/share/emacs/27.1/lisp/textmodes /usr/share/emacs/27.1/lisp/vc)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/byte-run...done
Loading emacs-lisp/backquote...
Several screenfuls of "Loading" this and that; I can include more if helpful. My speculation is that this has something to do with the new portable dumper?
There are a great many clean-shaven yaks in my vicinity (and the rest are scared). Trying to keep this from getting too long.
Adding new info at request:
openSUSE Tumbleweed update today to emacs. Still at version 27.1 but dated today:
GNU Emacs 27.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0) of 2020-08-25
Toggled on debugging via toggle-debug-on-error. Installation behavior nothing new, unfortunately; still
async-handle-result: End of file during parsing
Again, thanks for any help!
Turns out the /usr/bin/emacs is a script not a binary (old news to most of you, I'm sure) and it decides between different ways of invoking Emacs. For me, the key thing is that at the end it does this:
exec -a emacs /usr/bin/emacs-gtk
which causes Emacs to emit lots of messages about "Loading" this and that, including loadup.el, and finally not work properly with regard to packages (Org and Magit both affected, probably others).
When I invoke this instead:
/usr/bin/emacs-gtk
...I don't see any of those "Loading" messages. And Magit and Org both work fine.
From my limited understanding of this "exec -a" thng it seems that there "should" not be this difference in behavior, so maybe it is some dumb thing in my environment that I overlooked. But stuff works now.
I am new to emacs and am looking for an emacs package that supports multiple cursors a'la sublime. I have tried to install magnars/multiple-cursors but without success. I can't even install the package directly. The following code does not work for me .
M-x package-install multiple-cursors
(emacs says no match, but in the ~/.emacs.d/elpa/archives/marmalade/archive-contents file, I can find references to that package.)
I have the required repositories in init.el and also run M-x package-refresh-contents
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
I then installed the package via a package that requires it (in my case I installed clj-refactor, this brings in the dependency to multiple-cursors. When I eval (require 'multiple-cursors) I get the following error
File error: Cannot open load file, no such file or directory, multiple-cursors
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.
This is strange because in the folder ~/.emacs.d/elpa/multiple-cursors-20141026.503 contains the file multiple-cursors.el
I got very used to that sublime feature and would really appreciate to use multiple cursors in emacs. Has anyone has a similar problem with the mentioned package or knows how to solve it? A link to a similar package would also be appreciated.
Thank you
Edit:
I Use emacs for mac v24.3.1
Edit:
I have just noticed that I don't need to eval (require 'multiple-cursors). The package is indeed installed (via the dependency) and I use it, great! The question remains why I can't directly install it.
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+).
I install el-get by typing this into my buffer, highlighting, and hitting C-j:
(url-retrieve
"https://raw.github.com/dimitri/el-get/master/el-get-install.el"
(lambda (s)
(goto-char (point-max))
(eval-print-last-sexp)))
...according to the installation documentation.
I can then install things using M-x el-get commands. Great so far.
However, when I close emacs and restart, M-x el-get cannot be found, nor can any of the packages I installed with it. When I try to reinstall el-get in the method above, installation says the git package already exists:
fatal: destination path 'el-get' already exists and is not an empty directory.
I can delete the el-get directory in my emacs.d/ folder and get back to the beginning, but can't seem to get el-get to stay installed beyond the first time. What am I missing or misunderstanding?
Also---I'm only using el-get in the first place to be able to install auto-complete for using emacs for python development. If you have an easier or better easy-installation recipe for that, I'd appreciate that suggestion, too.
(Never used el-get myself, but...)
a) You should add the code from one of the examples in the Basic Setup section. It includes forms like (add-to-list 'load-path ...) and (require 'el-get ...), which are more or less essential for loading Emacs packages.
b) You can just as well install auto-complete from Marmalade or Melpa. I think this is the recommended option if you're using Emacs 24. Add at least one of the repositories to package-archives, press M-x list-packages RET, look for auto-complete, press i, then x.