emacs - Add new file to separate some utility functions
[dotfiles.git] / emacs.d / config.org
index b73f0f0..e62f388 100644 (file)
@@ -1237,17 +1237,9 @@ set default eshell history folder
 
 ** Eshell erase buffer
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
-  (defun sd/eshell-clear-buffer ()
-    "Clear eshell buffer"
-    (interactive)
-    (let ((inhibit-read-only t)
-          (current-point (- (point-max) (point))))
-      (beginning-of-line)
-      (delete-region (point-min) (point))
-      (goto-char (- (point-max) current-point))))
-
+  (require 'utilities)
 
-   (add-hook 'eshell-mode-hook (lambda ()
+  (add-hook 'eshell-mode-hook (lambda ()
                                 (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)))
 #+END_SRC