Skip to content

Instantly share code, notes, and snippets.

View thanthese's full-sized avatar

Stephen Mann thanthese

View GitHub Profile
@davidshepherd7
davidshepherd7 / gist:579fd585b891a81eec73
Created January 26, 2015 20:36
better comment-dwim
(defun dwim-entire-line (function)
(if (region-active-p)
(funcall function (region-beginning) (region-end))
;; else
(funcall function (point-at-bol) (point-at-beginning-of-next-line))))
(global-set-key (kbd "M-;") (lambda () (interactive)
(dwim-entire-line 'comment-or-uncomment-region)))