Skip to content

Instantly share code, notes, and snippets.

@davidshepherd7
Created January 26, 2015 20:36
Show Gist options
  • Save davidshepherd7/579fd585b891a81eec73 to your computer and use it in GitHub Desktop.
Save davidshepherd7/579fd585b891a81eec73 to your computer and use it in GitHub Desktop.
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)))
@thanthese
Copy link

funcall: Symbol's function definition is void: point-at-beginning-of-next-line

Looks like point-at-beginning-of-next-line is a custom function of yours. Source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment