Refactor DOOM scratch buffer
This commit is contained in:
parent
0903dfa0c8
commit
e7d0e9f9ec
5 changed files with 95 additions and 88 deletions
|
@ -279,19 +279,6 @@ Examples:
|
|||
(define-key evil-motion-state-map (kbd "SPC") ',next-func)
|
||||
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func)))
|
||||
|
||||
;;
|
||||
(defun doom|update-scratch-buffer (&optional dir inhibit-doom)
|
||||
"Make sure scratch buffer is always 'in a project', and looks good."
|
||||
(let ((dir (or dir (doom/project-root))))
|
||||
(with-current-buffer doom-buffer
|
||||
;; Reset scratch buffer if it wasn't visible
|
||||
(when (and (get-buffer-window-list doom-buffer nil t)
|
||||
(not doom-buffer-edited)
|
||||
(not inhibit-doom))
|
||||
(doom-mode-init t))
|
||||
(setq default-directory dir)
|
||||
(setq mode-line-format (doom-modeline 'scratch)))))
|
||||
|
||||
|
||||
;;
|
||||
;; Global Defuns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue