From e66540149dc6fcd9cd01179751accb325cee6223 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 15 Oct 2023 07:04:24 +0200 Subject: [PATCH] Refactor gpolonkai/goto-next-char for a bit more performance --- configuration.org | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configuration.org b/configuration.org index ad899a5..f2fdd5a 100644 --- a/configuration.org +++ b/configuration.org @@ -608,10 +608,8 @@ line first. Then jump to the actual end of the line." #+begin_src emacs-lisp (defun gpolonkai/goto-next-char (chr) (interactive "c") - (let ((substr (char-to-string chr)) - (end (save-excursion (end-of-line) (point)))) - (when (search-forward substr end t) - (backward-char)))) + (when (search-forward (char-to-string chr) (pos-eol) t) + (backward-char))) #+end_src *** Move to the beginning of the next word