Use emacsclient to update mu index to make sure the db isn't locked

This commit is contained in:
Charlotte Van Petegem 2021-03-22 13:46:31 +01:00
parent 2808ce7436
commit 8e1b901372
No known key found for this signature in database
GPG key ID: 019E764B7184435A
6 changed files with 401 additions and 377 deletions

View file

@ -1,32 +1,49 @@
{ config, lib, pkgs, ... }:
let
emacsPkg = pkgs.emacsWithPackagesFromUsePackage {
config = ./emacs/init.el;
package = pkgs.emacsPgtk;
alwaysEnsure = true;
extraEmacsPackages = epkgs: [
# mu4e is included in the mu package and should be used from there
pkgs.mu
];
};
in
{
options.chvp.emacs = {
enable = lib.mkOption {
default = true;
example = false;
};
package = lib.mkOption { };
};
config = lib.mkIf config.chvp.emacs.enable {
chvp = {
emacs.package = emacsPkg;
zfs.homeLinks = [
{ path = ".emacs.d"; type = "cache"; }
];
};
home-manager.users.charlotte = { ... }: {
programs.emacs = {
services.emacs = {
enable = true;
package = pkgs.emacsWithPackagesFromUsePackage {
config = ./emacs/init.el;
package = pkgs.emacsPgtk;
alwaysEnsure = true;
extraEmacsPackages = epkgs: [
# mu4e is included in the mu package and should be used from there
pkgs.mu
];
};
client.enable = true;
package = emacsPkg;
};
home = {
file = {
".emacs.d/early-init.el".source = ./emacs/early-init.el;
".emacs.d/init.el".source = ./emacs/init.el;
};
packages = [
(pkgs.writeShellScriptBin "emacs" ''
${emacsPkg}/bin/emacsclient -c $@
'')
];
sessionVariables = { EDITOR = "emacs"; };
};
};

View file

@ -35,7 +35,7 @@
"hv" '(describe-variable :which-key "variable")
"q" '(:ignore t :which-key "quit")
"qq" '(save-buffers-kill-emacs :which-key "quit")
"qq" '(delete-frame :which-key "quit")
"s" '(:ignore t :which-key "search")
@ -394,14 +394,14 @@
(setq inhibit-startup-screen t)
;; Font configuration
(when window-system (set-frame-font "Fira Code 9"))
(defun emoji-fonts ()
"Setup emoji font priorities."
(defun font-settings ()
"Setup font settings."
(when window-system (set-frame-font "Fira Code 9"))
(set-fontset-font t 'symbol "Noto Color Emoji")
(set-fontset-font t 'symbol "Symbola" nil 'append))
(if (daemonp)
(add-hook 'server-after-make-frame-hook #'emoji-fonts)
(emoji-fonts))
(add-hook 'server-after-make-frame-hook #'font-settings)
(font-settings))
(provide 'init)
;;; init.el ends here