Skip to main content
Share Your Experience: Take the 2024 Developer Survey
27 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 ...
Swarnendu Biswas's user avatar
11 votes
Accepted

How does Emacs compile the regular expressions?

Emacs' regexp implementation caches previously used patterns in compiled form (20 of them, last time I looked). This is not a detail you should rely on too much. (while (re-search-forward rx nil t) ......
rpluim's user avatar
  • 5,315
9 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.
msw1520's user avatar
  • 101
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" "...
Arash Esbati's user avatar
  • 1,975
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 ...
bmag's user avatar
  • 1,713
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=/...
sanblch's user avatar
  • 61
5 votes
Accepted

emphasise the current error in the *compilation* window

I wanted to achieve the same thing as it was often painful to find the current error message in the compilation buffer. This solution is based on Drew's suggestion to use a next-error-hook to ...
erjoalgo's user avatar
  • 873
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 ...
erikstokes's user avatar
  • 12.9k
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-...
Drew's user avatar
  • 77.9k
4 votes
Accepted

Compiling Emacs from source on Ubuntu - problems with libxml2

This problem was caused by pkg-config being installed in two places. Once by apt, the other time by Linuxbrew. The path was finding the Linuxbrew pkg-config copy first, which was configured to look ...
ocodo's user avatar
  • 1,222
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. ...
Tobias's user avatar
  • 33.2k
4 votes
Accepted

emacs home made perspective: source + eshell + compilation

Here is a bare-bones minimum viable function, which I hope does what you want. (defun wjh3pane-create-3pane-layout () "Create 3-pane layout of windows in the current frame. Layout is as follows: ...
deprecated's user avatar
  • 2,835
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 ...
Ian4264 's 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!
Fermin MF's user avatar
  • 635
3 votes
Accepted

Dedicated compile hook on compilation finish

rgrep and similar use compile, this is why hooks in compilation-finish-functions are triggered. When rgrep successfully completes its message is "finished\n". You must take this into consideration ...
sshaw's user avatar
  • 200
3 votes

Compiling Emacs from source on Ubuntu - problems with libxml2

I've just solved the same problem, trying to install Emacs 25.1.rc1 on Ubuntu 15.10, by installing: apt install libxml2-dev before calling ./configure.
Nsukami _'s user avatar
  • 6,531
3 votes

Compile Emacs with xwidgets in Ubuntu 14.04

Emacs switched from webkit1gtk to webkit2gtk so you'll need to install that instead. Your GTK package should be fine. PS: I agree with the linked article, although I wouldn't put it this drastically....
wasamasa's user avatar
  • 22.2k
3 votes

Compile and run C-Programs in Emacs

Since you are using Org-mode and all you want (according to your post), is to evaluate small C code examples, I'd use ob-C and just evaluate everything using org-babel. This is not an answer on how ...
Daniel's user avatar
  • 3,653
3 votes
Accepted

compilation-mode: default-directory != src-root

At first I give a recipe for reproduction of your problem (hopefully I understood it right). Afterwards I will present a solution. Recipe for problem reproduction Put the following C++ source code ...
Tobias's user avatar
  • 33.2k
3 votes

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

As of 2022 using Ubuntu 20.04 with its standard gcc 9.4.0 allows compiling Emacs with native compilation support, as long as the appropriate libgccjit is installed: sudo apt install libgccjit0 ...
holocronweaver's user avatar
3 votes
Accepted

compilation sentinel: symbol's value as variable is void for quote, >, <, =, etc

You're missing parentheses around the interior of your cond expression. You also should not have the parentheses around the body forms of the condition (although this part is not what is causing your ...
D. Gillis's user avatar
  • 496
2 votes
Accepted

Compile from parent directory in Emacs

I think that you almost had it. I modified your original compile-project as follows: (defun compile-project () (interactive) (let* ((mk-dir (locate-dominating-file (buffer-file-name) "Makefile")) ...
Xaldew's user avatar
  • 1,231
2 votes
Accepted

Compile command as a directory variable?

The variable compile-command is not buffer local by default, thus you can not set it per buffer. To change this add the following to your init file: (make-variable-buffer-local 'compile-command)
theldoria's user avatar
  • 1,845
2 votes
Accepted

How can make emacs immediately compile a file I load?

You could add hook into init.el (add-hook 'find-file-hook (lambda () (when (string= major-mode "c-mode") (recompile)))) for c-mode to recompile it automatically ...
Konstantin Morenko's user avatar
2 votes
Accepted

Previous/next occur result, independently from compilation errors

Looking at the source of occur-mode, I found this: (setq next-error-function 'occur-next-error)) This suggests occur-next-error is the function next-error calls in a "occured" buffer. And indeed, ...
JeanPierre's user avatar
  • 7,475
2 votes

Source-Links in Compilation mode not working

After some tinkering, I was able to trace the problem to emacs wrongly recognizing the column in the trace output as the line number. All I had to do was add a new regexp to compilation-error-regexp-...
DeX3's user avatar
  • 273
2 votes

How do i close the *compilation* buffer without visitinig its window?

As suggested by Charkravarthy and Drew, using either vanilla Emacs, or together with Helm, Ido or Ivy one can kill / close the *Compilation* buffer using C-x k and selecting it when prompted to do so.
nyameko's user avatar
  • 555
2 votes
Accepted

Using compilation-mode to parse error stacks, relocating them

Just for the record, I ended up solving it via defadvice (it is a hackish solution imho). When browsing the stacks, I set the value of a local variable (container-path) to the container path of that ...
juanleon's user avatar
  • 173
2 votes

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

M-! let's you type a shell command and M-x shell takes you to a shell window. I'd probably set up makefile/CMake and run that. Also if you install flycheck it should show you live if there are any ...
Anton's user avatar
  • 163
2 votes
Accepted

Selecting an item in *compilation* buffer makes the item jump to the top

Without a left fringe, there is no place for emacs to show an arrow on the current row. In that case it scrolls down so that the buffer shows the current row on top instead. See here: If the *...
Gauthier's user avatar
  • 509

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