[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f450798: Don't move point in vc-dir on vc-register/vc-checkin (bu

From: Dmitry Gutov
Subject: master f450798: Don't move point in vc-dir on vc-register/vc-checkin (bug#43188)
Date: Fri, 4 Sep 2020 17:17:38 -0400 (EDT)

branch: master
commit f450798cb0b9bedfa73efff14605a04eec4f1d9e
Author: Andrii Kolomoiets <andreyk.mad@gmail.com>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Don't move point in vc-dir on vc-register/vc-checkin (bug#43188)
    * lisp/vc/vc-dir.el (vc-dir-update):
      Save and restore point on 'ewoc-invalidate'.
    * lisp/vc/vc-dispatcher.el (vc-finish-logentry):
      Don't call 'vc-dir-move-to-goal-column'.
    * lisp/vc/vc.el (vc-register): Don't call 'vc-dir-move-to-goal-column'.
 lisp/vc/vc-dir.el        | 6 +++++-
 lisp/vc/vc-dispatcher.el | 3 ---
 lisp/vc/vc.el            | 4 ----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index cdf8ab9..6c21900 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -451,7 +451,11 @@ If NOINSERT, ignore elements on ENTRIES which are not in 
the ewoc."
                      (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 
                      (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 
                      (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) 
-                     (ewoc-invalidate vc-ewoc node))
+                      ;; `ewoc-invalidate' will kill line and insert new text,
+                      ;; let's keep point column.
+                      (let ((p (point)))
+                       (ewoc-invalidate vc-ewoc node)
+                        (goto-char p)))
                  ;; If the state is nil, the file does not exist
                  ;; anymore, so remember the entry so we can remove
                  ;; it after we are done inserting all ENTRIES.
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 4a04c93..99bf5bf 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -691,7 +691,6 @@ BACKEND, if non-nil, specifies a VC backend for the Log 
Edit buffer."
        (message "%s  Type C-c C-c when done" msg)
       (vc-finish-logentry (eq comment t)))))
-(declare-function vc-dir-move-to-goal-column "vc-dir" ())
 ;; vc-finish-logentry is typically called from a log-edit buffer (see
 ;; vc-start-logentry).
 (defun vc-finish-logentry (&optional nocomment)
@@ -740,8 +739,6 @@ the buffer contents as a comment."
        (lambda (file) (vc-resynch-buffer file t t))
-    (when (vc-dispatcher-browsing)
-      (vc-dir-move-to-goal-column))
     (run-hooks after-hook 'vc-finish-logentry-hook)))
 (defun vc-dispatcher-browsing ()
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5561292..f0a0804 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1346,8 +1346,6 @@ For old-style locking-based version control systems, like 
        nil t)))))
   (vc-call-backend backend 'create-repo))
-(declare-function vc-dir-move-to-goal-column "vc-dir" ())
 (defun vc-register (&optional vc-fileset comment)
   "Register into a version control system.
@@ -1398,8 +1396,6 @@ first backend that could register the file is used."
        (vc-resynch-buffer file t t))
-    (when (derived-mode-p 'vc-dir-mode)
-      (vc-dir-move-to-goal-column))
     (message "Registering %s... done" files)))
 (defun vc-register-with (backend)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]