From c45e2c49181db4223c7523fa11b79b4c00c81d12 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 5 Nov 2017 17:16:13 +0100 Subject: [PATCH] General & minor refactor+cleanup --- Makefile | 4 ++-- bin/org-tangle | 6 +++--- core/autoload/test.el | 25 ++++++++++++------------- core/core-keybinds.el | 8 +++----- core/core.el | 3 ++- modules/lang/go/README.org | 2 +- modules/lang/java/+eclim.el | 6 +++--- modules/ui/doom-modeline/config.el | 14 +++++++------- 8 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index a55b469a2..8dd16541f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ MODULES=$(patsubst modules/%, %, $(shell find modules/ -maxdepth 2 -type d)) all: autoloads autoremove install -## Aliases +## Shortcuts a: autoloads i: install u: update @@ -77,7 +77,7 @@ run: # Diagnoses potential OS/environment issues doctor: - @./bin/doom-doctor + @bin/doom-doctor ## Internal tasks init.el: diff --git a/bin/org-tangle b/bin/org-tangle index c1ed45d67..0843c66b0 100755 --- a/bin/org-tangle +++ b/bin/org-tangle @@ -1,5 +1,5 @@ -#!/bin/sh -":"; exec emacs --no-site-file --script "$0" -- "$@" # -*-emacs-lisp-*- +#!emacs --script +;;; bin/org-tangle -*- lexical-binding: t; -*- ;; Extracts source blocks from org files and prints them to stdout. Debug/info ;; messages are directed to stderr and can be ignored. -l/--lang can be used to @@ -10,7 +10,7 @@ ;; org-tangle modules/ui/doom/README.org > install_fira_mono.sh ;; org-tangle -l sh modules/lang/go/README.org | sh -(load "~/.emacs.d/core/core.el" nil t) +(load (expand-file-name "../core/core.el" (file-name-directory load-file-name)) nil t) (require 'org-install) (require 'org) diff --git a/core/autoload/test.el b/core/autoload/test.el index a49bffc1b..8a79a3ceb 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -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 diff --git a/core/core-keybinds.el b/core/core-keybinds.el index ed7f96b8b..b2f31fe6f 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -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 diff --git a/core/core.el b/core/core.el index c1825ba06..9bf7360d0 100644 --- a/core/core.el +++ b/core/core.el @@ -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) ;;; diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org index c5a230d72..3447c530e 100644 --- a/modules/lang/go/README.org +++ b/modules/lang/go/README.org @@ -15,7 +15,7 @@ This module adds [[https://golang.org][Go]] support. #+begin_quote I have mixed feelings about Go. It's a decent compromise between C and higher-level languages, is pleasantly straight-forward and elegant, but lacks /native/ support for luxuries I miss from other languages, like generics, optional arguments, and function overloading. You've got to learn to love ~interface{}~. -Still, Go has been a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects. +Still, Go is a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects. #+end_quote * Table of Contents :TOC: diff --git a/modules/lang/java/+eclim.el b/modules/lang/java/+eclim.el index 7e8059480..3e9c97dc9 100644 --- a/modules/lang/java/+eclim.el +++ b/modules/lang/java/+eclim.el @@ -46,9 +46,9 @@ (map! :map java-mode-map :localleader - :nv "r" #'+java/refactor-menu - :nv "c" #'+java/compile-menu - :nv "p" #'+java/project-menu)) + "r" #'+java/refactor-menu + "c" #'+java/compile-menu + "p" #'+java/project-menu)) (def-package! company-emacs-eclim diff --git a/modules/ui/doom-modeline/config.el b/modules/ui/doom-modeline/config.el index 8f03143b6..b0112da84 100644 --- a/modules/ui/doom-modeline/config.el +++ b/modules/ui/doom-modeline/config.el @@ -110,22 +110,22 @@ file-name => comint.el") :group 'doom) (defface doom-modeline-buffer-path - '((t (:inherit mode-line-emphasis :bold t))) + '((t (:inherit (mode-line-emphasis bold)))) "Face used for the dirname part of the buffer path." :group '+doom-modeline) (defface doom-modeline-buffer-file - '((t (:inherit mode-line-buffer-id))) + '((t (:inherit (mode-line-buffer-id bold)))) "Face used for the filename part of the mode-line buffer path." :group '+doom-modeline) (defface doom-modeline-buffer-modified - '((t (:inherit error :background nil :bold t))) + '((t (:inherit (error bold) :background nil))) "Face used for the 'unsaved' symbol in the mode-line." :group '+doom-modeline) (defface doom-modeline-buffer-major-mode - '((t (:inherit mode-line-emphasis :bold t))) + '((t (:inherit (mode-line-emphasis bold)))) "Face used for the major-mode segment in the mode-line." :group '+doom-modeline) @@ -141,17 +141,17 @@ file-name => comint.el") :group '+doom-modeline) (defface doom-modeline-info - `((t (:inherit success :bold t))) + `((t (:inherit (success bold)))) "Face for info-level messages in the modeline. Used by `*vc'." :group '+doom-modeline) (defface doom-modeline-warning - `((t (:inherit warning :bold t))) + `((t (:inherit (warning bold)))) "Face for warnings in the modeline. Used by `*flycheck'" :group '+doom-modeline) (defface doom-modeline-urgent - `((t (:inherit error :bold t))) + `((t (:inherit (error bold)))) "Face for errors in the modeline. Used by `*flycheck'" :group '+doom-modeline)