Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
Created May 13, 2019 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxperscientiam/c5eb3fe2b1ac7a9d73ab80ed3dd46409 to your computer and use it in GitHub Desktop.
Save paxperscientiam/c5eb3fe2b1ac7a9d73ab80ed3dd46409 to your computer and use it in GitHub Desktop.
(defun moose/popup-count-words-region (start end)
"Get word count for positive length active region."
(interactive "r")
(cond ((and (use-region-p)
(> (region-end) (region-beginning))
(eq this-command 'moose/popup-count-words-region))
(let ((print-escape-newlines t))
(popup-tip (concat (number-to-string (count-words start end)) " words"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment