General & minor refactor+cleanup

This commit is contained in:
Henrik Lissner 2017-11-05 17:16:13 +01:00
parent 0c2b1b5a93
commit c45e2c4918
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 33 additions and 35 deletions

View file

@ -16,19 +16,18 @@ If neither is available, run all tests in all enabled modules."
(load (expand-file-name "core/core.el" user-emacs-directory) nil t)
(doom-initialize-modules nil))
;; collect targets
(cond ((and command-line-args-left
(equal (car command-line-args-left) "--"))
(cl-loop for arg in (cdr argv)
(cond ((and argv (equal (car argv) "--"))
(cl-loop for arg in argv
if (equal arg "core")
do (push (expand-file-name "test/" doom-core-dir) targets)
do (push (expand-file-name "test/" doom-core-dir) targets)
else
collect
(cl-destructuring-bind (car &optional cdr) (split-string arg "/" t)
(cons (intern (concat ":" car))
(and cdr (intern cdr))))
into args
finally do (setq modules args
command-line-args-left nil)))
collect
(cl-destructuring-bind (car &optional cdr) (split-string arg "/" t)
(cons (intern (concat ":" car))
(and cdr (intern cdr))))
into args
finally do
(setq modules args argv nil)))
(modules
(unless (cl-loop for module in modules
@ -58,8 +57,8 @@ If neither is available, run all tests in all enabled modules."
collect (expand-file-name "test/" path))))
for dir in targets
if (file-directory-p dir)
nconc (reverse (directory-files-recursively dir "\\.el$"))
into items
nconc (reverse (directory-files-recursively dir "\\.el$"))
into items
finally do (quiet! (mapc #'load-file items)))
;; run all loaded tests
(when noninteractive

View file

@ -110,10 +110,8 @@
For example, :nvi will map to (list 'normal 'visual 'insert). See
`doom-evil-state-alist' to customize this."
(cl-loop for l across (substring (symbol-name keyword) 1)
if (cdr (assq l doom-evil-state-alist))
collect it
else
do (error "not a valid state: %s" l)))
if (cdr (assq l doom-evil-state-alist)) collect it
else do (error "not a valid state: %s" l)))
;; Register keywords for proper indentation (see `map!')
@ -259,7 +257,7 @@ Example
(setq def (pop rest))
(when desc
(push `(doom--keybind-register ,(key-description (eval key))
,desc ',modes)
,desc ',modes)
forms))
(cond ((and doom--local doom--keymaps)
(push `(lwarn 'doom-map :warning

View file

@ -162,7 +162,8 @@ ability to invoke the debugger in debug mode."
;; reset it to a reasonable default.
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1
file-name-handler-alist doom--file-name-handler-alist))
file-name-handler-alist doom--file-name-handler-alist)
t)
;;;