From 064d857ab0e9d78729c6d2796076a2d4e65c638d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 25 Sep 2013 00:23:31 +0900 Subject: [PATCH] bashrc, emacs.el: add func memo --- bashrc | 9 +++++++++ emacs.el | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/bashrc b/bashrc index 3486f22..e527af1 100755 --- a/bashrc +++ b/bashrc @@ -342,6 +342,15 @@ ssh(){ command ssh "$@" } +memo(){ + if test -z "$1" + then + $EDITOR memo.txt + else + $EDITOR "$1/memo.txt" + fi +} + clk(){ local tformat="%Y/%m/%d %H:%M:%S %z" cal diff --git a/emacs.el b/emacs.el index 9be97e5..bec4c15 100644 --- a/emacs.el +++ b/emacs.el @@ -1911,6 +1911,14 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs +(defun memo (&optional dir) + "Open memo.txt" + (interactive) + (pop-to-buffer (find-file-noselect (concat (if dir + (file-name-as-directory dir) + "") + "memo.txt")))) +(file-name-as-directory "..") (defun my-rgrep-gitgrep (word) "Recursive grep with git-grep" (interactive "sgit-grep: Word to search: ")