Created
January 26, 2015 20:36
-
-
Save davidshepherd7/579fd585b891a81eec73 to your computer and use it in GitHub Desktop.
better comment-dwim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like
point-at-beginning-of-next-line
is a custom function of yours. Source?