From: Narendra Joshi Date: Wed, 24 Nov 2021 16:58:03 +0000 (-0500) Subject: * lisp/vcursor.el (vcursor-get-char-count): Preserve point X-Git-Tag: emacs-29.0.90~2852^2~60 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20ab639d8946ca4c07c5238f015f8da17799c4e2;p=emacs.git * lisp/vcursor.el (vcursor-get-char-count): Preserve point Copyright-paperwork-exempt: yes --- diff --git a/lisp/vcursor.el b/lisp/vcursor.el index e219dc2d1a5..df65db39e38 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el @@ -788,9 +788,9 @@ out how much to copy." (vcursor-check) (with-current-buffer (overlay-buffer vcursor-overlay) - (let ((start (goto-char (overlay-start vcursor-overlay)))) - (- (progn (apply func args) (point)) start))) - ) + (save-excursion + (let ((start (goto-char (overlay-start vcursor-overlay)))) + (- (progn (apply func args) (point)) start))))) ;; Make sure the virtual cursor is active. Unless arg is non-nil, ;; report an error if it is not.