doom has got an environment file:
doom help env
To get started I am using this:
git clone https://github.com/hlissner/doom-emacs-private ~/.config/doom
Following a clean, organized directory structure:
~/local/ # Base directory for local software ├── src/ # Source code for software to be compiled │ ├── emacs/ # Emacs source code │ ├── texinfo/ # Texinfo source code │ └── ... ├── build/ # Build directories (keeps source dir clean) │ ├── emacs/ # Emacs build directory │ ├── texinfo/ # Texinfo build directory │ └── ... ├── opt/ # Installed software (similar to /opt) │ ├── emacs/ # Emacs installation │ ├── texinfo/ # Texinfo installation │ └── ... ├── bin/ # Symlinks to installed binaries ├── lib/ # Libraries for local software ├── include/ # Header files for local software ├── share/ # Shared data files ├── var/ # Variable data (logs, etc.) └── etc/ # Configuration files
# Create necessary directories
mkdir -p ~/local/{src,build,opt,bin,lib,include,share,var,etc}
# Get Emacs source code
cd ~/local/src
git clone https://git.savannah.gnu.org/git/emacs.git
cd emacs
# Create and use build directory
mkdir -p ~/local/build/emacs
cd ~/local/build/emacs
# Generate configuration files
~/local/src/emacs/autogen.sh
# Configure with appropriate paths
CPPFLAGS="-I$HOME/local/include" \
LDFLAGS="-L$HOME/local/lib" \
LIBS="-lgif" \
~/local/src/emacs/configure \
--prefix=$HOME/local/opt/emacs \
--bindir=$HOME/local/bin \
--with-native-compilation \
--with-mailutils \
--with-tiff=ifavailable \
--with-gnutls=ifavailable \
--with-gif \
CPPFLAGS="-I$HOME/local/include" \
LDFLAGS="-L$HOME/local/lib"
# Build and install
make -j$(nproc)
make install
# Add to PATH if not already there
echo 'export PATH="$HOME/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Create necessary directories
mkdir -p ~/local/{src,build,opt,bin,lib,include,share,var,etc}
# Get Emacs source code
cd ~/local/src
git clone https://git.savannah.gnu.org/git/emacs.git
cd emacs
# Build in the source directory (not in a separate build directory)
# Run the autogen script
./autogen.sh
# Configure with appropriate paths
./configure \
--prefix=$HOME/local/opt/emacs \
--bindir=$HOME/local/bin \
--datarootdir=$HOME/local/share \
--libdir=$HOME/local/lib \
--infodir=$HOME/local/share/info \
--mandir=$HOME/local/share/man \
--with-native-compilation \
--with-mailutils \
--with-tiff=ifavailable \
--with-gnutls=ifavailable \
--with-x-toolkit=no \
--without-native-compilation \
--with-xpm=ifavailable \
--with-gif=ifavailable
# Build and install
make -j$(nproc)
make install
# Add to PATH if not already there
echo 'export PATH="$HOME/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Note:
CPPFLAGS="-I$HOME/local/include" LDFLAGS="-L$HOME/local/lib"
should result in the config lines having lines like this
GIF_CFLAGS='-I/fsx/christian.geng/local/include' LIBGIF='-L/fsx/christian.geng/local/lib -lgif'
If you need to rebuild Emacs (or any software) from scratch, it’s best to start with a clean build directory to avoid stale configuration or object files. This is especially important when changing dependencies like giflib, gnutls, etc.
# Remove the existing build directory (be careful: this deletes all build artifacts)
rm -rf ~/local/build/emacs
# Recreate and enter the build directory
mkdir -p ~/local/build/emacs
cd ~/local/build/emacs
# Run configure with the appropriate flags
~/local/src/emacs/configure \
--prefix=$HOME/local/opt/emacs \
--bindir=$HOME/local/bin \
--with-native-compilation \
--with-mailutils \
--with-tiff=ifavailable \
--with-gnutls=ifavailable \
--with-gif \
CPPFLAGS="-I$HOME/local/include" \
LDFLAGS="-L$HOME/local/lib"
# Build and install
make -j$(nproc)
make install
This ensures that your build picks up any changes to libraries or headers.
Texinfo is required for building Emacs. If your system’s texinfo is missing or outdated, you can build it from source:
# Navigate to source directory
cd ~/local/src
# Download texinfo source
wget https://ftp.gnu.org/gnu/texinfo/texinfo-6.8.tar.gz
tar xzf texinfo-6.8.tar.gz
# Create and use build directory
mkdir -p ~/local/build/texinfo
cd ~/local/build/texinfo
# Configure with appropriate paths
~/local/src/texinfo-6.8/configure --prefix=$HOME/local/opt/texinfo --bindir=$HOME/local/bin
# Build and install
make
make install
# Verify installation
which makeinfo
makeinfo --version
Tip: Do you need to run autoreconf?
- If you download a release tarball (e.g., texinfo-6.8.tar.gz, giflib-5.2.1.tar.gz), the configure script is already present and ready to use. You do NOT need to run autoreconf; just run ./configure in your build directory.
- If you clone from git or use a development source tree, the configure script may be missing or outdated. In that case, run autoreconf -i (or autogen.sh, if present) before ./configure.
You can then use the locally installed texinfo when building Emacs by ensuring it’s in your PATH:
# When configuring Emacs, ensure the local bin directory is in your PATH
export PATH="$HOME/local/bin:$PATH"
# Or, if you prefer, explicitly set the MAKEINFO variable
** GnuTLS
You can build gnutls from source:
cd ~/local/src
wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.0.tar.xz
tar -xf gnutls-3.8.0.tar.xz
cd gnutls-3.8.0
autoreconf -i
automake
./configure --prefix=$HOME/local/opt/gnutls --bindir=$HOME/local/bin
make
make install
** GIFLIB
You can build giflib from source:
# Download giflib source
cd ~/local/src
wget https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz
# Extract and enter source directory
tar xzf giflib-5.2.1.tar.gz
cd giflib-5.2.1
# Build and install (giflib uses in-tree build)
make
make install PREFIX=$HOME/local/opt/giflib
# Ensure your local lib/include directories contain giflib files
cp $HOME/local/opt/giflib/lib/libgif.* $HOME/local/lib/
cp $HOME/local/opt/giflib/include/gif_lib.h $HOME/local/include/
# (Optional) Check that the header and library are present
ls -l $HOME/local/include/gif_lib.h
ls -l $HOME/local/lib/libgif*
Note: giflib does not provide a pkg-config file, so you must use CPPFLAGS and LDFLAGS to help Emacs’ configure script find giflib. For example:
CPPFLAGS="-I$HOME/local/include" LDFLAGS="-L$HOME/local/lib" ./configure --prefix=$HOME/local/opt/emacs --bindir=$HOME/local/bin --with-gif --with-other-flags
Refer to the GIFLIB section below for details.
You can build nettle from source:
cd ~/local/src wget ftp://ftp.gnu.org/gnu/nettle/nettle-3.8.1.tar.gz tar xzf nettle-3.8.1.tar.gz cd nettle-3.8.1
./configure –prefix=$HOME/local/opt/nettle –bindir=$HOME/local/bin make make install
sudo apt-get install -y \
gcc-10 libgccjit0 libgccjit-10-dev \
libjansson4 libjansson-dev git \
software-properties-common \
automake texinfo
# Navigate to Emacs source directory
cd ~/local/src/emacs
# Create a Dockerfile
cat > Dockerfile << 'EOF'
FROM ubuntu:20.04
# Install dependencies
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
gcc-10 libgccjit0 libgccjit-10-dev \
libjansson4 libjansson-dev git \
automake texinfo
# Add GCC repository for native compilation
RUN add-apt-repository ppa:ubuntu-toolchain-r/ppa \
&& apt-get update
# Get Emacs build dependencies
RUN apt-get build-dep -y emacs
# Set compiler for native compilation
ENV CC="gcc-10"
# Copy source code
COPY . /opt/emacs
WORKDIR /opt/emacs
# Build Emacs
RUN ./autogen.sh \
&& ./configure --with-native-compilation --with-mailutils \
&& make -j$(nproc) \
&& make install
ENTRYPOINT ["emacs"]
EOF
# Build the Docker image
docker build -t emacs-build .
# Run Emacs in Docker
docker run -it --rm emacs-build
- –prefix=$HOME/local/opt/emacs: Sets installation directory
- –bindir=$HOME/local/bin: Where executable binaries will be installed
- –datarootdir=$HOME/local/share: Directory for read-only architecture-independent data
- –libdir=$HOME/local/lib: Directory for libraries
- –infodir=$HOME/local/share/info: Directory for info documentation
- –mandir=$HOME/local/share/man: Directory for man pages
- –with-native-compilation: Enable native compilation support (faster Elisp)
- –with-mailutils: Include mail utilities
- –with-tiff=ifavailable: Include TIFF support if available
- –with-gnutls=ifavailable: Include GnuTLS support if available
- –without-x: Build without X Window System support (optional, for terminal-only use)
If you encounter permission errors like:
umask 022; /usr/bin/mkdir -p "/usr/local/share/info" /usr/bin/mkdir: cannot create directory '/usr/local/share/info': Permission denied make: *** [Makefile:793: install-info] Error 1
Make sure that all installation paths in the configure step are set to locations within your home directory. The key flags to check are:
- –prefix
- –datarootdir
- –infodir
- –mandir
- –libdir
Using directories under ~/local/ should resolve these permission issues.
My adapation of https://github.com/chaoflow/.emacs.d
Original README:
Be prepared for rebases.
Better take a look at other sources for configuration files:
- https://github.com/redguardtoo/emacs.d/tree/master/lisp
- https://github.com/corecode/skel/tree/master/.emacs.d
- https://github.com/magnars/.emacs.d/
- https://github.com/cjohansen/.emacs.d
- https://github.com/technomancy/emacs-starter-kit from which I take inspiration or shamelessly copy.
- Emacs Manual
- imenu and icycles
- Emacs Mode Hook for autopep
- http://www.coli.uni-saarland.de/~slemaguer/emacs/main.html#org67e2b1b -> moved https://github.com/seblemaguer/dotfiles
- https://github.com/daviwil/emacs-from-scratch - emacs from Scratch Series
- https://github.com/Schnouki
- https://github.com/tmtxt/.emacs.d/tree/master/config
- https://www.masteringemacs.org
- https://caiorss.github.io/Emacs-Elisp-Programming/Keybindings.html
- http://ergoemacs.org/emacs/emacs\_find\_replace.html
- https://github.com/enzuru/.emacs.d
- https://github.com/iqss/IQSS.emacs/ and https://iqss.github.io/IQSS.emacs/init.htm
- Cmake IDE Package https://github.com/atilaneves/cmake-ide
- https://skebanga.github.io/cpp-dev-in-spacemacs/
- http://www.coli.uni-saarland.de/~slemaguer/emacs/main.html#org3c16bce
- http://doc.norang.ca/org-mode.html
- https://sachachua.com/blog/2013/08/emacs-how-i-organize-my-org-files/
- https://orgmode.org/worg/org-hacks.html
- https://en.wikipedia.org/wiki/Getting\_Things\_Done
- C-c c - Capturn
- https://gist.github.com/prassee/1d0678ad1c86481176a39ccb4441c53b
- https://gist.github.com/spacebat/097f3e7469edf2eaa6a9
- https://www.reddit.com/r/emacs/comments/7zqc7b/share\_your\_org\_capture\_templates/
- Die Org-Config von ist sehr mächtig, https://github.com/sk8ingdom/.emacs.d/tree/master/. Diese habe ich assimiliert. Insbesondere die Capture-Templates sind ein sehr toller Ausgangspunkt. Der Hinweis ist auch aus dem Reddit-Post: https://www.reddit.com/r/emacs/comments/7zqc7b/share\_your\_org\_capture\_templates/
- Learn Emacs Lips the Hard Way
- Emacs Lisp caiorss
- Elisp versus Scheme Lisp keywords
- Learn Elisp the hard way
- Elpy issues: jorgenschaefer/elpy#842
- https://vxlabs.com/2018/06/08/python-language-server-with-emacs-and-lsp-mode/
- ed baron
- Palantir Python lsp server imple111mentation
- https://github.com/rememberYou/.emacs.d/blob/master/config.org#python
- add python from scratch link here
- https://www.youtube.com/watch?v=74zOY-vgkyw
- lsp languages https://emacs-lsp.github.io/lsp-mode/page/languages/
- https://github.com/seblemaguer/dotfiles -> has one too, no longer coli uni-saarland
- Medium Post on LSP: https://alpha2phi.medium.com/emacs-lsp-and-dap-7c1786282324
http://www.goldsborough.me/emacs,/java/2016/02/24/22-54-16-setting\_up\_emacs\_for\_java\_development/ http://www.skybert.net/emacs/java/ https://github.com/skybert/my-little-friends/blob/master/emacs/.emacs.d/tkj-java-meghanada.el https://github.com/skybert/my-little-friends/blob/master/emacs/.emacs.d/tkj-java-meghanada.el
Currently used Major Modes - mmm mode are two multi-mode enginges web mode. I have mainly configured - vue-mode for vue framework files - js2-mode for javascript
Completion for css, js, html. Abbreviations on homepage,
https://github.com/smihica/emmet-mode
C-j
Company backend for web completion https://github.com/osv/company-web configured in setup-web-mode.el and setup-auto-complete.el
M-x company-web-html
see this for language server alternative https://emacs.stackexchange.com/questions/55230/help-setting-up-company-mode-autocompletion-of-html-css-files
Flycheck use eslint: http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html
C-c C-f web-mode-fold-or-unfold C-c C-e i web-mode-element-insert C-c C-s insert snippets M-; comment out regions C-c C-w show whitespaces C-c C-m mark region
Selection Expansion C-n marks current element
Tag Navigation:
Closing element : type ‘</’ and it happens in html similarly for templates
Type faster: emmet-mode: But web-mode has sth similar d/ -> creates div, /s creates spna
- To be described - Using lsp is quite cool
- https://github.com/jerryhsieh/Emacs-config
- https://blog.onionstudio.com.tw/emacs-%E5%AF%AB-vue-js/
- https://emacs-lsp.github.io/lsp-ui/
- Emacs LSP Main Page https://emacs-lsp.github.io/lsp-mode/
- Emacs from scratch Video https://www.youtube.com/watch?v=E-NAM9U5JYE
- https://emacs-lsp.github.io/lsp-mode/page/languages/
- Dap https://emacs-lsp.github.io/dap-mode/page/configuration/
- Emacs-LSP Discussions at gitter https://gitter.im/emacs-lsp/lsp-mode?at=5df680feac14cc652c8c0e22
- start using fci-mode
- (setq fci-rule-column 100)
find . -name '*.[ch]' | xargs etags
- M-. (that’s Meta-Period) and type the name of the function
- M-* to navigate to last point
- Use helm to navigate to tags: M-x helm-etags-select
- Use projectile-regenerate-tags to generate tags before.
( (nil . ( (projectile-project-test-cmd . "pytest --color=yes app/ --ignore app/tests/ --cov=app/study --cov=app/report --cov=app/core") ;; (compilation-read-command . nil) (py-pythonpath . "/home/audeering.local/cgeng/code/data_collection/aisoundlab/backend/app/") ;; (setq venv-dirlookup-names '(".projectile" ".venv" "pyenv" ".virtual")) ;; Automatically activating a virtualenv when using projectile ;; (setq projectile-switch-project-action 'venv-projectile-auto-workon) (eval . (progn (make-local-variable 'process-environment) (setq process-environment (copy-sequence process-environment)) (setenv "PYTHONPATH" "/home/cgeng/code/app/:/home/cgeng/some_dir/") (setenv "WORKON_HOME" (expand-file-name "~/work/.envs")) )) ) ) (python-mode . ( ;; (pyvenv-activate . "~/.venvs/py37") (lsp-pyright-venv-path . "~/.venvs/") (subdirs . nil)) ) )
- https://emacs.stackexchange.com/questions/24907/how-to-use-dir-locals-el-with-projectile
- https://emacs.stackexchange.com/questions/13080/reloading-directory-local-variables
- https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs - cmake beispiele
- https://emacs.stackexchange.com/questions/61493/confused-regarding-dir-locals-el-and-projectile/61594#61594
- https://emacs.stackexchange.com/questions/63417/adding-directory-local-variable-for-projectile-test-command-is-not-working
- https://gist.github.com/sivakov512/99f288960475ca6c32c8c65483012c71 - uses .dir-locals to run python manage.py runserver