Skip to content

benide/emacs-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Emacs config

This is a new repo with my emacs config converted from straight to elpaca. It’s a work in progress. While switching to elpaca, I decided to switch from helm-bibtex to citar, and that isn’t done. There are other things that are half-baked as well.

To do

  • How can I get ob-lilypond to fontify properly?
  • Figure out citar
  • set up eglot

NixOS and vterm

On NixOS, it’s best to let Nix take care of compiling the vterm module. Since it’s already there, we don’t want elpaca to download it again and try to compile it. The following macro allows elpaca to take care of it when it isn’t installed, but otherwise stops elpaca from trying to install it even as a dependency (like when installing vterm-toggle).

(defvar ide/try-built-in-by-default t)

(defmacro ide/use-package (package &rest body)
  (let* ((body-without-prop (use-package-plist-delete body :try-built-in))
         (prop-exists (plist-member body :try-built-in))
         (prop-value (plist-get body :try-built-in))
         (try-built-in (or prop-value
                           (and ide/try-built-in-by-default
                                (not prop-exists)))))
    (if (and try-built-in
             (locate-library (symbol-name `,package)))
        `(progn
           (cl-pushnew (quote ,package) elpaca-ignored-dependencies)
           (use-package ,package :elpaca nil ,@body-without-prop))
      `(use-package ,package ,@body-without-prop))))

(ide/use-package vterm)

I can still install something built-in from a recipe as well:

(ide/use-package org :try-built-in nil)

I can also go the other way with the default behavior and explicitly list which things should check for a built-in version:

(setq ide/try-built-in-by-default nil)
(ide/use-package vterm :try-built-in t)

use-package in Emacs 29

As of Emacs 29, use-package is built in. This only installs it when the function doesn’t already exist.

(unless (fboundp 'use-package)
  (elpaca use-package (require 'use-package)))

About

Emacs configuration using Elpaca

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published