Setting up Vala mode on Emacs - emacs

I'm trying to set up a mode for editing Vala in Emacs. I've only found these instructions, and it seems that (for the first case with packages) marmalade no longer carries vala-mode, and for the second, csharp-mode always fails to compile when I try to install it! What should I do?

I just confirmed that vala-mode is not included in the marmalade archive, despite the link above. To work around this, from within M-x eshell execute:
$ wget http://marmalade-repo.org/packages/vala-mode-0.1.el
$ package-install-file vala-mode-0.1.el
package-install works with the network automatically, but package-install-file, and package-install-from-buffer are also available.
Of course this solution will not download it automatically going forward, so you should contact Marmalade maintainers to determine why it's not listing it in the archive, or possibly submit it for inclusion in Melpa.

Another useful thing you can do is install and configure an LSP language server. I've had some success with https://github.com/Prince781/vala-language-server.
You can then install lsp-mode (https://github.com/emacs-lsp/lsp-mode) and lsp-ui (https://github.com/emacs-lsp/lsp-ui) for Emacs.
And then create a compile_commands.json file for your Vala project. E.g.
[
{
"directory": "/home/user/projects/example",
"command": "/usr/bin/valac /home/user/projects/example/main.vala",
"file": "/home/user/projects/example/main.vala"
}
]
I haven't found an automatic way of doing this. But it's possible you could use CMake. CMake is definitely capable of generating a compile_commands.json. You would just need to describe your Vala project in a CMakeLists.txt file.
Then you add (lsp) to your vala-mode-hook:
(add-hook 'vala-mode-hook #'(lambda () (lsp)))

Related

Emacs OSX 10.13 configuration issue

Recently I pass to Emacs org because is really convenient to me to write note there.
So I installed all packages I needed (principally ORG and EVIL) but I didn't understand how to setup everything.
I installed emacs from brew without using cask, I linked it, and I'm sure that I'm using the version that I installed (26.1).
So in my ~/ folder I have a .emacs file in which I set up evil mode, and I have a /.emacs.d/ in which I have a lot of file. The problem is: whatever I wrote in a ~/.emacs.d/init.el seems doesn't effect emacs.
So I said "whatever, I'm going on github and I installed some complete configurations and then I customized them myself". I tried to install these two configurations.
https://github.com/hrs/dotfiles
https://github.com/larstvei/dot-emacs?files=1
But for some reason, after doing exactly what they say on README.org
nothing happens.
In particular the second link, after install and open emacs said I need to have ~/.cask/.cask.el but I don't have it.
Advice?

Common Lisp auto completion in emacs

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.

Emacs 21 C/C++ auto-complete mode

I am working on a server which uses a really old emacs. The only way to install plugins is by downloading the .el files and adding them to the ~/.emacs/ folder and then sourcing it from the main .emacs file. Would someone know of a C/C++ autocomplete plugin which works with Emacs 21? I tried auto-complete-mode but I get an error.
An error has occurred while loading `/home/sbhalla/.emacs':
Symbol's function definition is void: defvaralias
The same auto-complete-mode works fine on emacs 22.
You might be able to run Emacs 24 without root access:
Download and untar Emacs 24: http://gnu.mirror.iweb.com/emacs/emacs-24.5.tar.gz
./configure && make. It may tell you to disable some options, e.g. I had to compile ./configure --without-jpg --without-png
You should be able to run ./src/emacs
I've done this to get the latest version of Emacs on university machines without sudo access, so it could probably work for you too.

Web-mode does not load in emacs

I'm pretty new to emacs and I'm currently trying to configure it properly for my needs, but I can't make it load web-mode at all.
So, this is what I've done:
Downloaded web-mode.el from GitHub
Made sure the file is located in the correct directory: ~/.emacs.d/web-mode.el
Used the installation instructions from the official page
My .emacs file now looks like this
Issue:
When I'm trying to edit any of the file types specified in the .emacs file, it only runs the default modes. PHP Abbrev for PHP etc... I'm not receiving any error messages and when I'm running --debug-init it does not give any output.
Emacs version: GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9) of 2012-03-01 on sl6.fnal.gov
OS: Scientific Linux
Does anyone know how I can troubleshoot this further, or have solved similar issues?
You should let el-get install it for you. El-get is a package manager for emacs. It can install packages from github, emacswiki, elpa, an url, … http://wikemacs.org/index.php/El-get
It's very handy, you can update scripts easily, it manages dependencies, it lets you discover many stuff, you can easily share your config accross machines, etc.
Emacs 24 has package.el or ELPA by default. One can install it on emacs 23, but my experience isn't conclusive so I'd advise sticking with el-get, which is great.

Emacs + GDB + SCons + Step through Debugging

When compiling a project via a makefile using the Emacs compile command, when gdb is run on the resultant binary the application can be stepped through. However, when building using a large project with SCons, attempting to step through does not work in that Emacs doesn't seem to know which files to load or how they're related to the binary.
What does one have to do to do step through in Emacs? If Emacs can't support SCons natively then how can this be done manually; make must be using some mechanism to alert Emacs to a file's presence.
Are you sure your make and scons compile options are the same? It sounds like your scons build is lacking debug symbols (in gcc, use the -g option).
I don't use Scons. I can't help but ask if you have done the Scons IDEIntegration as given in the Working within Emacs and XEmacs section. It says Scons builds in a different directory that Emacs does not look at by default, so you have to move the files to make Emacs look at them. But that is for navigating through build error messages. I hope it works for gdb too.