forked from colonelpanic/dotfiles
Apply named-builder to emacs-version-predicate
This commit is contained in:
parent
47c0ec4302
commit
98c0ddb2a9
@ -392,17 +392,6 @@ The packages in this section provide no functionality on their own, but provide
|
|||||||
:demand t)
|
:demand t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Macros
|
** 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
|
*** Named Build
|
||||||
imalison:named-build provides a way to invoke a macro in such a way
|
imalison:named-build provides a way to invoke a macro in such a way
|
||||||
that the lambda that it produces is given a name.
|
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
|
`(imalison:named-builder-builder
|
||||||
,name ,(intern (concat (symbol-name name) "-fn"))))
|
,name ,(intern (concat (symbol-name name) "-fn"))))
|
||||||
#+END_SRC
|
#+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
|
*** Compose Functions
|
||||||
**** A version supporting macros
|
**** A version supporting macros
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
Loading…
Reference in New Issue
Block a user