summaryrefslogtreecommitdiff
path: root/emacs/guix-ui.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-12-18 11:19:12 +0300
committerAlex Kost <alezost@gmail.com>2016-01-02 17:25:35 +0300
commit8ed2c92eb12b894e03cc634d92d3c78636f44020 (patch)
treee31b57625ab343994443c2c3ec0c65dc29807537 /emacs/guix-ui.el
parentdc690c445e4b483e6ce2a88f6c23dd19685057cc (diff)
emacs: Add hierarchy of customization groups.
* emacs/guix-buffer.el (guix-define-groups, guix-define-entry-type) (guix-define-buffer-type): New macros. (guix-buffer-define-interface): Add parent groups for the generated custom groups. * emacs/guix-info.el: Use 'guix-define-buffer-type' to generate custom groups. * emacs/guix-list.el: Likewise. * emacs/guix-ui.el: Use 'guix-define-groups' to generate custom groups. (guix-ui-define-entry-type): New macro. * emacs/guix-ui-package.el: Use it. * emacs/guix-ui-generation.el: Use it.
Diffstat (limited to 'emacs/guix-ui.el')
-rw-r--r--emacs/guix-ui.el23
1 files changed, 18 insertions, 5 deletions
diff --git a/emacs/guix-ui.el b/emacs/guix-ui.el
index 55c3f1b55c..7b63e63378 100644
--- a/emacs/guix-ui.el
+++ b/emacs/guix-ui.el
@@ -31,11 +31,11 @@
(require 'guix-utils)
(require 'guix-messages)
-(defgroup guix-ui nil
- "Settings for Guix package management.
+(guix-define-groups ui
+ :group-doc "\
+Settings for 'ui' (Guix package management) buffers.
This group includes settings for displaying packages, outputs and
-generations in 'list' and 'info' buffers."
- :group 'guix)
+generations in 'list' and 'info' buffers.")
(defvar guix-ui-map
(let ((map (make-sparse-keymap)))
@@ -175,6 +175,18 @@ See `guix-ui-update-after-operation' for details."
;;; Interface definers
+(defmacro guix-ui-define-entry-type (entry-type &rest args)
+ "Define general code for ENTRY-TYPE.
+Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ...
+
+The rest keyword arguments are passed to
+`guix-define-entry-type' macro."
+ (declare (indent 1))
+ `(guix-define-entry-type ,entry-type
+ :parent-group guix-ui
+ :parent-faces-group guix-ui-faces
+ ,@args))
+
(defmacro guix-ui-define-interface (buffer-type entry-type &rest args)
"Define BUFFER-TYPE interface for displaying ENTRY-TYPE entries.
Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ...
@@ -300,7 +312,8 @@ The rest keyword arguments are passed to
(defvar guix-ui-font-lock-keywords
(eval-when-compile
- `((,(rx "(" (group (or "guix-ui-define-interface"
+ `((,(rx "(" (group (or "guix-ui-define-entry-type"
+ "guix-ui-define-interface"
"guix-ui-info-define-interface"
"guix-ui-list-define-interface"))
symbol-end)