Apply named-builder to emacs-version-predicate

This commit is contained in:
Ivan Malison 2016-08-10 18:38:16 -07:00
parent 47c0ec4302
commit 98c0ddb2a9
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -392,17 +392,6 @@ The packages in this section provide no functionality on their own, but provide
:demand t)
#+END_SRC
** Macros
*** Emacs Version Predicate
#+BEGIN_SRC emacs-lisp
(defmacro imalison:emacs-version-predicate (major-version minor-version)
`(lambda ()
(or (> emacs-major-version ,major-version)
(and (>= emacs-major-version ,major-version)
(>= emacs-minor-version ,minor-version)))))
(defun imalison:check-emacs-version (major-version minor-version)
(funcall (imalison:emacs-version-predicate major-version minor-version)))
#+END_SRC
*** Named Build
imalison:named-build provides a way to invoke a macro in such a way
that the lambda that it produces is given a name.
@ -432,6 +421,19 @@ new macro name and the -fn suffix.
`(imalison:named-builder-builder
,name ,(intern (concat (symbol-name name) "-fn"))))
#+END_SRC
*** Emacs Version Predicate
#+BEGIN_SRC emacs-lisp
(defmacro imalison:emacs-version-predicate-fn (major-version minor-version)
`(lambda ()
(or (> emacs-major-version ,major-version)
(and (>= emacs-major-version ,major-version)
(>= emacs-minor-version ,minor-version)))))
(defun imalison:check-emacs-version (major-version minor-version)
(funcall (imalison:emacs-version-predicate-fn major-version minor-version)))
(imalison:named-builder imalison:emacs-version-predicate)
#+END_SRC
*** Compose Functions
**** A version supporting macros
#+BEGIN_SRC emacs-lisp