Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

3
votes
1answer
37 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 ...
0
votes
1answer
23 views

use a function to get file in compilation-error-regexp-alist

I have used compilation-error-regexp-alist a lot so I am familiar with the syntax. However for this particular error I need to use a function to get the file because I need wildcards. Here is the ...
1
vote
0answers
24 views

M-x compile --> emacs doesn't automatically open files

I have recently switched from an older version of emacs to version 24.3.1. And I have run into the following problem: I have a base folder "/base" and a folder with source files "base/src"; my ...
1
vote
1answer
34 views

Compiled Emacs Needs Terminfo

When installing emacs completely from source to a custom prefix (no root), even after the compilation works, it says emacs: Cannot open terminfo database file . Adding the terminfo to different parts ...
0
votes
3answers
331 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/...
1
vote
1answer
92 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 ...
0
votes
0answers
39 views

C-c C-c not always doing the same thing

I use emacs to typeset documents using latex (nothing fancy, no AUCTeX). Usually, when I enter 'C-c C-c' it will invoke pidflatex and compile it. Sometimes, instead I will see a message in the mini-...
0
votes
0answers
55 views

How to make compilation-mode remember location for Rust source code when navigating backtrace?

If I run cargo-process-run (, c x on Spacemacs) with a prefix argument to edit the compilation command to RUST_BACKTRACE=1 cargo run, I get a nice backtrace with links to files with their line numbers....
2
votes
1answer
82 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:...
6
votes
1answer
79 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 ...
1
vote
0answers
48 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
2answers
666 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 ...
0
votes
1answer
230 views

compilation-scroll-output doesn't work if *compilation* buffer is created by hand

Emacs version 25 I have a short piece of elisp to create a few buffers and split my frame into multiple windows that are displayed the way I like. This code creates a *compilation* buffer and ...
1
vote
1answer
15 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
191 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 ...
5
votes
1answer
121 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* | *...
0
votes
1answer
39 views

Linking Multiple Implementation Files in C on Emacs

I need help with linking multiple c source code files on emacs. Could anyone show me the way on how to work this out? Thanks!
0
votes
0answers
107 views

How to highlight in the mode-line that a compilation process is running in AUCTeX?

As compiling LaTeX documents can take a while, I would like to be able to quickly and effortlessly check whether the compilation process is still runing. How can I achieve this with AUCTeX? I know I ...
1
vote
1answer
46 views

Another level of “next/previous” in the compilation buffer?

I use Emacs with Cucumber (cucumber.io). Cucumber outputs lines like this: Scenario: Jeff returns a faulty microwave # /somepath/file1.feature:12 Given Jeff has bought a microwave ...
1
vote
1answer
115 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)))) (...
3
votes
1answer
233 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 ...
0
votes
1answer
93 views

Compilation problem in Emacs,

I am using Emacs 24.3.1. on Ubuntu. I am trying use compile in emacs: (M-x compile), I choose my Makefile. It answered me -*- mode: compilation; default-directory:"path" -*- Compilation started at ...
2
votes
1answer
181 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
330 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 ...
1
vote
2answers
57 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
1answer
365 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: ;;; ...
0
votes
1answer
39 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 ...
2
votes
2answers
589 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 ...
1
vote
2answers
596 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
1answer
582 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 ...
1
vote
0answers
91 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'...
3
votes
1answer
33 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* ...
3
votes
0answers
42 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 ...
6
votes
2answers
740 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 ...
1
vote
1answer
27 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/...
1
vote
1answer
136 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-...
4
votes
1answer
226 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
0answers
99 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 ...
3
votes
1answer
183 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 ...
1
vote
1answer
58 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, ...
0
votes
1answer
32 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/...
1
vote
1answer
54 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, ...
0
votes
0answers
89 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....
6
votes
2answers
113 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 ...
2
votes
4answers
189 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
40 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 ...
7
votes
1answer
880 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 ...
11
votes
3answers
381 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 *...
1
vote
0answers
40 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 ...
0
votes
1answer
237 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 ...