diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-08 22:40:16 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-08 22:40:16 +0200 |
commit | 41aa95fc1b27510d7cbef8301e55cc53ddcf3658 (patch) | |
tree | 31660ef2ae10eec2b186272eb05d433ed8fd6953 | |
parent | 23aa513425fff866a28ed68e49a363ca2e939da7 (diff) |
emacs: Move code outside of (save-match-data)
-rw-r--r-- | .config/emacs/init.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 99c7a75..fcd50ed 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -361,10 +361,10 @@ the number at point has leading zeros then the width of the number is preserved." (interactive "*p") (save-excursion + (skip-chars-backward "0123456789") + (when (eq (char-before (point)) ?-) + (goto-char (1- (point)))) (save-match-data - (skip-chars-backward "0123456789") - (when (eq (char-before (point)) ?-) - (goto-char (1- (point)))) (when (re-search-forward "-?\\([0-9]+\\)" nil 'noerror) (let ((answer (+ (string-to-number (match-string 0) 10) (or arg 1))) |