From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#32754: (vc-retrieve-tag-hook) Date: Mon, 01 Oct 2018 20:25:24 +0200 Message-ID: References: Reply-To: charles@aurox.ch NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1538418080 8338 195.159.176.226 (1 Oct 2018 18:21:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2018 18:21:20 +0000 (UTC) To: 32754@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 20:21:16 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g72oi-00022H-O4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 20:21:12 +0200 Original-Received: from localhost ([::1]:40122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g72qp-0004Zk-Ar for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 14:23:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g72qa-0004Yz-TE for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 14:23:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g72qV-0008KK-W6 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 14:23:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g72qU-0008J3-7q for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 14:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g72qU-0003M9-2n for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 14:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2018 18:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32754-submit@debbugs.gnu.org id=B32754.153841814412837 (code B ref 32754); Mon, 01 Oct 2018 18:23:02 +0000 Original-Received: (at 32754) by debbugs.gnu.org; 1 Oct 2018 18:22:24 +0000 Original-Received: from localhost ([127.0.0.1]:33502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g72pq-0003Kx-Fj for submit@debbugs.gnu.org; Mon, 01 Oct 2018 14:22:23 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:54021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g72po-0003Kh-0f for 32754@debbugs.gnu.org; Mon, 01 Oct 2018 14:22:20 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id B1A6D2287C for <32754@debbugs.gnu.org>; Mon, 1 Oct 2018 18:26:11 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:reply-to:subject:subject:in-reply-to:to:from:from :message-id:date:date; s=dkim; t=1538418371; x=1539282372; bh=3V OJ9P+oEvrjKuiWyr19CKBiV10qcah7SbTl1S+WQfs=; b=V7H06lo5cdjnb7cgUB MC9d/Af5JRWkIvczc1VAfc2tZNmgv/R6IFK3oX7HrLui67vjs4VJJYM0luQyL5V1 enp04weCemPdXQ+Hk1PKPC8emh8AunbKuEzLvy6IJ6CU9laqRzfG7oHuqlAD8iLQ K3cKXCRTT4OWblcVFhudZYrrM= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sGuBuPeGOCTG for <32754@debbugs.gnu.org>; Mon, 1 Oct 2018 18:26:11 +0000 (UTC) Original-Received: from gray (unknown [IPv6:2a02:1205:c693:2d60:c62c:3ff:fe30:b864]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id E6887226F4 for <32754@debbugs.gnu.org>; Mon, 1 Oct 2018 18:26:10 +0000 (UTC) In-reply-to: (help-debbugs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150887 Archived-At: Here's the patch for review. Hooks in VC are documented only in vc.el, so I have not added further documentation elsewhere. diff --git a/etc/NEWS b/etc/NEWS index daacf49..1d5820c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -329,6 +329,8 @@ git-grep when 'vc-git-grep' is used. When some files are marked, only those are stashed. When no files are marked, all modified files are stashed, as before. +*** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag. + ** diff-mode *** Hunks are now automatically refined by default. To disable it, set the new defcustom 'diff-font-lock-refine' to nil. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index d3d66d6..243a796 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -834,6 +834,13 @@ vc-before-checkin-hook :type 'hook :group 'vc) +;;;###autoload +(defcustom vc-retrieve-tag-hook nil + "Normal hook (list of functions) run after retrieving a tag." + :type 'hook + :group 'vc + :version "27.1") + (defcustom vc-revert-show-diff t "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying." :type 'boolean @@ -2154,7 +2161,8 @@ vc-retrieve-tag If NAME is empty, it refers to the latest revisions of the current branch. If locking is used for the files in DIR, then there must not be any locked files at or below DIR (but if NAME is empty, locked files are -allowed and simply skipped)." +allowed and simply skipped). +This function runs the hook `vc-retrieve-tag-hook' when finished." (interactive (let* ((granularity (vc-call-backend (vc-responsible-backend default-directory) @@ -2181,6 +2189,7 @@ vc-retrieve-tag (vc-call-backend (vc-responsible-backend dir) 'retrieve-tag dir name update) (vc-resynch-buffer dir t t t) + (run-hooks 'vc-retrieve-tag-hook) (message "%s" (concat msg "done"))))