summary refs log tree commit diff
path: root/emacs/guix-base.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-11-20 21:25:10 +0300
committerAlex Kost <alezost@gmail.com>2016-01-02 17:25:35 +0300
commit9193fb7c1dedcf2233287baa819a9c9ded8242a8 (patch)
treee0eab450b51b5f3ae2300bf486fd9da2bda1b990 /emacs/guix-base.el
parent7735c503b5b8dfe7d8963207f4f2cf0b7dfd3894 (diff)
downloadguix-9193fb7c1dedcf2233287baa819a9c9ded8242a8.tar.gz
emacs: info: Split 'guix-info-format' variable.
* emacs/guix-info.el: Generate 'guix-ENTRY-TYPE-info-format' variables
  for 'package', 'installed-output', 'output' and 'generation' entry
  types.
  (guix-info-format): Remove.
  (guix-info-data): New variable.
  (guix-info-value): New procedure.
  (guix-info-define-interface): Add ':format' keyword.
* emacs/guix-base.el (guix-buffer-define-interface): Add ':reduced?'
  keyword.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
Diffstat (limited to 'emacs/guix-base.el')
-rw-r--r--emacs/guix-base.el55
1 files changed, 31 insertions, 24 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 67b83cfbe3..6fa03064b8 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -358,7 +358,9 @@ Optional keywords:
     `guix-TYPE-history-size' variable.
 
   - `:revert-confirm?' - default value of the generated
-    `guix-TYPE-revert-confirm' variable."
+    `guix-TYPE-revert-confirm' variable.
+
+  - `:reduced?' - if non-nil, generate only group and faces group."
   (declare (indent 2))
   (let* ((entry-type-str     (symbol-name entry-type))
          (buffer-type-str    (symbol-name buffer-type))
@@ -382,7 +384,8 @@ Optional keywords:
                              (format "*Guix %s %s*"
                                      Entry-type-str Buffer-type-str))
          (history-size-val   :history-size 20)
-         (revert-confirm-val :revert-confirm? t))
+         (revert-confirm-val :revert-confirm? t)
+         (reduced?           :reduced?))
       `(progn
          (defgroup ,group nil
            ,(format "Display '%s' entries in '%s' buffer."
@@ -395,34 +398,38 @@ Optional keywords:
                     entry-type-str buffer-type-str)
            :group ',(intern (concat "guix-" buffer-type-str "-faces")))
 
-         (defcustom ,buffer-name-var ,buffer-name-val
-           ,(format "\
+         ,(unless reduced?
+            `(progn
+               (defcustom ,buffer-name-var ,buffer-name-val
+                 ,(format "\
 Default name of '%s' buffer for displaying '%s' entries."
-                    buffer-type-str entry-type-str)
-           :type 'string
-           :group ',group)
+                          buffer-type-str entry-type-str)
+                 :type 'string
+                 :group ',group)
 
-         (defcustom ,history-size-var ,history-size-val
-           ,(format "\
+               (defcustom ,history-size-var ,history-size-val
+                 ,(format "\
 Maximum number of items saved in history of `%S' buffer.
 If 0, the history is disabled."
-                    buffer-name-var)
-           :type 'integer
-           :group ',group)
+                          buffer-name-var)
+                 :type 'integer
+                 :group ',group)
 
-         (defcustom ,revert-confirm-var ,revert-confirm-val
-           ,(format "\
+               (defcustom ,revert-confirm-var ,revert-confirm-val
+                 ,(format "\
 If non-nil, ask to confirm for reverting `%S' buffer."
-                    buffer-name-var)
-           :type 'boolean
-           :group ',group)
-
-         (define-derived-mode ,mode ,parent-mode ,(concat "Guix-" Buffer-type-str)
-           ,(concat "Major mode for displaying information about " entry-str ".\n\n"
-                    "\\{" mode-map-str "}")
-           (setq-local revert-buffer-function 'guix-revert-buffer)
-           (setq-local guix-history-size ,history-size-var)
-           (and (fboundp ',mode-init-fun) (,mode-init-fun)))))))
+                          buffer-name-var)
+                 :type 'boolean
+                 :group ',group)
+
+               (define-derived-mode ,mode ,parent-mode
+                 ,(concat "Guix-" Buffer-type-str)
+                 ,(concat "Major mode for displaying information about "
+                          entry-str ".\n\n"
+                          "\\{" mode-map-str "}")
+                 (setq-local revert-buffer-function 'guix-revert-buffer)
+                 (setq-local guix-history-size ,history-size-var)
+                 (and (fboundp ',mode-init-fun) (,mode-init-fun)))))))))
 
 
 ;;; Getting and displaying info about packages and generations