Created
December 20, 2011 19:45
-
-
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.
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 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