From daa883caf825a430e0e34fd73cd0137377d0b7ab Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 6 Jan 2024 17:58:18 +0800 Subject: [PATCH] feat: use emacs29-pgtk on NixOS, and emacs29-macport for macOS --- Justfile | 21 +++++++++++---------- home/base/desktop/editors/emacs/default.nix | 11 +++++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Justfile b/Justfile index df0ed5d8..24c745d7 100644 --- a/Justfile +++ b/Justfile @@ -155,11 +155,11 @@ fmt: # format the nix files in this repo nix fmt -test-nvim: +nvim-test: rm -rf $"($env.HOME)/.config/astronvim/lua/user" rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/neovim/astronvim_user/ $"($env.HOME)/.config/astronvim/lua/user" -test-nvim-clean: +nvim-clean: rm -rf $"($env.HOME)/.config/astronvim/lua/user" # ================================================= @@ -180,18 +180,19 @@ reload-emacs-cmd := if os() == "macos" { + "systemctl --user status emacs.service" } -test-emacs: +emacs-test: rm -rf $"($env.HOME)/.config/doom" rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom" doom sync + doom clean + +emacs-clean: + rm -rf $"($env.HOME)/.config/doom/" + +emacs-purge: doom purge doom clean doom sync + +emacs-reload: {{reload-emacs-cmd}} - -reload-emacs: - {{reload-emacs-cmd}} - -test-emacs-clean: - rm -rf $"($env.HOME)/.config/doom/" - diff --git a/home/base/desktop/editors/emacs/default.nix b/home/base/desktop/editors/emacs/default.nix index ebaa0593..ad6a8e26 100644 --- a/home/base/desktop/editors/emacs/default.nix +++ b/home/base/desktop/editors/emacs/default.nix @@ -78,9 +78,11 @@ in { } (mkIf pkgs.stdenv.isLinux ( - # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. let - emacsPkg = pkgs.emacs29; + # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. + # pgtk (pure gtk) build add native support for wayland. + # https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases + emacsPkg = pkgs.emacs29-pgtk; in { home.packages = [emacsPkg]; services.emacs = { @@ -92,9 +94,10 @@ in { )) (mkIf pkgs.stdenv.isDarwin ( - # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. let - emacsPkg = pkgs.emacs29; + # macport adds some native features based on GNU Emacs 29 + # https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac + emacsPkg = pkgs.emacs29-macport; in { home.packages = [emacsPkg]; launchd.enable = true;