emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode beb96dce67 3/7: Introduce nix-store-path-omit-sel


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode beb96dce67 3/7: Introduce nix-store-path-omit-self
Date: Fri, 17 Mar 2023 22:00:06 -0400 (EDT)

branch: elpa/nix-mode
commit beb96dce671f59d229ac9859a88d307f65c64d38
Author: Daniel Nagy <danielnagy@posteo.de>
Commit: Daniel Nagy <danielnagy@posteo.de>

    Introduce nix-store-path-omit-self
    
    It can sometimes be considered useless information if, for example, a
    store path lists itself within the requisites or output section. This
    customization option is supposed to help with removing this unintended
    behavior.
---
 CHANGELOG.md | 4 ++++
 nix-store.el | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d6c75c7d3..0790202d74 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## Unreleased (1.6.0)
+
+* Introduce nix-store-path-omit-self customization option.
+
 ## 1.5.0
 
 * Removed json-mode dependency, using js instead.
diff --git a/nix-store.el b/nix-store.el
index aa4600eff1..7f95203f11 100644
--- a/nix-store.el
+++ b/nix-store.el
@@ -21,6 +21,10 @@
   "Nix-store customizations."
   :group 'nix)
 
+(defcustom nix-store-path-omit-self t
+  "Do not list the current entry itself within sections of 
nix-store-path-mode."
+  :package-version '(nix-mode . "1.6.0"))
+
 (defun nix-store-realise (path)
   "Realise a path asynchronously.
 PATH the path within /nix/store to realise"
@@ -112,7 +116,9 @@ information."
   "Helper macro for inserting a list as a magit-section.
 TYPE and VALUE will be used as the type and value of the section
 respectively. The LABEL is the text displayed."
-  `(let ((value ,value))
+  `(let ((value (cl-remove
+                (and nix-store-path-omit-self (nix-store-path-path 
nix-buffer-store-path))
+                ,value :test #'equal)))
      (when (and (listp value) (> (length value) 0))
        (magit-insert-section (,type value)
         (magit-insert-heading ,label)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]