Improve narf|update-scratch-buffer-cwd

This commit is contained in:
Henrik Lissner 2016-04-12 15:39:10 -04:00
parent 83c0909920
commit 8fa7dc7802

View file

@ -205,11 +205,12 @@ Examples:
(defun narf|enable-hard-wrap () (defun narf|enable-hard-wrap ()
(turn-on-auto-fill)) (turn-on-auto-fill))
(defun narf|update-scratch-buffer-cwd () ; see core-editor.el (defun narf|update-scratch-buffer-cwd (&optional dir) ; see core-editor.el
"Make sure scratch buffer is always 'in a project.'" "Make sure scratch buffer is always 'in a project.'"
(let ((dir (narf/project-root))) (let ((dir (or dir (narf/project-root))))
(with-current-buffer (get-buffer-create "*scratch*") (with-current-buffer (get-buffer-create "*scratch*")
(cd dir)))) (setq default-directory dir)
(setq header-line-format (concat "" dir)))))
;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;; ;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;;