summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-06-18 00:26:24 -0400
committerKyle Meyer <kyle@kyleam.com>2014-06-18 00:26:24 -0400
commit18ea0de77032fe88257f53fd350f42ad728df945 (patch)
tree9257a89f56c6106ef2750390031124ad117dd851 /lisp
parent46653bca4d1b1f22f0e8b845066e93db01196ca2 (diff)
downloademacs.d-18ea0de77032fe88257f53fd350f42ad728df945.tar.gz
Define scratch functions for different modes
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-buffile.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/init-buffile.el b/lisp/init-buffile.el
index f0293b1..135103b 100644
--- a/lisp/init-buffile.el
+++ b/lisp/init-buffile.el
@@ -80,4 +80,28 @@ user."
recentf-max-menu-items 15)
(recentf-mode t)
+;;; Temporary scratch files
+
+(define-prefix-command 'scratch-map)
+(global-set-key (kbd "C-c s") 'scratch-map)
+
+(defmacro km/make-find-scratch-func (name extension)
+ `(defun ,(intern (concat "km/find-scratch-" name)) ()
+ (interactive)
+ (find-file ,(concat "/tmp/scratch" extension))))
+
+(km/make-find-scratch-func "elisp" ".el")
+(km/make-find-scratch-func "python" ".py")
+(km/make-find-scratch-func "r" ".r")
+(km/make-find-scratch-func "haskell" ".hs")
+(km/make-find-scratch-func "org" ".org")
+(km/make-find-scratch-func "nomode" "")
+
+(define-key scratch-map "e" 'km/find-scratch-elisp)
+(define-key scratch-map "p" 'km/find-scratch-python)
+(define-key scratch-map "r" 'km/find-scratch-r)
+(define-key scratch-map "h" 'km/find-scratch-haskell)
+(define-key scratch-map "o" 'km/find-scratch-org)
+(define-key scratch-map "n" 'km/find-scratch-nomode)
+
(provide 'init-buffile)