guix-commits
[Top][All Lists]
Advanced

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

31/35: emacs: Add 'list-single' variables.


From: Alex Kost
Subject: 31/35: emacs: Add 'list-single' variables.
Date: Fri, 11 Dec 2015 11:42:43 +0000

alezost pushed a commit to branch wip-refactor-emacs-ui
in repository guix.

commit 5169a4e07cceb8bf281ee2e095b1d66eb92abc4a
Author: Alex Kost <address@hidden>
Date:   Wed Dec 9 21:58:36 2015 +0300

    emacs: Add 'list-single' variables.
    
    * emacs/guix-list.el (guix-list-single-entry?): New procedure.
      (guix-list-define-interface): Add ':list-single?' key and generate
      'guix-ENTRY-TYPE-list-single' variables.
    * emacs/guix-ui-package.el (guix-package-list-single): Remove.
---
 emacs/guix-list.el       |   18 ++++++++++++++++++
 emacs/guix-ui-package.el |    6 ------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/emacs/guix-list.el b/emacs/guix-list.el
index 719642a..8b37a88 100644
--- a/emacs/guix-list.el
+++ b/emacs/guix-list.el
@@ -97,6 +97,10 @@ This alist is filled by `guix-list-define-interface' macro.")
   "Return alist of additional marks for ENTRY-TYPE."
   (guix-list-value entry-type 'marks))
 
+(defun guix-list-single-entry? (entry-type)
+  "Return non-nil, if a single entry of ENTRY-TYPE should be listed."
+  (guix-list-value entry-type 'list-single))
+
 (defun guix-list-describe-warning-count (entry-type)
   "Return the maximum number of ENTRY-TYPE entries to describe."
   (guix-list-value entry-type 'describe-count))
@@ -422,6 +426,9 @@ Optional keywords:
   - `:describe-function' - default value of the generated
     `guix-ENTRY-TYPE-describe-function' variable.
 
+  - `:list-single?' - default value of the generated
+    `guix-ENTRY-TYPE-list-single' variable.
+
   - `:marks' - default value of the generated
     `guix-ENTRY-TYPE-list-marks' variable.
 
@@ -436,6 +443,7 @@ The rest keyword arguments are passed to
                                              "-describe-warning-count")))
          (format-var         (intern (concat prefix "-format")))
          (sort-key-var       (intern (concat prefix "-sort-key")))
+         (list-single-var    (intern (concat prefix "-single")))
          (marks-var          (intern (concat prefix "-marks"))))
     (guix-keyword-args-let args
         ((show-entries-val   :show-entries-function)
@@ -443,6 +451,7 @@ The rest keyword arguments are passed to
          (describe-count-val :describe-count 10)
          (format-val         :format)
          (sort-key-val       :sort-key)
+         (list-single-val    :list-single?)
          (marks-val          :marks))
       `(progn
          (defcustom ,format-var ,format-val
@@ -485,6 +494,14 @@ Alist of additional marks for 'list' buffer with '%s' 
entries.
 Marks from this list are used along with `guix-list-default-marks'."
                     entry-type-str))
 
+         (defcustom ,list-single-var ,list-single-val
+           ,(format "\
+If non-nil, list '%s' entry even if it is the only matching result.
+If nil, show a single '%s' entry in the 'info' buffer."
+                    entry-type-str entry-type-str)
+           :type 'boolean
+           :group ',group)
+
          (defcustom ,describe-count-var ,describe-count-val
            ,(format "\
 The maximum number of '%s' entries to describe without a warning.
@@ -504,6 +521,7 @@ See also `guix-list-describe'."
             (describe-count . ,describe-count-var)
             (format         . ,format-var)
             (sort-key       . ,sort-key-var)
+            (list-single    . ,list-single-var)
             (marks          . ,marks-var))
           'guix-list-data ',entry-type)
 
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 7cc58dd..c2bb241 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -57,12 +57,6 @@ package data)."
                  (const :tag "Display outputs" output))
   :group 'guix-package)
 
-(defcustom guix-package-list-single nil
-  "If non-nil, list a package even if it is the only matching result.
-If nil, show a single package in the info buffer."
-  :type 'boolean
-  :group 'guix)
-
 (defun guix-package-get-display (profile search-type &rest search-values)
   "Search for packages/outputs and show results.
 



reply via email to

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