From 4ba476f94992247cd54541ac09b0a516660f20e5 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 18 Nov 2015 22:28:13 +0300 Subject: emacs: Add 'guix-keyword-args-let'. * emacs/guix-utils.el (guix-keyword-args-let): New macro. (guix-utils-font-lock-keywords): Add it. * emacs/guix-base.el (guix-define-buffer-type): Use it. * emacs/guix-list.el (guix-list-define-entry-type): Use it. * emacs/guix-read.el (guix-define-readers): Use it. --- emacs/guix-read.el | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'emacs/guix-read.el') diff --git a/emacs/guix-read.el b/emacs/guix-read.el index e60af9c2f7..82eccbd678 100644 --- a/emacs/guix-read.el +++ b/emacs/guix-read.el @@ -66,26 +66,14 @@ keywords are available: `-string' function returning a string of multiple values separated the specified separator will be defined." - (let (completions-var - completions-getter - single-reader - single-prompt - multiple-reader - multiple-prompt - multiple-separator) - - ;; Process the keyword args. - (while (keywordp (car args)) - (pcase (pop args) - (`:completions-var (setq completions-var (pop args))) - (`:completions-getter (setq completions-getter (pop args))) - (`:single-reader (setq single-reader (pop args))) - (`:single-prompt (setq single-prompt (pop args))) - (`:multiple-reader (setq multiple-reader (pop args))) - (`:multiple-prompt (setq multiple-prompt (pop args))) - (`:multiple-separator (setq multiple-separator (pop args))) - (_ (pop args)))) - + (guix-keyword-args-let args + ((completions-var :completions-var) + (completions-getter :completions-getter) + (single-reader :single-reader) + (single-prompt :single-prompt) + (multiple-reader :multiple-reader) + (multiple-prompt :multiple-prompt) + (multiple-separator :multiple-separator)) (let ((completions (cond ((and completions-var completions-getter) `(or ,completions-var -- cgit 1.4.1