Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (require 'cl-lib)
- (defun hyphenate-backwards (n)
- "Insert hyphens between words N-times (prefix arg) behind point."
- (interactive "p")
- (save-excursion
- (dotimes (_ n)
- (cl-loop do (backward-word)
- do (backward-char)
- until (looking-at " "))
- (delete-char 1)
- (insert "-"))))
- (define-key text-mode-map (kbd "C-,") #'hyphenate-backwards)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement