diff options
| author | Andrii Kolomoiets | 2020-09-03 22:13:36 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2020-09-05 00:16:39 +0300 |
| commit | f450798cb0b9bedfa73efff14605a04eec4f1d9e (patch) | |
| tree | 829e66813bbda4a2cd1e2c2a4206332c7ca0e218 | |
| parent | 9e5fd29bede00905d7ff95ea213c2e2f47944e61 (diff) | |
| download | emacs-f450798cb0b9bedfa73efff14605a04eec4f1d9e.tar.gz emacs-f450798cb0b9bedfa73efff14605a04eec4f1d9e.zip | |
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'.
| -rw-r--r-- | lisp/vc/vc-dir.el | 6 | ||||
| -rw-r--r-- | lisp/vc/vc-dispatcher.el | 3 | ||||
| -rw-r--r-- | 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 cdf8ab984e8..6c219005cea 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." | |||
| 451 | (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) | 451 | (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) |
| 452 | (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) | 452 | (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) |
| 453 | (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) | 453 | (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) |
| 454 | (ewoc-invalidate vc-ewoc node)) | 454 | ;; `ewoc-invalidate' will kill line and insert new text, |
| 455 | ;; let's keep point column. | ||
| 456 | (let ((p (point))) | ||
| 457 | (ewoc-invalidate vc-ewoc node) | ||
| 458 | (goto-char p))) | ||
| 455 | ;; If the state is nil, the file does not exist | 459 | ;; If the state is nil, the file does not exist |
| 456 | ;; anymore, so remember the entry so we can remove | 460 | ;; anymore, so remember the entry so we can remove |
| 457 | ;; it after we are done inserting all ENTRIES. | 461 | ;; it after we are done inserting all ENTRIES. |
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 4a04c9365a5..99bf5bf9b64 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." | |||
| 691 | (message "%s Type C-c C-c when done" msg) | 691 | (message "%s Type C-c C-c when done" msg) |
| 692 | (vc-finish-logentry (eq comment t))))) | 692 | (vc-finish-logentry (eq comment t))))) |
| 693 | 693 | ||
| 694 | (declare-function vc-dir-move-to-goal-column "vc-dir" ()) | ||
| 695 | ;; vc-finish-logentry is typically called from a log-edit buffer (see | 694 | ;; vc-finish-logentry is typically called from a log-edit buffer (see |
| 696 | ;; vc-start-logentry). | 695 | ;; vc-start-logentry). |
| 697 | (defun vc-finish-logentry (&optional nocomment) | 696 | (defun vc-finish-logentry (&optional nocomment) |
| @@ -740,8 +739,6 @@ the buffer contents as a comment." | |||
| 740 | (mapc | 739 | (mapc |
| 741 | (lambda (file) (vc-resynch-buffer file t t)) | 740 | (lambda (file) (vc-resynch-buffer file t t)) |
| 742 | log-fileset)) | 741 | log-fileset)) |
| 743 | (when (vc-dispatcher-browsing) | ||
| 744 | (vc-dir-move-to-goal-column)) | ||
| 745 | (run-hooks after-hook 'vc-finish-logentry-hook))) | 742 | (run-hooks after-hook 'vc-finish-logentry-hook))) |
| 746 | 743 | ||
| 747 | (defun vc-dispatcher-browsing () | 744 | (defun vc-dispatcher-browsing () |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 5561292d8c0..f0a08044e28 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1346,8 +1346,6 @@ For old-style locking-based version control systems, like RCS: | |||
| 1346 | nil t))))) | 1346 | nil t))))) |
| 1347 | (vc-call-backend backend 'create-repo)) | 1347 | (vc-call-backend backend 'create-repo)) |
| 1348 | 1348 | ||
| 1349 | (declare-function vc-dir-move-to-goal-column "vc-dir" ()) | ||
| 1350 | |||
| 1351 | ;;;###autoload | 1349 | ;;;###autoload |
| 1352 | (defun vc-register (&optional vc-fileset comment) | 1350 | (defun vc-register (&optional vc-fileset comment) |
| 1353 | "Register into a version control system. | 1351 | "Register into a version control system. |
| @@ -1398,8 +1396,6 @@ first backend that could register the file is used." | |||
| 1398 | 1396 | ||
| 1399 | (vc-resynch-buffer file t t)) | 1397 | (vc-resynch-buffer file t t)) |
| 1400 | files) | 1398 | files) |
| 1401 | (when (derived-mode-p 'vc-dir-mode) | ||
| 1402 | (vc-dir-move-to-goal-column)) | ||
| 1403 | (message "Registering %s... done" files))) | 1399 | (message "Registering %s... done" files))) |
| 1404 | 1400 | ||
| 1405 | (defun vc-register-with (backend) | 1401 | (defun vc-register-with (backend) |