Merge pull request #250577 from shlevy/nix-buffer-new-emacs

nixBufferBuilders fixes

authored by Shea Levy and committed by GitHub c7417f5a 88160d55

+4 -4
+4 -4
pkgs/build-support/emacs/buffer.nix
··· 15 (when (eq nixpkgs--buffer-count 0) 16 (make-variable-buffer-local 'nixpkgs--is-nixpkgs-buffer) 17 ; When generating a new temporary buffer (one whose name starts with a space), do inherit-local inheritance and make it a nixpkgs buffer 18 - (defun nixpkgs--around-generate (orig name) 19 (if (and nixpkgs--is-nixpkgs-buffer (eq (aref name 0) ?\s)) 20 - (let ((buf (funcall orig name))) 21 (progn 22 (inherit-local-inherit-child buf) 23 (with-current-buffer buf 24 (setq nixpkgs--buffer-count (1+ nixpkgs--buffer-count)) 25 (add-hook 'kill-buffer-hook 'nixpkgs--decrement-buffer-count nil t))) 26 buf) 27 - (funcall orig name))) 28 (advice-add 'generate-new-buffer :around #'nixpkgs--around-generate) 29 ; When we have no more nixpkgs buffers, tear down the buffer handling 30 (defun nixpkgs--decrement-buffer-count () ··· 45 (setenv "PATH" (concat "${lib.makeSearchPath "bin" pkgs}:" (getenv "PATH"))) 46 (inherit-local-permanent exec-path (append '(${builtins.concatStringsSep " " (map (p: "\"${p}/bin\"") pkgs)}) exec-path)) 47 48 - (inherit-local-permanent eshell-path-env (concat "${lib.makeSearchPath "bin" pkgs}:" eshell-path-env)) 49 50 (setq nixpkgs--is-nixpkgs-buffer t) 51 (inherit-local 'nixpkgs--is-nixpkgs-buffer)
··· 15 (when (eq nixpkgs--buffer-count 0) 16 (make-variable-buffer-local 'nixpkgs--is-nixpkgs-buffer) 17 ; When generating a new temporary buffer (one whose name starts with a space), do inherit-local inheritance and make it a nixpkgs buffer 18 + (defun nixpkgs--around-generate (orig name &optional ibh) 19 (if (and nixpkgs--is-nixpkgs-buffer (eq (aref name 0) ?\s)) 20 + (let ((buf (funcall orig name ibh))) 21 (progn 22 (inherit-local-inherit-child buf) 23 (with-current-buffer buf 24 (setq nixpkgs--buffer-count (1+ nixpkgs--buffer-count)) 25 (add-hook 'kill-buffer-hook 'nixpkgs--decrement-buffer-count nil t))) 26 buf) 27 + (funcall orig name ibh))) 28 (advice-add 'generate-new-buffer :around #'nixpkgs--around-generate) 29 ; When we have no more nixpkgs buffers, tear down the buffer handling 30 (defun nixpkgs--decrement-buffer-count () ··· 45 (setenv "PATH" (concat "${lib.makeSearchPath "bin" pkgs}:" (getenv "PATH"))) 46 (inherit-local-permanent exec-path (append '(${builtins.concatStringsSep " " (map (p: "\"${p}/bin\"") pkgs)}) exec-path)) 47 48 + (inherit-local-permanent eshell-path-env (concat "${lib.makeSearchPath "bin" pkgs}:" (if (boundp 'eshell-path-env) eshell-path-env (getenv "PATH")))) 49 50 (setq nixpkgs--is-nixpkgs-buffer t) 51 (inherit-local 'nixpkgs--is-nixpkgs-buffer)