Skip to content

Instantly share code, notes, and snippets.

@am0c
Created February 6, 2011 09:28
Show Gist options
  • Save am0c/813255 to your computer and use it in GitHub Desktop.
Save am0c/813255 to your computer and use it in GitHub Desktop.
elisp for @crowdy
; http://twitter.com/#!/crowdy/status/33538661882535938
; @crowdy
; 누가 emacs에서 현재 라인이 '>edit c:\a{yyyyMM}.txt #코멘트'일 때,
; 단축키를 눌러 a201102.txt 파일을 여는(이미 열렸으면 창전환) 매크로
; 하나만 만들어 주세요. 굽슨 굽슨 은혜는 이맥스 쓰는 동안 잊지 않겠습니다
(defun my-find-file ()
(interactive)
(let ((str (thing-at-point 'line)))
(if (string-match "^>edit \\(.+?\\)\\([[:blank:]]+#.+?\\)?$" str)
(switch-to-buffer(find-file (match-string 1 str))))))
(global-set-key [f12] 'my-find-file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment