joestar

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit f060c314e0b6925a95e029bcbf669bfeb1ae32fd
parent 0a47b401de60a3dcb717e3fd106d225631c616c7
Author: Ryan Jeffrey <pwishie@gmail.com>
Date:   Tue, 15 Oct 2019 12:49:14 -0700

scratch buffer fix

Diffstat:
Mjoestar.el | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/joestar.el b/joestar.el @@ -162,6 +162,8 @@ (defalias 'joe-cd 'cd) (defalias 'joe-savenow 'save-buffer) +;; functions + (defun joe-byte (byte) "Go to byte BYTE." (interactive "nGo to byte: ") @@ -210,11 +212,14 @@ (interactive "sInsert: ") (insert str)) -; TODO bug where this does not work with scratch files (maybe because it doesn't have a default-dir?) +; TODO bug where this does not work with scratch files (defun joe-name () "Insert current file name into the buffer." (interactive) - (insert (file-relative-name (buffer-file-name) default-directory))) + (if (buffer-file-name) + (progn + (insert (file-relative-name (buffer-file-name) default-directory))) + (insert (buffer-name)))) ; TODO get the locale (defun joe-language ()