Skip to content

Instantly share code, notes, and snippets.

View davep's full-sized avatar
👁️‍🗨️
Nothing like the eve of extinction to bring focus to the mind.

Dave Pearson davep

👁️‍🗨️
Nothing like the eve of extinction to bring focus to the mind.
View GitHub Profile
@davep
davep / list-prog-modes.el
Created August 6, 2018 08:03
Command to list all programming major modes know to an Emacs instance
(defun list-prog-modes ()
"List all programming modes known to this Emacs."
(interactive)
(with-help-window "*Programming Major Modes*"
(mapatoms (lambda (f)
(when (provided-mode-derived-p f 'prog-mode)
(princ f)
(princ "\n"))))))
@davep
davep / GitCommitEmoji.md
Created April 19, 2018 08:14 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
(defun smile ()
"Smile at you.
See https://emacs.stackexchange.com/questions/34271/equivalent-to-the-vim-smile-command"
(interactive)
(with-help-window "*smile*"
(princ " oooo$$$$$$$$$$$$oooo
oo$$$$$$$$$$$$$$$$$$$$$$$$o
oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
;; Create and switch to a test buffer.
(with-current-buffer (get-buffer-create "*Foo*")
;; Ensure it's empty, for testing purposes.
(setf (buffer-string) "")
;; Insert some test text
(insert "hello, world!")
;; Now use `shell-command-on-region' to manipulate it.
(shell-command-on-region (point-min) (point-max) "tr a-z A-Z" (current-buffer) t))