Questions tagged [compilation]

Running compilers, and more generally building software from within Emacs.

Filter by
Sorted by
Tagged with
52
votes
9answers
27k views

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

I have been trying off and on for over a year now to use Emacs as a C/C++ IDE. I have only been marginally successful thus far, but have run into a few brick walls along the way. Currently I am ...
21
votes
4answers
3k views

Hide *compilation* window

It is annoying to see the compilation window appear when it is successful. How to remove that automatically? I want to see it though if it is not successful.
12
votes
3answers
565 views

emphasise the current error in the *compilation* window

When running the compile command and jumping to the 'next error', emacs identifies the line of the current error by placing a little black triangle, pointing right, in the left-hand fringe of the *...
10
votes
2answers
968 views

How do I declare a variable ignorable?

How do I avoid byte-compiler warnings Unused lexical variable in functions defined using macros expanding to defun? E.g., macro defun-rcirc-command in rcirc.el uses the target variable which is not ...
9
votes
2answers
2k views

Recursively go up to find Makefile and compile

The problem with M-x compile is that if the Makefile isn't in the current directory, it fails. I'd like to have a function that recursively goes up to find a Makefile and run make from this directory....
9
votes
1answer
1k views

Jumping to the first error — not warning — when compiling

The compilation-auto-jump-to-first-error option should make Emacs jump to the first error during compilation. However, it seems that Emacs treats warnings and errors in the same way, and jumps to the ...
8
votes
3answers
967 views

Persistent environment for M-x compile

When I run M-x compile it spawns a new subshell to execute my compile command. As soon as the compile command returns, the shell process is killed. I can see why this would be desirable in most cases, ...
7
votes
1answer
2k views

What Emacs feature is nearest to Vim's quickfix?

The common use of Vim's quickfix is to hand off compilation of code to a command specified by the suggestively named makeprg variable and then interpret the errors printed by that command so you can ...
7
votes
3answers
2k views

Where to find missing dependencies (imagemagick and m17n)

I am compiling Emacs from source and can't figure out what libraries I need to enable imagemagick and m17n. I have imagemagick and libm17n-dev installed (I am on Debian). My ./configure script says: ...
7
votes
2answers
4k views

How can I customize the compile command?

In one of my projects I need to run make package install when building instead of make. It remembers the last compile command I used, but resets to make -k every time emacs starts up. How can I ...
7
votes
2answers
1k views

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

I would prefer to have the *compilation* buffer always stay in its own frame. However, currently if I run M-x compile from another frame/window, the buffer pops up in a new window there as well. How ...
6
votes
2answers
2k views

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

Similar to Visual Studio, when working with Rust programs, I'd like to press F5 to save the current file, compile it, and run it. What's a good way to do this?
6
votes
2answers
161 views

How to add a new .c file to Emacs source code

I've added my own .c file to Emacs /src directory as well as the following lines emacs.o: ... file.c file.h file.o: file.c in deps.mk I get file.o generated, but it is not linked when generating ...
6
votes
1answer
373 views

What are the advantages of building Emacs from source?

I use precompiled Emacs binaries (24.3) right now. AFAIK, v24.4 is already available as binaries, so there is no incentive for me to compile Emacs myself to stay current. I'm thinking, however, ...
5
votes
1answer
255 views

Close latex compilation window when successful

I like having TeX-show-compilation in LaTeX for large documents. However, if the compilation completed successfully, I would like the windows to be reverted or the compilation buffer to be killed. I ...
5
votes
1answer
167 views

emacs home made perspective: source + eshell + compilation

I want such functionality from emacs (gnu 25), I press key in any buffer with source code, and instead of one buffer I got 3 buffers on the screen: source code buffer ------------------ *eshell* | *...
4
votes
2answers
1k views

Compiling Emacs from source on Ubuntu - problems with libxml2

I'm trying to install Emacs 25.1.rc1 on Ubuntu 15.10, and have pre-installed the usual dependencies i.e.: autoconf automake libtool texinfo build-essential xorg-dev libgtk2.0-dev libjpeg-dev ...
4
votes
1answer
797 views

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

I like to work with a vertically split frame with code in both windows. When i call M-x compile the *compilation* buffer shows in the other window (wich is fine as M-g n would show problematic code in ...
4
votes
1answer
259 views

Ignore specific warnings in AUCTeX

I'm going through a LaTeX document fixing a bunch of broken references. I use AUCTeX. I ran TeX-toggle-debug-warnings to make TeX-next-error jump to warnings about references. However, my document ...
4
votes
1answer
345 views

Compile with Tramp hangs or fails when using Tramp with another command

I'm using Tramp with the scpx method to run the compile command on a remote machine. The build takes several minutes to run. If I try to work on something else while that runs that ends up trying to ...
3
votes
2answers
2k views

Compile Emacs with xwidgets in Ubuntu 14.04

Going to build Emacs from the git repository. Found this and this resources that suggest to compile it with xwidgets for Ubuntu 16.04. On my Ubuntu 14.04, did install the corresponding dependencies ...
3
votes
1answer
340 views

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

I am playing around with some LaTeX's DocStrip package. (For those interested: it is a LaTeX package, to create documented code, in order to write e.g. a style file and incorporate the ...
3
votes
1answer
397 views

Emacs for Windows: How to M-x compile using MinGW_32

I have been using Console2 on an MS Windows box to compile and would like to use Emacs instead. My settings on Console2 are as follows: shell="c:/mingw/bin/sh.exe --login -i -c 'cd /c/docume~1/...
3
votes
1answer
116 views

Have compilation errors / grep match reuse current frame/window without ever splitting it?

I have searched in a number of places (1, 2, 3, 4) even looked at the e-lisp source files and could not figure out how to do, so I ask. Context I have bound next-error to a key. I'm in some source ...
3
votes
0answers
121 views

How to keep hl-line updated in inactive window?

I have (setq global-hl-line-sticky-flag t) to enable hl-line in all windows. However, the highlighted line isn't updated when I change the cursor position in inactive window (e.g., by calling next-...
3
votes
0answers
47 views

Was compilation successful or not? [duplicate]

How do I find out if compilation was successful or not? I would like to have a variable compilation-no-error set to true after successful compilation. I looked at variables and functions starting ...
3
votes
0answers
131 views

Compile quietly unless there are errors

I want to run compile or recompile, but I don't want to see the *compilation* buffer pop up unless there's an error, or not at all. If the compilation succeeds, I should just see a notification in the ...
2
votes
2answers
277 views

Does your project use Elisp for build automation?

I'm building a new appliance, linking BusyBox with Tor on top of a minimal GNU/Linux operating system. I'd like to try something different for the automated build infrastructure with this one and ...
2
votes
3answers
5k views

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

I recently moved from Code::Blocks to Emacs to write C code. The one thing I don't like (because it takes too much time and effort for a simple and repetitive task) is the fact that I can't compile/...
2
votes
1answer
478 views

Compile and run C-Programs in Emacs

I'm currently learning C with a book that has many small code examples that the reader is supposed to write, run and experiment with. I'm using Emacs as my primary tool for everything that has to do ...
2
votes
2answers
1k views

Binding compile command to a key for c++ code

Is it possible to bind the compile and run commands for a c++ code to a single key (for example F5). What i do at the moment is to run M-x compile and then as compile command g++ project.cpp and then ...
2
votes
3answers
596 views

Changing or adding compiling options in cc-mode

In cc-mode, when we go to compile, M-x followed by compile, the default option is make -k. If I hit the down arrow, I am told no defaults available. Is it possible to add the option g++ -Wall ...
2
votes
1answer
243 views

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

I have subDirA with source code foo.rs. To compile code in bash I need: $ cd subDirA $ some-compile-command But problem is that compiler invoked via some-compile-command prints errors in such format:...
2
votes
1answer
363 views

Source-Links in Compilation mode not working

I've been experimenting with M-x compile recently (I'm using it to start my node.js-project which will output a stack-trace if there is an error. I get traces like this: Error: Configuration ...
2
votes
1answer
48 views

Previous/next occur result, independently from compilation errors

After running M-x occur, the commands next-error and previous-error let me navigate between hits. I would like to be able to M-x compile my program and then keep browsing through the same *Occur* ...
2
votes
4answers
289 views

Compile Matlab Code

I am new to gnu Emacs and have a question. I created an M file to run in Matlab and I got it working fine. My question is, is there a way to compile my code in the Emacs editor or test out my ...
2
votes
1answer
50 views

Running process interactively (like compilation) but without parsing

Is there any command which let me observe output of async-called process (just like M-x compile), but does not try to parse output buffer? Background: for quite a lot of non-compilation tasks (hg ...
2
votes
1answer
88 views

How to access the original buffer when running M-x compile and friends?

For example, take any buffer. Maybe one named my-file. I want to run M-x compile in it and have access to the my-file buffer in compilation-finish-functions. You'd think think might work: (setq ...
2
votes
1answer
229 views

Sharing *compilation* window with other compilation-like commands

Is it possible to make a few different commands share a window for their output? For example, let's say I do M-x compile and get a *compilation* buffer in bottom half of my frame. If I then do M-x ack ...
2
votes
1answer
884 views

Configuring Emacs as a CMake based C/C++ IDE

I have been interested in Emacs for a while, since I have seen some great articles on the Internet, which demonstrates the usage of Emacs as a C/C++ IDE. Those projects are awesome, yet they are not ...
2
votes
2answers
315 views

Compile from parent directory in Emacs

I'm trying to map F5 to compile from a parent directory of the current buffer. Emacs compile-command find makefile in superior directory provides an excellent answer to achieve this: (defun compile-...
2
votes
1answer
48 views

In egrep, how to click a matched line and let it show the matched line in another buffer without moving the cursor

In notepad++, I could search a folder, and then click the match line to display the matched line of the corresponding buffer. How to do this in emacs? What I can do now is to press "ENTER" on the ...
2
votes
1answer
60 views

Automatically reply to input-requests in compilation buffer

My situation is this: I compile by invoking a system that runs perl scripts that invoke the Visual Studio compiler, as well as running some pre-compile tasks. By and large, the system works fine. ...
2
votes
0answers
415 views

.dir-locals.el isn't recognized

I am working on a project that includes some configuration in .dir-locals.el: ((c++-mode . ((compile-command . "cd ../../\; ./build.sh")))) This gets picked up just fine for me and sets the ...
2
votes
0answers
544 views

Configure.ac options when building from source

Disclaimer: newbie to emacs, vaguely competent on MacOS and git. I'm building emacs on OSX Yosemite from the git master repo. I've done this several times, primarily by using ./configure --with-ns -...
1
vote
2answers
156 views

Using compilation-mode to parse error stacks, relocating them

I run several applications, in several languages, that store their error stacks locally. I made a small emacs mode that allows me to browse those errors and navigate the related code. The code I ...
1
vote
3answers
560 views

Change Default Compiler Within Emacs? [closed]

I asked this question originally on StackOverflow. I use M-x compile within Emacs to compile my C code which then initiates make -k and allows me to compile the code. I wish to use Clang (or ...
1
vote
1answer
22 views

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

I try to navigate through compilation errors in my compilation buffer: I place the cursor on an error, and press Enter (alternatively, I use M-g n). What happens: the compilation buffer places the ...
1
vote
1answer
468 views

Dedicated compile hook on compilation finish

I use the compilation-finish-functions hook to perform some actions once compilation finishes. However, unexpectedly to me the hook is also triggered when rgrep completes. I can't seem to find a ...
1
vote
1answer
223 views

eval-when-compile: Is my understanding correct?

I want to build a ring of symbols in my init.el for the purpose of rotating themes. I could do it like this: (let* ((themes '(doom-one zenburn leuven)) (ring (make-ring (length themes)))) (...