From 994f2560d0931b1714f5ae6e86dbd567dd70f8d8 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 17 Aug 2023 10:38:37 -0400 Subject: [PATCH 1/2] Fix nixBufferBuilders for newer emacs --- pkgs/build-support/emacs/buffer.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/emacs/buffer.nix b/pkgs/build-support/emacs/buffer.nix index b8bd4584e32..9ef77a37557 100644 --- a/pkgs/build-support/emacs/buffer.nix +++ b/pkgs/build-support/emacs/buffer.nix @@ -15,16 +15,16 @@ rec { (when (eq nixpkgs--buffer-count 0) (make-variable-buffer-local 'nixpkgs--is-nixpkgs-buffer) ; When generating a new temporary buffer (one whose name starts with a space), do inherit-local inheritance and make it a nixpkgs buffer - (defun nixpkgs--around-generate (orig name) + (defun nixpkgs--around-generate (orig name &optional ibh) (if (and nixpkgs--is-nixpkgs-buffer (eq (aref name 0) ?\s)) - (let ((buf (funcall orig name))) + (let ((buf (funcall orig name ibh))) (progn (inherit-local-inherit-child buf) (with-current-buffer buf (setq nixpkgs--buffer-count (1+ nixpkgs--buffer-count)) (add-hook 'kill-buffer-hook 'nixpkgs--decrement-buffer-count nil t))) buf) - (funcall orig name))) + (funcall orig name ibh))) (advice-add 'generate-new-buffer :around #'nixpkgs--around-generate) ; When we have no more nixpkgs buffers, tear down the buffer handling (defun nixpkgs--decrement-buffer-count () From bf7a81d8ddb8beb92609fad6a4dc78996b4e4b73 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 18 Aug 2023 04:49:33 -0400 Subject: [PATCH 2/2] nixBufferBuilders: Don't assume the user has used eshell --- pkgs/build-support/emacs/buffer.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/emacs/buffer.nix b/pkgs/build-support/emacs/buffer.nix index 9ef77a37557..48a7996916e 100644 --- a/pkgs/build-support/emacs/buffer.nix +++ b/pkgs/build-support/emacs/buffer.nix @@ -45,7 +45,7 @@ rec { (setenv "PATH" (concat "${lib.makeSearchPath "bin" pkgs}:" (getenv "PATH"))) (inherit-local-permanent exec-path (append '(${builtins.concatStringsSep " " (map (p: "\"${p}/bin\"") pkgs)}) exec-path)) - (inherit-local-permanent eshell-path-env (concat "${lib.makeSearchPath "bin" pkgs}:" eshell-path-env)) + (inherit-local-permanent eshell-path-env (concat "${lib.makeSearchPath "bin" pkgs}:" (if (boundp 'eshell-path-env) eshell-path-env (getenv "PATH")))) (setq nixpkgs--is-nixpkgs-buffer t) (inherit-local 'nixpkgs--is-nixpkgs-buffer)