28 votes

Using Emacs as a full-featured C/C++ IDE

Different levels of "IDE-ness" exist for different languages, and unfortunately you're never going to get full IDE features without some configuration (if you don't like configuring things, you ...
user avatar
  • 4,968
26 votes
Accepted

Compile emacs from feature/native-comp (gccemacs) branch on Ubuntu

I could get it to work with Ubuntu 18.04 and 20.04. This is the recipe I used. sudo apt install libxpm-dev libgif-dev libjpeg-dev libpng-dev libtiff-dev libx11-dev libncurses5-dev automake autoconf ...
user avatar
17 votes
Accepted

Recursively go up to find Makefile and compile

You are looking for the function locate-dominating-file. Here is the emacs documentation for this function: (locate-dominating-file FILE NAME) Look up the directory hierarchy from FILE for a ...
user avatar
  • 2,270
16 votes
Accepted

What Emacs feature is nearest to Vim's quickfix?

Compilation Mode does the same thing and is built-in. Here is a demo. Basic usage: M-x compile to run the compilation command (like :make) The command is taken from the variable compile-command (like ...
user avatar
  • 6,672
16 votes

Using Emacs as a full-featured C/C++ IDE

I used this guide to get started using Emacs as a C++ IDE. It introduces Helm and Projectile which help answer a number of your questions. To wit, Projectile manages projects. It searches up the ...
user avatar
15 votes

Hide *compilation* window

Looking quickly at the code (in library compile.el), you should be able to just kill or hide the displayed buffer by using a function on hook compilation-finish-functions. To do that, use something ...
user avatar
  • 69.6k
14 votes
Accepted

How do I declare a variable ignorable?

The way I've done that so far is to add a call of the shape (ignore <var>) This function call will be optimized away, but before that the compiler will still count it as a use, so the "unused" ...
user avatar
  • 25.3k
11 votes
Accepted

Hide *compilation* window

years ago on the #emacs IRC channel I got this bit of code I've been using forever. The value "2 sec" sets the amount of time the successful compilation window stays visible. ; from enberg on #emacs (...
user avatar
  • 360
10 votes

Using Emacs as a full-featured C/C++ IDE

Since you are asking for a full-featureed C/C++ IDE now, I might be qualified. I used all MS IDEs from vc4 to Visual Studio 2010, so I fully understand what you want. The good news is that Emacs ...
user avatar
  • 4,611
8 votes

Where to find missing dependencies (imagemagick and m17n)

After crawling the configure script, I think I have found your missing packet: libmagickwand-dev. On my machine, after installing this packet, ./configure finally says: Does Emacs use imagemagick? ...
user avatar
  • 213
8 votes
Accepted

Jumping to the first error -- not warning -- when compiling

As described on this blog post, you need a second option for that. compilation-skip-threshold (setq compilation-skip-threshold 2) Compilation motion commands skip less important messages. The ...
user avatar
  • 22.4k
8 votes

Compile Emacs with xwidgets in Ubuntu 14.04

For emacs-26 on ubuntu, the required package for --with-xwidgets is libwebkit2gtk-4.0-dev. Found in comment here, confirmed by experience.
user avatar
  • 91
6 votes
Accepted

How can I customize the compile command?

You can customize the variable compile-command to change the compilation command that is used by default: (setq compile-command "make package install")
user avatar
  • 14.2k
6 votes

Press F5 to save, compile, and run current rust file

Below is one approach for Windows. If you're in a rust project, it'll run cargo run. Otherwise, it'll use rustc. (defun rust-save-compile-and-run () (interactive) (save-buffer) (if (locate-...
user avatar
  • 1,132
6 votes

Where to find missing dependencies (imagemagick and m17n)

To avoid having to track down the packages that are required to build Emacs, use apt-get to install them for you. apt-get build-dep emacs Actually this may not be enough, as this just installs the ...
user avatar
  • 24.3k
6 votes

Recursively go up to find Makefile and compile

Recursive compile, no dependencies attached: (defun desperately-compile () "Traveling up the path, find a Makefile and `compile'." (interactive) (with-temp-buffer (while (and (not (file-...
user avatar
  • 13.6k
6 votes

How can I pin the *compilation* buffer to never leave a single frame/window

Normally, Emacs considers the selected frame the only reusable frame. In other words, normally Emacs only searches the current ("selected") frame for windows that already contain the buffer-to-display ...
user avatar
  • 1,683
6 votes
Accepted

AUCTeX: how to compile a file, which does end in '.ins'

Known extensions to AUCTeX are controlled by the variable TeX-file-extensions: TeX-file-extensions is a variable defined in ‘tex.el’. Its value is ("tex" "sty" "cls" "ltx" "texi" "txi" "texinfo" "...
user avatar
  • 1,603
6 votes

Compile emacs from feature/native-comp (gccemacs) branch on Ubuntu

Ubuntu 20.04 WSL works just fine now with default ppas. # emacs-native git clone git://git.savannah.gnu.org/emacs.git && cd emacs git checkout emacs-28 export CC=/usr/bin/gcc-10 CXX=/...
user avatar
  • 61
5 votes

What are the advantages of building Emacs from source?

Deploy different versions of Emacs at the same machine (for Emacs plugin development) If your OS is too old and you are not a super user, install the latest stable Emacs at your $HOME is the only ...
user avatar
  • 4,611
5 votes

Press F5 to save, compile, and run current rust file

Here my version of compile: (global-set-key (kbd "<f5>") (lambda () (interactive) (save-buffer) (...
user avatar
  • 6,672
5 votes

Using Emacs as a full-featured C/C++ IDE

For #4, I highly recommend exuberant-ctags and the built-in tags support, which I have used for years. Alternatively, I just recently have switched to using GNU Global and the ggtags package and have ...
user avatar
  • 1,925
5 votes

How can I pin the *compilation* buffer to never leave a single frame/window

Make buffer compilation always have a dedicated window. One way to do this is to customize option special-display-buffer-names, to include "*compilation*". Another is to customize option special-...
user avatar
  • 69.6k
5 votes

Binding compile command to a key for c++ code

You need to do two things: 1. Bind compile to a key (like f5) 2. Change the command that compile runs. To do the first add (define-key c++-mode-map [f5] #'compile) to your .emacs. This sets the key ...
user avatar
  • 12.1k
4 votes

Using Emacs as a full-featured C/C++ IDE

Management of software "projects." I want my IDE to have a sense of all of the files that make up my current project so that I can perform functions like search-and-replace within my project. (It ...
user avatar
  • 7,288
4 votes

Does your project use Elisp for build automation?

I had a similar idea once, but honestly? there are quite a few things that a proper build system needs, and which will require quite a lot of work. One thing you want is memorizing things you've ...
user avatar
  • 10.9k
4 votes
Accepted

Close latex compilation window when successful

The *compilation* buffer has nothing to do with LaTeX. You mean the process output buffer of LaTeX. You can use the following lisp code to delete the buffer window when there are no LaTeX errors. ...
user avatar
  • 30.3k
4 votes

How can I compile and run my C code from within Emacs like I would with the terminal?

I use the compile command, and also add a run target to my makefile like this program: program.cpp gcc program.cpp -o program run: program program So you can just use make run to compile ...
user avatar
4 votes

Compile emacs from feature/native-comp (gccemacs) branch on Ubuntu

In my case, I'm in debian stable with the version 8.3.0 and had no trouble installing it, maybe you can try to downgrade gcc and install libgccjit-8-dev. Good luck!
user avatar
  • 625
3 votes
Accepted

Why are my compilations executed in the parent of `default-directory`?

The value of default-directory has to end with a slash.
user avatar
  • 24.3k

Only top scored, non community-wiki answers of a minimum length are eligible