Learning more about emacs |
October 29th, 2009 |
programming, tech |
I'd been typing this in by hand, but today I decided to automate this. It turns out emacs supports the unix<a name="2009-10-29"></a><h3>Thursday October 29 2009:</h3> <div class="pt"> <h3></h3> </div>
date
syntax,
so my dates become something like "%Y-%m-%d
" and "%A
%B %d %Y:
". Very handy. The rest is just inserting characters:
So now I can just do "M-x start-news-entry" and not delay my urgent news-thoughts with mindless formatting. Yay.(defun start-news-entry () (interactive) (insert (format-time-string " <a name=\"%Y-%m-%d\"></a><h3>%A %B %d %Y:</h3>")) (newline) (insert " <div class=\"pt\">") (newline) (newline) (insert " <h3></h3>") (newline) (newline) (newline) (insert " </div>") (newline))
Comment via: facebook