[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el |
Date: |
Sat, 29 Jan 2022 08:27:12 -0500 (EST) |
branch: elpa/nix-mode
commit 295cd6729b16797b0e1a133943a70fbe6f7254c4
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Add nix-edit.el
---
nix-edit.el | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/nix-edit.el b/nix-edit.el
new file mode 100644
index 0000000000..3e5c255f34
--- /dev/null
+++ b/nix-edit.el
@@ -0,0 +1,37 @@
+;;; nix-edit.el -- run nix commands in Emacs -*- lexical-binding: t -*-
+
+;; Author: Matthew Bauer <mjbauer95@gmail.com>
+;; Homepage: https://github.com/NixOS/nix-mode
+;; Keywords: nix
+
+;; This file is NOT part of GNU Emacs.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'nix)
+(require 'nix-search)
+
+(defun nix-edit (&optional file attr)
+ "Open the nix log.
+FILE the nix file to load from.
+ATTR the attribute to find in nix expressions."
+ (interactive (list (nix-read-file) nil))
+ (unless attr (setq attr (nix-read-attr file)))
+
+ (let ((stdout (generate-new-buffer "nix-edit"))
+ (process-environment (cons "EDITOR=echo" process-environment))
+ result)
+ (call-process nix-executable nil (list stdout nil) nil
+ "edit" "-f" file attr)
+ (with-current-buffer stdout
+ (when (eq (buffer-size) 0)
+ (error
+ "Error: nix edit failed to produce any output"))
+ (setq result (substring (buffer-string) 0 (- (buffer-size) 1))))
+ (kill-buffer stdout)
+ (find-file result)))
+
+(provide 'nix-edit)
+;;; nix-edit.el ends here
- [nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el, (continued)
- [nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dd49386cc7 240/500: Remove global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ef5d77214 246/500: Add user manual, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2bc99a4542 247/500: Add new CHANGELOG entry., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 14d1bbb936 248/500: Delete dir-locals.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ae2c44c160 250/500: Add nix-shell-haskell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c462eb400b 251/500: Add alias for nix-repl-show, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 47cdb44e2e 255/500: Improve indentation robustness, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1c772ad539 253/500: Remove recommended config, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el,
ELPA Syncer <=
- [nongnu] elpa/nix-mode fde8c8e38c 268/500: Merge pull request #48 from dustinlacewell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 90ac0a74b2 273/500: Merge pull request #55 from teozkr/issue-54, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 563f6bdb03 272/500: Fixed `nix-mode-comments` matching everything, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode abdeae0f23 276/500: Make sure nix-instantiate-executable exists before running it, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 57ea981cb2 278/500: Use eval-when-compile for subr-x, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1512d02830 279/500: Formatting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0c0ec7dbd6 281/500: ert/indent: Add macro to easily test indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7f968e8a7f 284/500: Merge pull request #61 from etu/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ac7b5afb6 287/500: Add indent region function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff0a773d31 297/500: fix-issue-72: Check the correct element from syntax-ppss, ELPA Syncer, 2022/01/29