General & minor refactoring
This commit is contained in:
parent
ed0cbc1323
commit
2b560a6a0e
6 changed files with 30 additions and 29 deletions
|
@ -908,7 +908,7 @@ module. This does not include your byte-compiled, third party packages.'"
|
|||
for path in (append (doom-files-in doom-emacs-dir :match "\\.elc$" :depth 0)
|
||||
(doom-files-in doom-private-dir :match "\\.elc$" :depth 1)
|
||||
(doom-files-in doom-core-dir :match "\\.elc$")
|
||||
(doom-files-in doom-modules-dirs :match "\\.elc$" :depth 3))
|
||||
(doom-files-in doom-modules-dirs :match "\\.elc$" :depth 4))
|
||||
for truepath = (file-truename path)
|
||||
if (file-exists-p path)
|
||||
do (delete-file path)
|
||||
|
|
|
@ -236,7 +236,7 @@ savehist file."
|
|||
(advice-add #'undo-tree-make-history-save-file-name :filter-return
|
||||
#'doom*undo-tree-make-history-save-file-name)
|
||||
|
||||
(defun doom*strip-text-properties-from-undo-history (&rest args)
|
||||
(defun doom*strip-text-properties-from-undo-history (&rest _)
|
||||
(dolist (item buffer-undo-list)
|
||||
(and (consp item)
|
||||
(stringp (car item))
|
||||
|
|
|
@ -138,12 +138,12 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.")
|
|||
;; `all-the-icons'
|
||||
(def-package! all-the-icons
|
||||
:commands (all-the-icons-octicon all-the-icons-faicon all-the-icons-fileicon
|
||||
all-the-icons-wicon all-the-icons-material all-the-icons-alltheicon
|
||||
all-the-icons-install-fonts)
|
||||
all-the-icons-wicon all-the-icons-material all-the-icons-alltheicon)
|
||||
:init
|
||||
(defun doom*disable-all-the-icons-in-tty (orig-fn &rest args)
|
||||
(when (display-graphic-p)
|
||||
(apply orig-fn args)))
|
||||
:config
|
||||
;; all-the-icons doesn't work in the terminal, so we "disable" it.
|
||||
(dolist (fn '(all-the-icons-octicon all-the-icons-material
|
||||
all-the-icons-faicon all-the-icons-fileicon
|
||||
|
@ -161,6 +161,7 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.")
|
|||
|
||||
;; `highlight-escape-sequences'
|
||||
(def-package! highlight-escape-sequences
|
||||
:load-path "~/work/plugins/highlight-escape-sequences"
|
||||
:hook ((prog-mode conf-mode) . highlight-escape-sequences-mode))
|
||||
|
||||
;; `rainbow-delimiters' Helps us distinguish stacked delimiter pairs. Especially
|
||||
|
|
|
@ -144,27 +144,28 @@ Advanced examples:
|
|||
;; format a region rather than the whole buffer.
|
||||
(require 'format-all)
|
||||
(save-restriction
|
||||
(let* ((beg (save-excursion (goto-char beg) (line-beginning-position)))
|
||||
(end (save-excursion (goto-char end)
|
||||
(if (bolp) (backward-char))
|
||||
(line-end-position)))
|
||||
(file buffer-file-name)
|
||||
(dir default-directory)
|
||||
(mode major-mode)
|
||||
(input (buffer-substring-no-properties beg end))
|
||||
(leading-indent 0)
|
||||
final-output)
|
||||
(with-temp-buffer
|
||||
(with-silent-modifications
|
||||
(setq buffer-file-name file
|
||||
default-directory dir)
|
||||
(delay-mode-hooks (funcall mode))
|
||||
(save-excursion (insert input))
|
||||
(setq leading-indent (current-indentation))
|
||||
(indent-rigidly (point-min) (point-max) (- leading-indent))
|
||||
;; From `format-all-buffer'
|
||||
(cl-destructuring-bind (formatter mode-result) (format-all-probe)
|
||||
(unless formatter (error "Don't know how to format %S code" major-mode))
|
||||
(cl-destructuring-bind (formatter mode-result) (format-all-probe)
|
||||
(unless formatter
|
||||
(user-error "Don't know how to format %S code" major-mode))
|
||||
(let* ((beg (save-excursion (goto-char beg) (line-beginning-position)))
|
||||
(end (save-excursion (goto-char end)
|
||||
(if (bolp) (backward-char))
|
||||
(line-end-position)))
|
||||
(file buffer-file-name)
|
||||
(dir default-directory)
|
||||
(mode major-mode)
|
||||
(input (buffer-substring-no-properties beg end))
|
||||
(leading-indent 0)
|
||||
final-output)
|
||||
(with-temp-buffer
|
||||
(with-silent-modifications
|
||||
(setq buffer-file-name file
|
||||
default-directory dir)
|
||||
(delay-mode-hooks (funcall mode))
|
||||
(save-excursion (insert input))
|
||||
(setq leading-indent (current-indentation))
|
||||
(indent-rigidly (point-min) (point-max) (- leading-indent))
|
||||
;; From `format-all-buffer'
|
||||
(let ((f-function (gethash formatter format-all-format-table))
|
||||
(executable (format-all-formatter-executable formatter)))
|
||||
(cl-destructuring-bind (output errput first-diff)
|
||||
|
|
|
@ -328,7 +328,7 @@ line with a linewise comment.")
|
|||
evilmi-outer-text-object evilmi-inner-text-object)
|
||||
:config (global-evil-matchit-mode 1)
|
||||
:init
|
||||
(define-key! 'global [remap evil-jump-item] #'evilmi-jump-items)
|
||||
(global-set-key [remap evil-jump-item] #'evilmi-jump-items)
|
||||
(define-key evil-inner-text-objects-map "%" #'evilmi-inner-text-object)
|
||||
(define-key evil-outer-text-objects-map "%" #'evilmi-outer-text-object)
|
||||
:config
|
||||
|
|
|
@ -46,7 +46,6 @@ available.")
|
|||
(add-hook 'magit-post-refresh-hook #'+magit|update-vc))
|
||||
|
||||
|
||||
|
||||
(def-package! magit-todos
|
||||
:hook (magit-mode . magit-todos-mode)
|
||||
:config
|
||||
|
@ -102,5 +101,5 @@ available.")
|
|||
(evil-define-key* evil-magit-state git-rebase-mode-map
|
||||
"gj" #'git-rebase-move-line-down
|
||||
"gk" #'git-rebase-move-line-up))
|
||||
(map! :map (magit-mode-map magit-blame-read-only-mode-map)
|
||||
doom-leader-key nil))
|
||||
(define-key! (magit-mode-map magit-blame-read-only-mode-map)
|
||||
(kbd doom-leader-key) nil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue