Remove some anaphoric forms

This commit is contained in:
Henrik Lissner 2016-10-02 23:28:02 +02:00
parent cd9654d637
commit eacfc39fb3
3 changed files with 18 additions and 14 deletions

View file

@ -44,10 +44,10 @@ workgroup."
(let ((buffers (if (wg-current-workgroup t) (let ((buffers (if (wg-current-workgroup t)
(doom/get-buffers-in-workgroup) (doom/get-buffers-in-workgroup)
(buffer-list))) (buffer-list)))
project-root) (project-root (and (not all-p) (doom/project-root t))))
(append (aif (and (not all-p) (doom/project-root t)) (append (if project-root
(funcall (if (eq all-p 'not) '-remove '-filter) (funcall (if (eq all-p 'not) '-remove '-filter)
(lambda (b) (projectile-project-buffer-p b it)) (lambda (b) (projectile-project-buffer-p b project-root))
buffers) buffers)
buffers) buffers)
(list doom-buffer)))) (list doom-buffer))))

View file

@ -79,10 +79,11 @@ evil-window-move-* (e.g. `evil-window-move-far-left')"
;;;###autoload ;;;###autoload
(defun doom/close-frame () (defun doom/close-frame ()
(interactive) (interactive)
(aif (assq (selected-frame) doom-wg-frames) (let ((frame (assq (selected-frame) doom-wg-frames)))
(progn (wg-delete-workgroup (wg-get-workgroup (cdr it))) (if frame
(delete-frame (car it))) (progn (wg-delete-workgroup (wg-get-workgroup (cdr frame)))
(delete-frame))) (delete-frame (car frame)))
(delete-frame))))
;;;###autoload ;;;###autoload
(defun doom/evil-window-resize (direction &optional count) (defun doom/evil-window-resize (direction &optional count)

View file

@ -24,21 +24,24 @@
;;;###autoload ;;;###autoload
(defun doom/ert-run-test () (defun doom/ert-run-test ()
(interactive) (interactive)
(let (case-fold-search) (let (case-fold-search thing)
(doom--ert-pre) (doom--ert-pre)
(aif (thing-at-point 'defun t) (setq thing (thing-at-point 'defun t))
(if (string-match "(ert-deftest \\([^ ]+\\)" it) (if thing
(ert-run-tests-interactively (substring it (match-beginning 1) (match-end 1))) (if (string-match "(ert-deftest \\([^ ]+\\)" thing)
(ert-run-tests-interactively
(substring thing (match-beginning 1) (match-end 1)))
(user-error "Invalid test at point")) (user-error "Invalid test at point"))
(user-error "No test found at point")))) (user-error "No test found at point"))))
;;;###autoload ;;;###autoload
(defun doom/ert-rerun-test () (defun doom/ert-rerun-test ()
(interactive) (interactive)
(let (case-fold-search) (let (case-fold-search thing)
(doom--ert-pre) (doom--ert-pre)
(aif (car-safe ert--selector-history) (setq thing (car-safe ert--selector-history))
(ert-run-tests-interactively it) (if thing
(ert-run-tests-interactively thing)
(message "No test found in history, looking for test at point") (message "No test found in history, looking for test at point")
(doom/ert-run-test)))) (doom/ert-run-test))))