Created
November 9, 2023 21:42
-
-
Save mokrates/a4ea7a52efa12ba1ebfd5bf81e789968 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 region-length-kill (pref beg end) | |
"counts the length/chars in the region. | |
Prefix argument counts newlines twice for DOS" | |
(interactive "P\nr") | |
(let* ((reg-len (- end beg)) | |
(reg-len-dos? (if pref (+ (count-matches "\n" beg end) | |
reg-len) | |
reg-len))) | |
(message (format "Region length: %s" reg-len-dos?)) | |
(kill-new (format "%s" reg-len-dos?)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment