Skip to content

Instantly share code, notes, and snippets.

@emres
Created December 20, 2011 19:45
Show Gist options
  • Save emres/1502942 to your computer and use it in GitHub Desktop.
Save emres/1502942 to your computer and use it in GitHub Desktop.
Substract a number from the current word and replace it with the result.
(defun subtract-number-from-current-word (number)
"Substract a number from the current word and replace it with the result.
Beware: No error checking."
(interactive "p")
(let ((curr-word (current-word)))
(kill-word 1)
(insert (int-to-string
(- (string-to-int curr-word) number)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment