Skip to main content

Questions tagged [compilation]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
292 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 ...
juanleon's user avatar
  • 173
3 votes
3 answers
1k views

Compile command as a directory variable?

I am working on a cmake project and I would like to set a directory variable containing the correct compile command. I added this to the root directory of the project in a .dir-locals.el file: ;;; ...
hfhc2's user avatar
  • 308
0 votes
1 answer
52 views

How can make emacs immediately compile a file I load?

Usually when I load a project, I want to compile it once right away, be it to again see the compilation error I was working on or just to build the dependencies of the checkout, so I don't have to ...
leftaroundabout's user avatar
5 votes
2 answers
2k 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 ...
ocodo's user avatar
  • 1,222
2 votes
2 answers
2k 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 ...
user avatar
2 votes
1 answer
2k 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 ...
jnbrq -Canberk Sönmez's user avatar
1 vote
0 answers
206 views

Smarter compile in emacs

I often got to work with projects organized as follows: src/ include/ ... Makefile Is there a way to teach emacs' "compile" function to always use that top-level Makefile regardless which file I'...
god's user avatar
  • 266
2 votes
1 answer
91 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* ...
Gilles 'SO- stop being evil''s user avatar
3 votes
0 answers
57 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 ...
tom's user avatar
  • 283
7 votes
2 answers
2k 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 ...
ajp's user avatar
  • 403
1 vote
1 answer
37 views

Yasnippet stops compile error highlighting

I have been compiling my C++ project using M-x compile which I like because it provides highlighted links to my errors: However after adding: (add-to-list 'load-path "~/.emacs.d/plugins/...
Jeff's user avatar
  • 111
2 votes
2 answers
668 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-...
Yang's user avatar
  • 165
4 votes
1 answer
450 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 ...
Daniel Matz's user avatar
3 votes
0 answers
171 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 ...
Gilles 'SO- stop being evil''s user avatar
4 votes
1 answer
461 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 ...
Gilles 'SO- stop being evil''s user avatar
1 vote
1 answer
92 views

failed compile command runs on exit, prevents exit – how to track down?

I'm on a new system (Amazon Linux 2015.9), and my emacs config seems to not like the stock install (Emacs 24.3.1) or vice-versa. When I do C-x C-c it runs save-buffers-kill-terminal. But this fails, ...
billc's user avatar
  • 173
0 votes
1 answer
54 views

Exports in compile command

I'm using the Anaconda distribution for Numpy, Ipython etc. and during the installation the following was added to my .bashrc: # added by Anaconda2 2.4.0 installer export PATH="/home/matthias/...
Stein's user avatar
  • 581
1 vote
1 answer
220 views

How to check if a variable is a file local variable

Some background, I have some code that sets a default compile command depending on the mode. However, in some files, I've used the add-file-local-variable-prop-line to create a more specific command, ...
user2699's user avatar
  • 2,251
0 votes
0 answers
211 views

Always remember last compile-command?

How do I get Emacs to always remember the last compile-command? My compile-command (cc) in Emacs 24 settings is pure vanilla, no bells and whistles. I only changed the cc string itself ("python build....
BBSysDyn's user avatar
  • 101
6 votes
2 answers
300 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 ...
Sergey's user avatar
  • 243
2 votes
4 answers
384 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 ...
Jack's user avatar
  • 121
2 votes
1 answer
54 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 ...
Daniel Wu's user avatar
  • 1,781
9 votes
1 answer
3k 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 ...
Eleno's user avatar
  • 1,448
14 votes
4 answers
825 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 *...
Spacemoose's user avatar
1 vote
0 answers
56 views

Can I have a separate shell switch when compiling?

Whenever I use M-x compile, I like to have the shell that's running to be configured with bash -ic so that I can easily type the compilation command (I switch between languages often, so the building ...
VF1's user avatar
  • 213
0 votes
1 answer
369 views

Changing the default-directory of an open compilation buffer

I have two different compile commands, and they need to run in different directories. I've gone through the trouble of making sure that if at all possible, I re-use the open compile buffer, rather ...
RealityMonster's user avatar
2 votes
1 answer
112 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. ...
RealityMonster's user avatar
3 votes
2 answers
408 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 ...
Ian Bryant's user avatar
2 votes
3 answers
879 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 ...
dustin's user avatar
  • 229
12 votes
2 answers
2k 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 ...
sds's user avatar
  • 6,124
1 vote
2 answers
586 views

How to do remote compile on Windows from Linux

How can I configure Emacs, such that I am able to compile files remotely on a Windows machine, while Emacs is running under Linux? I am using tramp via the smb method to edit files on the Windows ...
Martin's user avatar
  • 331
2 votes
1 answer
59 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 ...
Mekk's user avatar
  • 1,047
2 votes
1 answer
99 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 ...
nanny's user avatar
  • 5,756
2 votes
0 answers
520 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 ...
jake's user avatar
  • 245
1 vote
3 answers
751 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 ...
haziz's user avatar
  • 121
2 votes
1 answer
268 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 ...
Mekk's user avatar
  • 1,047
2 votes
0 answers
866 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 -...
Cena Mayo's user avatar
0 votes
1 answer
51 views

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

When I run compile, I'm seeing a strange behavior where the shell command is being executed in the parent of default-directory rather than default-directory itself. Here's an example of what I'm doing:...
abingham's user avatar
  • 927
13 votes
3 answers
3k 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....
Florian Margaine's user avatar
8 votes
1 answer
3k 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 ...
Praxeolitic's user avatar
6 votes
1 answer
608 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, ...
mbork's user avatar
  • 1,687
9 votes
3 answers
5k 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: ...
Łukasz Gruner's user avatar
0 votes
1 answer
676 views

Flymake: no buildfile (Makefile) found

Let's say that I have a makefile in ./ and a file ./package/myclass.java. From ./, make works just normally, but using flymake-mode in Emacs, I always get the error Flymake: No buildfile (Makefile) ...
Monkey Supersonic's user avatar
6 votes
2 answers
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?
dharmatech's user avatar
  • 1,274
9 votes
3 answers
1k 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, ...
nispio's user avatar
  • 8,245
9 votes
3 answers
7k 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 ...
Connor's user avatar
  • 1,611
56 votes
9 answers
35k 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 ...
nispio's user avatar
  • 8,245
26 votes
5 answers
5k 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.
Husain's user avatar
  • 495

1
2