27

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 probably shouldn't use Emacs). CEDET aims to be a complete solution that covers all your needs for supported languages, but I've personally never gotten it working ...


16

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 the makeprg option) M-g p and M-g n to go to the location of the previous/next error (like :cp and :cn) M-{ and M-} to go to the previous/next file with an ...


15

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 directory containing NAME. Stop at the first parent directory containing a file NAME, and return the directory. Return nil if not found. Instead of a string,...


15

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 directory tree for a Makefile, SConstruct, Git repo, SVN repo, and perhaps some other build system or version control files to automatically learn what files are ...


14

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 like this: (add-hook 'compilation-finish-functions (lambda (buf strg) (kill-buffer buf)) If you don't want to kill the buffer, then use something like this: ...


13

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" warning won't be triggered.


11

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 (add-hook 'compilation-finish-functions (lambda (buf str) (if (null (string-match ".*exited abnormally.*" str)) ;;no errors, make the compilation ...


9

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 could be 95% as good as Visual Studio, and it can do much more. but you might be not interested in the "more" part. So I will focus on your questions only. Now ...


7

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 value can be either 2 -- skip anything less than error, 1 -- skip anything less than warning or 0 -- don't skip any messages. Note that all messages not ...


6

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-dominating-file (buffer-file-name) "Cargo.toml") (compile "cargo run") (compile (format "rustc %s & %s" (buffer-file-name) (...


6

You can customize the variable compile-command to change the compilation command that is used by default: (setq compile-command "make package install")


6

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? yes NB1: as with other features (eg libxml2-dev for eww), I do not get the purpose of --with-feature: If the libraries and ...


6

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-exists-p "Makefile")) (not (equal "/" default-directory))) (cd "..")) (when (file-exists-p "Makefile") (compile "make -k"))))


6

For emacs-26 on ubuntu, the required package for --with-xwidgets is libwebkit2gtk-4.0-dev. Found in comment here, confirmed by experience.


6

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 texinfo libgtk2.0-dev sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa sudo apt install gcc-10 g++-10 libgccjit0 libgccjit-10-dev libjansson4 libjansson-dev git ...


5

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 solution. There is no performance advantage if you compile it by yourself.


5

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 found them to be slightly superior; although, they function almost identically. Both work with nearly no configuration. For other IDE features, I also like the ...


5

Here my version of compile: (global-set-key (kbd "<f5>") (lambda () (interactive) (save-buffer) (setq-local compilation-read-command nil) (call-interactively 'compile))) Basically it reuses previously executed compile command; ...


5

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 ("reusable windows"). What you need is for Emacs to consider the compilation buffer's frame as a reusable frame: (push '("\\*compilation\\*" . (nil (reusable-...


5

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 only in c++-mode; you can make it a global binding if you want by using global-map instead. For the second, the compile function just runs whatever is stored ...


5

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" "dtx") Documentation: *File extensions used by manually generated TeX files. You can use the customize interface to add "ins" to this list or with ...


4

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 would be nice if I could also achieve this without littering my source tree with lots of support files. Why do I need more than one centralized project ...


4

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 libraries the Debian maintainer has chosen to link Emacs against. I think you need: apt-get install libm17n-dev libmagickcore-dev However after this I still ...


4

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 built and building only the things you have to. This would typically call for interaction with database, version control system and writing code which builds a ...


4

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. If you also want to keep the output buffer for LaTeX warnings switch off TeX-buf-close-at-warnings-only via M-x customize-option. (defcustom TeX-buf-close-at-...


3

The value of default-directory has to end with a slash.


3

If you want to customize the variable per project rather than globally. You can use Directory Variables. These allow you to apply certain customizations only for files in certain directory and its subdirectories. So for example you want to use the make package install as compile command only in project A, you will need to create a file named .dir-locals.el ...


3

Thanks to the University of Wyoming I have been able to achieve the result with: ;; Make M-x compile smarter in order to guess language (require 'compile) (defvar compile-guess-command-table '((c-mode . "gcc -Wall -g %s -o %s -lm") (c++-mode . "g++ -Wall %s -o %s -std=c++14") (fortran-mode . "gfortran -C %s -o %s") )) (defun compile-...


3

Quoting deps.mk: ## This file is included in src/Makefile if AUTO_DEPEND=no.\ So it's kind of a fallback file only used to give dependencies to make sure compilation ordering is right. You want to look in src/Makefile.in instead where you should have no difficulty finding the variable that contains all the .o files we need.


3

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 in non-standard locations for libraries. While this is problem is specific to the site, it's important to note that pkg-config will report that a package isn'...


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