v1.1.3 bump

+ sp: be quiet
+ popup: load *eval* rule earlier
+ evil-anzu: defer, due to long load time
+ Update makefile
+ Clean up core.el
+ line-spacing = 1, less rpadding on nlinum-format
+ Add *esup* popup rule
+ Refactor doom macro
+ Refactor doom-byte-compile
+ :big [SIZE] + use inconsolata in big-mode
+ :v TAB -> doom/yas-insert-snippet
+ eval: use pop-to-buffer instead of doom/popup-buffer
+ Refactor backspace fn; handle pair deletion issue with sp better
+ \#bringbackwindowsystem
+ db: remove unused var
+ Update init.el
This commit is contained in:
Henrik Lissner 2016-05-28 21:51:21 -04:00
parent df13257ce8
commit fc78d46f30
19 changed files with 86 additions and 76 deletions

View file

@ -6,7 +6,7 @@ all: install autoloads init.elc
# If you run either of these with emacs open, run doom-reload afterwards
install: autoloads _install init.elc
update: autoloads _update init.elc
update: autoloads _update core/core.elc init.elc
autoloads:
@$(EMACS) --batch -l init.el --eval '(doom-reload-autoloads)' 2>&1
@ -31,11 +31,11 @@ clean-cache:
_update:
@cask update 2>&1
@rm -f init.elc
@rm -f init.elc core/core.elc
_install:
@cask install 2>&1
@rm -f init.elc
@rm -f init.elc core/core.elc
@mkdir -p $(CACHE_DIR)/{undo,backup,workgroups}
.PHONY: all

View file

@ -1,34 +1,34 @@
;;; core-defuns.el
;; Bootstrap macro
(defmacro doom (_ default-theme __ term-theme ___ font &rest packages)
(defmacro doom (_ theme __ font &rest packages)
"Bootstrap DOOM emacs and initialize PACKAGES"
`(let ((gc-cons-threshold 339430400)
(gc-cons-percentage 0.6)
file-name-handler-alist)
`(let (file-name-handler-alist)
;; Local settings
(load "~/.emacs.local.el" t t)
;; (load "~/.emacs.local.el" t t)
;; Global constants
(defvar doom-default-theme ,default-theme)
(defvar doom-terminal-theme ,term-theme)
(defvar doom-default-theme ,theme)
(defvar doom-default-font
(font-spec :family ,(nth 0 font)
:size ,(nth 1 font)
:antialias ,(not (nth 2 font))))
(defvar doom-current-theme (if (display-graphic-p) doom-default-theme doom-terminal-theme))
(defvar doom-current-theme doom-default-theme)
(defvar doom-current-font doom-default-font)
(unless noninteractive
,@(mapcar (lambda (pkg) `(require ',pkg))
packages)
(when (display-graphic-p)
(when window-system
(require 'server)
(unless (server-running-p)
(server-start)))
;; Prevent any auto-displayed text + benchmarking
(advice-add 'display-startup-echo-area-message :override 'ignore)
(message ""))))
(message ""))
(setq-default gc-cons-threshold 4388608
gc-cons-percentage 0.4)))
;; Backwards compatible `with-eval-after-load'
(unless (fboundp 'with-eval-after-load)
@ -339,14 +339,20 @@ e.g. (doom-fix-unicode \"DejaVu Sans\" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎
(font-spec :name font :size size) nil 'prepend))
chars))
(defun doom-byte-compile ()
(defun doom-byte-compile (&optional minimal)
"Byte compile the core and library .el files in ~/.emacs.d"
(interactive)
(mapc (lambda (f) (byte-compile-file (concat doom-emacs-dir "/" f)))
'("init.el" "private/my-commands.el" "private/my-bindings.el"
"core/core.el" "core/core-defuns.el" "core/core-ui.el"))
"core/core.el" "core/core-defuns.el" "core/core-ui.el"
"core/core-os.el" "core/core-os-osx.el" "core/core-os-win32.el"
"core/core-os-linux.el"))
(unless minimal
(byte-recompile-directory doom-core-dir 0 t)
(byte-recompile-directory doom-modules-dir 0 t)
(byte-recompile-directory doom-modules-dir 0 t))
(when minimal
(byte-recompile-directory (concat doom-core-dir "/defuns") 0 t)
(byte-recompile-directory (concat doom-modules-dir "/defuns") 0 t))
(message "Compiled!"))
(provide 'core-defuns)

View file

@ -20,8 +20,7 @@
:init (add-hook 'quickrun/mode-hook 'linum-mode)
:config
(setq quickrun-focus-p nil)
(def-popup! "*quickrun*" :align below :size 10)
(def-popup! "*eval*" :align below :size 20))
(def-popup! "*quickrun*" :align below :size 10))
(use-package repl-toggle
:commands (rtog/toggle-repl rtog/add-repl)

View file

@ -205,6 +205,7 @@
:commands (evil-numbers/inc-at-pt evil-numbers/dec-at-pt))
(use-package evil-anzu
:defer 1
:config
(setq anzu-cons-mode-line-p nil
anzu-minimum-input-length 1

View file

@ -12,8 +12,9 @@
(setq shackle-rules
`(;; Util
("^\\*.+-Profiler-Report .+\\*$" :align below :size 0.3 :regexp t)
("*esup*" :align below :size 30 :noselect t)
("*esup*" :align below :size 0.4 :noselect t)
("*minor-modes*" :align below :size 0.5 :noselect t)
("*eval*" :align below :size 20)
;; Emacs
("*Pp Eval Output*" :align below :size 0.3)
("*Apropos*" :align below :size 0.3)

View file

@ -51,7 +51,7 @@
(erase-buffer)
(setq doom-buffer-edited nil)
(insert
(let* ((auto-detect-frame (or auto-detect-frame (not (display-graphic-p))))
(let* ((auto-detect-frame (or auto-detect-frame (not window-system)))
(width (max 3 (- (if auto-detect-frame
(window-width)
(cdr (assq 'width default-frame-alist))) 3)))

View file

@ -6,6 +6,7 @@
(fset 'yes-or-no-p 'y-or-n-p)
(setq-default
line-spacing 1
indicate-buffer-boundaries nil ; don't show where buffer starts/ends
indicate-empty-lines nil ; don't show empty lines
fringes-outside-margins t ; switches order of fringe and margin
@ -42,7 +43,7 @@
;; Initialize UI
(load-theme doom-current-theme t)
(tooltip-mode -1) ; show tooltips in echo area
(if (not (display-graphic-p))
(if (not window-system)
(menu-bar-mode -1)
(scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar
@ -260,7 +261,8 @@
(spaceline-define-segment *anzu
"Show the current match number and the total number of matches. Requires
anzu to be enabled."
(when (evil-ex-hl-active-p 'evil-ex-search)
(when (and (featurep 'evil-anzu)
(evil-ex-hl-active-p 'evil-ex-search))
(powerline-raw
(let ((here anzu--current-position)
(total anzu--total-matched))

View file

@ -14,7 +14,7 @@ defuns/defuns-workgroups.el.")
automatically renamed to the project name.")
(use-package workgroups2
:when (display-graphic-p)
:when window-system
:init
(setq-default
wg-session-file (concat doom-temp-dir "/workgroups/last")

View file

@ -13,6 +13,10 @@
;;
;;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el
;; Premature optimization for faster startup
(setq-default gc-cons-threshold 339430400
gc-cons-percentage 0.6)
(defalias '! 'eval-when-compile)
(defconst doom-emacs-dir (! (expand-file-name user-emacs-directory)))
@ -27,6 +31,9 @@
emacs-major-version emacs-minor-version))
"Hostname and emacs-version-based elisp temp directories")
;; window-system is deprecated. Not on my watch!
(unless (boundp 'window-system)
(defvar window-system (framep-on-display)))
;;
;; Load path
@ -37,7 +44,7 @@
;; Populate the load-path manually; cask shouldn't be an internal dependency
(setq load-path
(! (defsubst --subdirs (path &optional include-self)
(! (defun --subdirs (path &optional include-self)
(let ((result (if include-self (list path) (list))))
(mapc (lambda (file)
(when (file-directory-p file)
@ -67,11 +74,6 @@
(prefer-coding-system 'utf-8) ; with sugar on top
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
;; Premature optimization for faster startup
(setq-default gc-cons-threshold 4388608
gc-cons-percentage 0.3
major-mode 'text-mode)
;; stop package.el from being annoying. I rely solely on Cask.
(setq package--init-file-ensured t
package-enable-at-startup nil
@ -81,10 +83,10 @@
("org" . "http://orgmode.org/elpa/"))
ad-redefinition-action 'accept ; silence the advised function warnings
confirm-nonexistent-file-or-buffer t
compilation-always-kill t ; kill compl. process before spawning another
compilation-ask-about-save nil ; save all buffers before compiling
compilation-scroll-output t ; scroll with output while compiling
confirm-nonexistent-file-or-buffer t
delete-by-moving-to-trash t
echo-keystrokes 0.02 ; show me what I type
ediff-diff-options "-w"
@ -92,6 +94,7 @@
ediff-window-setup-function 'ediff-setup-windows-plain ; no extra frames
enable-recursive-minibuffers nil ; no minibufferception
idle-update-delay 5 ; update a little less often
major-mode 'text-mode
ring-bell-function 'ignore ; silence of the bells!
save-interprogram-paste-before-kill nil
sentence-end-double-space nil
@ -120,8 +123,6 @@
(autoload 'use-package "use-package" "" nil 'macro)
(require 'f)
(require 'dash)
(require 's)
(require 'core-vars)
(require 'core-defuns)
(unless (require 'autoloads nil t)

View file

@ -35,7 +35,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
;; Buffer Life and Death ;;;;;;;;;;;;;;;
(unless (display-graphic-p)
(unless window-system
(defalias 'wg-workgroup-associated-buffers 'ignore)
(defalias 'wg-current-workgroup 'ignore)
(defalias 'wg-save-session 'ignore))

View file

@ -53,16 +53,16 @@ elisp buffer). Otherwise forward the region to Quickrun."
(lines (length (s-lines out))))
(if (< lines 5)
(princ out t)
(with-current-buffer (get-buffer-create "*eval*")
;; (rename-buffer (buffer-name old-buf))
(let ((buf (get-buffer-create "*eval*")))
(with-current-buffer buf
(read-only-mode -1)
(setq-local scroll-margin 0)
(emacs-lisp-mode)
(erase-buffer)
(insert out)
(read-only-mode 1)
(goto-char (point-min))
(doom/popup-buffer (current-buffer))))))
(goto-char (point-min)))
(pop-to-buffer buf)))))
(t (quickrun-region beg end))))
;;;###autoload (autoload 'doom:eval-region-and-replace "defuns-quickrun" nil t)

View file

@ -54,24 +54,22 @@ already there, move it to the true bol."
possible, or just one char if that's not possible."
(interactive)
(let* ((context (sp--get-pair-list-context 'navigate))
(open-pair (sp--get-opening-regexp context))
(close-pair (sp--get-closing-regexp context))
(open-pair-re (sp--get-opening-regexp context))
(close-pair-re (sp--get-closing-regexp context))
open-len close-len)
(cond ;; When in strings (sp acts weird with quotes; this is the fix)
;; Also, skip closing delimiters
((and (and (sp--looking-back open-pair)
((and (and (sp--looking-back open-pair-re)
(setq open-len (- (match-beginning 0) (match-end 0))))
(and (looking-at close-pair)
(setq close-len (- (match-beginning 0) (match-end 0)))))
(and (looking-at close-pair-re)
(setq close-len (- (match-beginning 0) (match-end 0))))
(string= (plist-get (sp-get-thing t) :op)
(plist-get (sp-get-thing) :cl)))
(delete-backward-char open-len)
(delete-char close-len))
;; If using tabs (or at bol), just delete normally
((or indent-tabs-mode
(= (point-at-bol) (point)))
(call-interactively 'backward-delete-char-untabify))
;; Delete up to the nearest tab column IF only whitespace between
;; point and bol.
((sp--looking-back-p "^[\\t ]*" (point-at-bol))
((sp--looking-back-p "^[\\t ]*" (line-beginning-position))
(let ((movement (% (current-column) tab-width))
(p (point)))
(when (= movement 0)

View file

@ -2,7 +2,7 @@
;;
;; Author: Henrik Lissner <henrik@lissner.net>
;; URL: https://github.com/hlissner/.emacs.d
;; Version: 1.1.2
;; Version: 1.1.3
;;
;; ================= =============== =============== ======== ========
;; \\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . //
@ -29,11 +29,10 @@
;;; License: MIT
(defconst emacs-start-time (current-time))
(load (concat user-emacs-directory "core/core.el"))
(load (concat user-emacs-directory "core/core"))
(doom :default-theme 'doom-one
:terminal-theme 'doom-dark
:default-font ("Fira Mono" 12)
(doom :theme (if window-system 'doom-one 'doom-dark)
:font ("Inconsolata" 14)
;;; The heart of DOOM
core-popup ; taming sudden and inevitable windows

View file

@ -9,8 +9,8 @@
;; + TODO peer programming collab
;; Big-mode settings
(defconst big-mode-font (font-spec :family "Hack" :size 16))
(defconst big-mode-line-spacing 0)
(defconst big-mode-font (font-spec :family "Inconsolata" :size 18))
(defconst big-mode-line-spacing 1)
(defconst big-mode-modeline-height 35)
;;
@ -37,8 +37,15 @@
(setq neo-window-width 28)
(remove-hook 'neo-after-create-hook 'doom|text-scale-1)))
(defun doom|text-scale-1 (&rest _) (text-scale-set -1) (setq line-spacing 0))
(defun doom|text-scale+1 (&rest _) (text-scale-set +1))
(defun doom|text-scale-1 (&rest _)
(text-scale-set -1) (setq line-spacing 0))
(evil-define-command doom:big-mode (&optional size)
(interactive "<a>")
(let ((big-mode-font big-mode-font))
(when (and size (not big-mode))
(font-put big-mode-font :size (string-to-int size)))
(big-mode (if big-mode -1 +1))))
(provide 'extra-demo)
;;; extra-demo.el ends here

View file

@ -12,11 +12,7 @@
sql-user "root"
sql-password ""))
(defvar db-commands
'((mysql
(:listdb )
)))
;; extract these
(evil-define-command doom:db-select (product)
(interactive "<a>")
(sql-set-product (intern product))

View file

@ -264,7 +264,7 @@
;; yasnippet
(:map yas-minor-mode-map
:i [(tab)] 'yas-expand
:v "<backtab>" 'doom/yas-insert-snippet)
:v [(tab)] 'doom/yas-insert-snippet)
;; company-mode and vim-like omni-complete
:i "C-SPC" 'doom/company-complete

View file

@ -80,7 +80,7 @@
(ex! "rm" 'doom:file-delete)
;; Presentation/demo
(ex! "big" 'big-mode)
(ex! "big" 'doom:big-mode)
(ex! "full[scr]" 'doom:toggle-fullscreen)
;; Sessions/tabs

View file

@ -22,7 +22,7 @@
(doom-blend color "#FFFFFF" (- 1 alpha)))
(when (display-graphic-p)
(when window-system
(defface doom-default '((t (:inherit default)))
"Face for source code windows."
:group 'doom)

View file

@ -22,7 +22,7 @@
(doom-blend color "#FFFFFF" (- 1 alpha)))
(when (display-graphic-p)
(when window-system
(defface doom-default '((t (:inherit default)))
"Face for source code windows."
:group 'doom)