From 41aa95fc1b27510d7cbef8301e55cc53ddcf3658 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 8 Sep 2024 22:40:16 +0200 Subject: emacs: Move code outside of (save-match-data) --- .config/emacs/init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.config') 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))) -- cgit v1.2.3