General cleanup

This commit is contained in:
Henrik Lissner 2017-02-08 02:02:51 -05:00
parent a18e8f0104
commit 9bd8c6cc21
6 changed files with 14 additions and 33 deletions

View file

@ -38,6 +38,6 @@ test:
@$(EMACS) -l test/init.el -f 'doom!run-tests' @$(EMACS) -l test/init.el -f 'doom!run-tests'
init.el: init.el:
@[ -f init.el ] || $(error No init.el file, please create one or copy init.example.el) @[ -f init.el ] || $(error No init.el file; create one or copy init.example.el)
.PHONY: all test .PHONY: all test

View file

@ -3,12 +3,13 @@
(defvar-local doom-buffer--narrowed-origin nil) (defvar-local doom-buffer--narrowed-origin nil)
;;;###autoload
(defvar doom-fallback-buffer "*scratch*" (defvar doom-fallback-buffer "*scratch*"
"The name of the buffer to fall back to if no other buffers exist (will create "The name of the buffer to fall back to if no other buffers exist (will create
it if it doesn't exist).") it if it doesn't exist).")
(defvar doom-buffers-unreal-alist (defvar doom-buffers-unreal
'("^ ?\\*.+" image-mode dired-mode reb-mode messages-buffer-mode '("^ ?\\*" image-mode dired-mode reb-mode messages-buffer-mode
tabulated-list-mode comint-mode magit-mode) tabulated-list-mode comint-mode magit-mode)
"A list of regexps or modes whose buffers are considered unreal, and will be "A list of regexps or modes whose buffers are considered unreal, and will be
ignored when using `doom:next-real-buffer' and `doom:previous-real-buffer' (or ignored when using `doom:next-real-buffer' and `doom:previous-real-buffer' (or
@ -125,7 +126,7 @@ See `doom-real-buffer-p' for what 'real' means."
(catch 'goto (catch 'goto
(if (or (not buffers) (if (or (not buffers)
(= (length buffers) 1)) (= (length buffers) 1))
(progn (message "No other buffers in workgroup") (progn (message "No other buffers in workspace")
(throw 'goto fail-buffer)) (throw 'goto fail-buffer))
(funcall move-func) (funcall move-func)
(while (not (memq (current-buffer) buffers)) (while (not (memq (current-buffer) buffers))

View file

@ -4,9 +4,6 @@
(require 's) (require 's)
(require 'f) (require 'f)
(defvar +evil-leader)
(defvar +evil-localleader)
(defvar __DIR__ nil "The directory of the currently loaded file (set by `load!')") (defvar __DIR__ nil "The directory of the currently loaded file (set by `load!')")
(defvar __FILE__ nil "The full path of the currently loaded file (set by `load!')") (defvar __FILE__ nil "The full path of the currently loaded file (set by `load!')")
@ -50,7 +47,7 @@
;; ;;
(defmacro λ! (&rest body) (defmacro λ! (&rest body)
"A shortcut for inline keybind lambdas." "A shortcut for inline interactive lambdas."
(declare (doc-string 1)) (declare (doc-string 1))
`(lambda () (interactive) ,@body)) `(lambda () (interactive) ,@body))
@ -154,7 +151,6 @@ Examples:
(put ':leader 'lisp-indent-function 'defun) (put ':leader 'lisp-indent-function 'defun)
(put ':localleader 'lisp-indent-function 'defun) (put ':localleader 'lisp-indent-function 'defun)
;;;###autoload
(defmacro map! (&rest rest) (defmacro map! (&rest rest)
"A nightmare of a key-binding macro that will use `evil-define-key*', "A nightmare of a key-binding macro that will use `evil-define-key*',
`define-key', `local-set-key' and `global-set-key' depending on context and `define-key', `local-set-key' and `global-set-key' depending on context and
@ -293,20 +289,5 @@ Example
(t (user-error "Invalid key %s" key)))) (t (user-error "Invalid key %s" key))))
(macroexp-progn (reverse forms))))) (macroexp-progn (reverse forms)))))
(defun doom-os ()
"Returns the OS: arch, debian, macos, general linux, cygwin or windows."
(let ((gnu-linux-p (eq system-type 'gnu/linux)))
(cond ((and gnu-linux-p (f-exists-p "/etc/arch-release"))
'arch)
((and gnu-linux-p (f-exists-p "/etc/debian_version"))
'debian)
(gnu-linux-p
'linux)
((eq system-type 'darwin)
'macos)
((memq system-type '(windows-nt cygwin))
'windows)
(t (error "Unknown OS: %s" system-type)))))
(provide 'core-lib) (provide 'core-lib)
;;; core-lib.el ends here ;;; core-lib.el ends here

View file

@ -3,6 +3,7 @@
;; I want Emacs to be nominally aware of the projects. `projectile' provides ;; I want Emacs to be nominally aware of the projects. `projectile' provides
;; tools for digging through project files and exposing an API I can use to make ;; tools for digging through project files and exposing an API I can use to make
;; other plugins/features project-aware. ;; other plugins/features project-aware.
(package! projectile :demand t (package! projectile :demand t
:init :init
(setq projectile-cache-file (concat doom-cache-dir "/projectile.cache") (setq projectile-cache-file (concat doom-cache-dir "/projectile.cache")

View file

@ -9,10 +9,11 @@
;; doom|... A hook ;; doom|... A hook
;; doom*... An advising function ;; doom*... An advising function
;; ...! Macro, shortcut alias or defsubst ;; ...! Macro, shortcut alias or defsubst
;; @... lambda macro for keybinds ;; @... A generator macro for keybinds
;; +... Any of the above, but part of a module, e.g. +emacs-lisp|init-hook ;; +... Any of the above, but part of a module, e.g. +emacs-lisp|init-hook
;; ;;
;;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el ;; Autoloaded functions are in core/autoload/*.el and modules/*/*/autoload.el or
;; modules/*/*/autoload/*.el.
(when (version< emacs-version "25.1") (when (version< emacs-version "25.1")
(error "DOOM Emacs no longer supports Emacs <25.1! Time to upgrade!")) (error "DOOM Emacs no longer supports Emacs <25.1! Time to upgrade!"))
@ -132,15 +133,12 @@ enable multiple minor modes for the same regexp.")
;;; Let 'er rip ;;; Let 'er rip
(require 'core-lib) (require 'core-lib)
(doom-initialize-autoloads)
(unless noninteractive (unless noninteractive
(require 'core-ui) ; draw me like one of your French editors (require 'core-ui) ; draw me like one of your French editors
(require 'core-popups) ; taming sudden yet inevitable windows (require 'core-popups) ; taming sudden yet inevitable windows
(require 'core-editor) ; baseline configuration for text editing (require 'core-editor) ; baseline configuration for text editing
(require 'core-projects)) ; making Emacs project-aware (require 'core-projects))) ; making Emacs project-aware
;; We do this last to promise that core files will not use autoloaded files.
;; If they did, those functions shouldn't be autoloaded!
(doom-initialize-autoloads))
(provide 'core) (provide 'core)
;;; core.el ends here ;;; core.el ends here

View file

@ -71,7 +71,7 @@
(hash (gethash project-path npm-conf)) (hash (gethash project-path npm-conf))
(package-file (expand-file-name "package.json" project-path)) (package-file (expand-file-name "package.json" project-path))
deps) deps)
(when-let (json (and (not hash) (f-exists? package-file) (-when-let (json (and (not hash) (f-exists? package-file)
(ignore-errors (json-read-file package-file)))) (ignore-errors (json-read-file package-file))))
(puthash project-path json npm-conf)))) (puthash project-path json npm-conf))))