commit 5b9a4b889139c9a1aa6c11a0f6196415f3796d76 Author: Sean Whitton Date: Mon Jun 29 16:09:44 2026 +0100 ; * lisp/vc/vc-dir.el (vc-dir-refresh): Use if-let*. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index b019f46d1f8..a9e6ce7daa2 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1793,14 +1793,13 @@ Throw an error if another update process is in progress." (with-current-buffer buffer (vc-dir-update entries buffer) (unless more-to-come - (let ((remaining - (ewoc-collect vc-ewoc - 'vc-dir-fileinfo->needs-update))) - (if remaining - (vc-dir-refresh-files (mapcar #'vc-dir-fileinfo->name - remaining)) - (setq mode-line-process nil) - (run-hooks 'vc-dir-refresh-hook)))))))))))) + (if-let* ((remaining + (ewoc-collect vc-ewoc + 'vc-dir-fileinfo->needs-update))) + (vc-dir-refresh-files (mapcar #'vc-dir-fileinfo->name + remaining)) + (setq mode-line-process nil) + (run-hooks 'vc-dir-refresh-hook))))))))))) (defun vc-dir--refresh-headers (directory) "Refresh the headers for any VC-Dir buffers within DIRECTORY." commit fcbff4df7a6313fb9ce377ec68377699c5f70ad7 Author: Sean Whitton Date: Mon Jun 29 11:26:09 2026 +0100 Inline vc-dir-next-line after marking or unmarking This fixes where point goes after using a marking or unmarking command with point before the "./" entry. * lisp/vc/vc-dir.el (vc-dir-mark-unmark, vc-dir-mark-file) (vc-dir-unmark-file): Inline the relevant part of vc-dir-next-line to skip the 'vc-dir--before-dotname-p' conditional. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 84872914bb5..b019f46d1f8 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -804,7 +804,8 @@ With prefix argument ARG, move that many lines." ;; `vc-dir-mark-file' signals an error if we try marking ;; a directory containing marked files in its tree, or a ;; file in a marked directory tree. Just continue. - (error (vc-dir-next-line 1)))))) + (error (ewoc-goto-next vc-ewoc 1) + (vc-dir-move-to-goal-column)))))) (funcall mark-unmark-function))) (defun vc-dir--parent (arg &optional if-marked) @@ -884,7 +885,8 @@ Replace marks on subitems with marking `%s' itself?" (setf (vc-dir-fileinfo->marked file) t) (apply #'ewoc-invalidate vc-ewoc to-inval) (unless (or arg (mouse-event-p last-command-event)) - (vc-dir-next-line 1)))) + (ewoc-goto-next vc-ewoc 1) + (vc-dir-move-to-goal-column)))) (defun vc-dir-mark () "Mark the current file or all files in the region. @@ -1053,7 +1055,8 @@ Replace mark on `%s' with marks on all subitems but this one?" (when to-inval (apply #'ewoc-invalidate vc-ewoc to-inval)) (unless (mouse-event-p last-command-event) - (vc-dir-next-line 1)))) + (ewoc-goto-next vc-ewoc 1) + (vc-dir-move-to-goal-column)))) (defun vc-dir-unmark () "Unmark the current file or all files in the region. commit c6fc5fbb7d2c87664aea8b0ecb986a8a9f619f3e Author: Sean Whitton Date: Mon Jun 29 11:24:38 2026 +0100 ; vc-dir-next-line: Delete unneeded with-no-warnings. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 83c4fa02bdd..84872914bb5 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -736,11 +736,10 @@ information." "Go to the next line. With prefix argument ARG, move that many lines." (interactive "p") - (with-no-warnings - (if (vc-dir--before-dotname-p) - (ewoc-goto-node vc-ewoc (ewoc-nth vc-ewoc 0)) - (ewoc-goto-next vc-ewoc arg)) - (vc-dir-move-to-goal-column))) + (if (vc-dir--before-dotname-p) + (ewoc-goto-node vc-ewoc (ewoc-nth vc-ewoc 0)) + (ewoc-goto-next vc-ewoc arg)) + (vc-dir-move-to-goal-column)) (defun vc-dir-previous-line (arg) "Go to the previous line. commit 62ec74e9eda643e408f02cfde808b99b975d9c98 Author: Sean Whitton Date: Mon Jun 29 11:14:05 2026 +0100 VC pull/push: Consistently return and use process object * lisp/vc/vc-hg.el (vc-hg--pushpull): Return the process object. * lisp/vc/vc.el (vc-pull, vc-push): Use it. (pull, push): Specify that it should be returned. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index b3000534e7c..a34ed82fa23 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1632,7 +1632,7 @@ revisions, fetch only those revisions." (mapcar (lambda (arg) (list "-r" arg)) marked-list))) (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) - ;; Disable pager. + ;; Disable pager. (process-environment (cons "HGPLAIN=1" process-environment)) (hg-program vc-hg-program) args) @@ -1648,31 +1648,32 @@ revisions, fetch only those revisions." (setq hg-program (car args) command (cadr args) args (cddr args))) - (set-process-query-on-exit-flag - (apply #'vc-do-async-command buffer root hg-program command args) - t) - (with-current-buffer buffer - (vc-run-delayed - (dolist (cmd post-processing) - (apply #'vc-do-command buffer nil hg-program nil cmd)) - (vc-compilation-mode 'hg) - (setq-local compile-command - (concat hg-program " " command " " - (mapconcat #'identity args " ") - (mapconcat (lambda (args) - (concat " && " hg-program " " - (mapconcat #'identity - args " "))) - post-processing ""))) - (setq-local compilation-directory root) - ;; Either set `compilation-buffer-name-function' locally to nil - ;; or use `compilation-arguments' to set `name-function'. - ;; See `compilation-buffer-name'. - (setq-local compilation-arguments - (list compile-command nil - (lambda (_name-of-mode) buffer) - nil)))) - (vc-set-async-update buffer))))) + (let ((proc (apply #'vc-do-async-command buffer root hg-program + command args))) + (set-process-query-on-exit-flag proc t) + (with-current-buffer buffer + (vc-run-delayed + (dolist (cmd post-processing) + (apply #'vc-do-command buffer nil hg-program nil cmd)) + (vc-compilation-mode 'hg) + (setq-local compile-command + (concat hg-program " " command " " + (mapconcat #'identity args " ") + (mapconcat (lambda (args) + (concat " && " hg-program " " + (mapconcat #'identity + args " "))) + post-processing ""))) + (setq-local compilation-directory root) + ;; Either set `compilation-buffer-name-function' locally to nil + ;; or use `compilation-arguments' to set `name-function'. + ;; See `compilation-buffer-name'. + (setq-local compilation-arguments + (list compile-command nil + (lambda (_name-of-mode) buffer) + nil)))) + (vc-set-async-update buffer) + proc))))) (defun vc-hg-pull (prompt) "Issue a Mercurial pull command. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 7497150562f..ef957b7010a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -364,9 +364,17 @@ ;; ;; - pull (prompt) ;; -;; Pull "upstream" changes into the current branch (for distributed +;; Pull upstream changes into the current branch (for distributed ;; VCS). If PROMPT is non-nil, or if necessary, prompt for a -;; location to pull from. +;; location to pull from. If the pull is done asynchronously, return +;; the process object. +;; +;; - push (prompt) +;; +;; Push local changes to the upstream of the current branch (for +;; distributed VCS). If PROMPT is non-nil, or if necessary, prompt +;; for the command to run. If the pull is done asynchronously, return +;; the process object. ;; ;; - steal-lock (file &optional revision) ;; @@ -4894,13 +4902,15 @@ tip revision are merged into the working file." (cond ;; If a pull operation is defined, use it. (fn - (funcall fn arg) - (vc-run-delayed - ;; FIXME: Ideally we would only clear out the stored value for - ;; the REMOTE-LOCATION from which we are pulling. - (vc--repo-setprop backend 'vc-incoming-revision nil) - (when vc-dir-buffers - (vc-dir--refresh-headers (vc-root-dir backend))))) + (let ((proc (funcall fn arg))) + (vc-exec-after + (lambda () + ;; FIXME: Ideally we would only clear out the stored value + ;; for the REMOTE-LOCATION from which we are pulling. + (vc--repo-setprop backend 'vc-incoming-revision nil) + (when vc-dir-buffers + (vc-dir--refresh-headers (vc-root-dir backend)))) + nil (and (processp proc) proc)))) ;; If VCS has `merge-news' functionality (CVS and SVN), use it. ((vc-find-backend-function backend 'merge-news) (save-some-buffers ; save buffers visiting files @@ -4939,13 +4949,15 @@ It also signals an error in a Bazaar bound branch." (let* ((fileset (vc-deduce-fileset t t)) (backend (car fileset))) (if (vc-find-backend-function backend 'push) - (progn (vc-call-backend backend 'push arg) - (vc-run-delayed - ;; FIXME: Ideally we would only clear out the - ;; REMOTE-LOCATION to which we are pushing. - (vc--repo-setprop backend 'vc-incoming-revision nil) - (when vc-dir-buffers - (vc-dir--refresh-headers (vc-root-dir backend))))) + (let ((proc (vc-call-backend backend 'push arg))) + (vc-exec-after + (lambda () + ;; FIXME: Ideally we would only clear out the + ;; REMOTE-LOCATION to which we are pushing. + (vc--repo-setprop backend 'vc-incoming-revision nil) + (when vc-dir-buffers + (vc-dir--refresh-headers (vc-root-dir backend)))) + nil (and (processp proc) proc))) (user-error "VC push is unsupported for `%s'" backend)))) ;;;###autoload commit f48072a7005853b4272075c6c2658f82011f400e Author: Sean Whitton Date: Mon Jun 29 10:51:06 2026 +0100 ; Fix comment locations. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ef5cdd75182..7497150562f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -4895,9 +4895,9 @@ tip revision are merged into the working file." ;; If a pull operation is defined, use it. (fn (funcall fn arg) - ;; FIXME: Ideally we would only clear out the stored value for the - ;; REMOTE-LOCATION from which we are pulling. (vc-run-delayed + ;; FIXME: Ideally we would only clear out the stored value for + ;; the REMOTE-LOCATION from which we are pulling. (vc--repo-setprop backend 'vc-incoming-revision nil) (when vc-dir-buffers (vc-dir--refresh-headers (vc-root-dir backend))))) @@ -4940,9 +4940,9 @@ It also signals an error in a Bazaar bound branch." (backend (car fileset))) (if (vc-find-backend-function backend 'push) (progn (vc-call-backend backend 'push arg) - ;; FIXME: Ideally we would only clear out the - ;; REMOTE-LOCATION to which we are pushing. (vc-run-delayed + ;; FIXME: Ideally we would only clear out the + ;; REMOTE-LOCATION to which we are pushing. (vc--repo-setprop backend 'vc-incoming-revision nil) (when vc-dir-buffers (vc-dir--refresh-headers (vc-root-dir backend))))) commit 1c479143e30b9b91cd02a1be848baece7f175117 Author: Sean Whitton Date: Mon Jun 29 10:47:18 2026 +0100 vc-dir--set-vc-dir-process-buffer: Use setq-local * lisp/vc/vc-dir.el (vc-dir--set-vc-dir-process-buffer): Use setq-local. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 8166384bbd6..83c4fa02bdd 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1669,10 +1669,10 @@ specific headers." (let ((buffer (current-buffer))) (unless (buffer-live-p vc-dir-process-buffer) (with-current-buffer - (setq vc-dir-process-buffer - (generate-new-buffer (format " *VC-%s* tmp status" - backend))) - (setq vc-parent-buffer buffer))))) + (setq-local vc-dir-process-buffer + (generate-new-buffer (format " *VC-%s* tmp status" + backend))) + (setq-local vc-parent-buffer buffer))))) (defun vc-dir-refresh-files (files) "Refresh some FILES in the *VC-Dir* buffer."