From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#23436: [PATCH] Attemp to use the true name of a file to determine responsible vc if the genuine name does not work. Date: Sun, 30 Oct 2016 15:50:56 -0700 Message-ID: <87vaw9bgdr.fsf@topbug.net> References: <1462311145-5959-1-git-send-email-hong@topbug.net> <85f11f8a-1799-befd-3e5b-f7d7a6eac660@topbug.net> <072a649f-d11a-7c82-b3ae-32d9a92c8f8b@topbug.net> <5d653522-49bd-8b48-e3d6-0c09d1c65fae@yandex.ru> <377f4ee1-54a9-b10c-dc18-3acea6492bec@yandex.ru> <1ad97145-d21e-5d64-8b6c-4b4b2bc2ab49@yandex.ru> <87zilss0z6.fsf@topbug.net> <87funefz1i.fsf@topbug.net> <83twbtq03k.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1477867948 26570 195.159.176.226 (30 Oct 2016 22:52:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2016 22:52:28 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.50.8 Cc: dgutov@yandex.ru, 23436@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 30 23:52:23 2016 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 1c0yxU-0004QR-Ra for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Oct 2016 23:52:09 +0100 Original-Received: from localhost ([::1]:60430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0yxX-0001WG-JU for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Oct 2016 18:52:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0yxS-0001WA-0K for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2016 18:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0yxN-000244-VE for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2016 18:52:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0yxN-00023x-RN for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2016 18:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c0yxN-00053O-J5 for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2016 18:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Oct 2016 22:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23436 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23436-submit@debbugs.gnu.org id=B23436.147786787619373 (code B ref 23436); Sun, 30 Oct 2016 22:52:01 +0000 Original-Received: (at 23436) by debbugs.gnu.org; 30 Oct 2016 22:51:16 +0000 Original-Received: from localhost ([127.0.0.1]:37487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0ywd-00052P-Mm for submit@debbugs.gnu.org; Sun, 30 Oct 2016 18:51:15 -0400 Original-Received: from sender163-mail.zoho.com ([74.201.84.163]:21438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0ywb-00052E-LX for 23436@debbugs.gnu.org; Sun, 30 Oct 2016 18:51:14 -0400 Original-Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1477867861356156.11433812219457; Sun, 30 Oct 2016 15:51:01 -0700 (PDT) In-reply-to: <83twbtq03k.fsf@gnu.org> X-Zoho-Virus-Status: 1 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:125168 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-10-30 Sun 09:21 GMT-0700, Eli Zaretskii wrote: >> diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi >> index aca29910b7d3..8f31fa168c23 100644 >> --- a/doc/emacs/maintaining.texi >> +++ b/doc/emacs/maintaining.texi > > This should go to the ELisp manual, not the Emacs User manual. > I don't know how to resolve this issue: there seems no proper place to insert the defun section. I'm gonna leave my updated version of the defun section here in this email, and updated all other parts in the new version of the patch (as attached). You may decide where to put this part. --------------------- vc-responsible-backend defun ------------------------- @defun vc-responsible-backend file This function can be used to determine the responsible VC backend of the given @var{file}. For example, if @file{emacs.c} is a file tracked by git, @code{(vc-responsible-backend "emacs.c")} returns @samp{Git}. Note that if @var{file} is a symbolic link, @code{vc-responsible-backend} will not resolve it---the backend of the symbolic link file itself is reported. Instead, to get the backend VC of the file to which @var{file} refers, wrap @var{file} with a symbolic link resolving function such as @code{file-chase-links}: @smallexample (vc-responsible-backend (file-chase-links "emacs.c")) @end smallexample @end defun --------------------- vc-responsible-backend defun ENDS--------------------- > Last, but not least: documentation changes need ChangeLog-style commit > log messages as well (just use "C-x 4 a" to get a preformatted > skeleton from which you could start). Fixed in the new patch. The new version now also mentions `vc-responsible-backend' in a different way in maintaining.texi. Feel free to review again. Thanks! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-doc-1.patch Content-Transfer-Encoding: quoted-printable diff --git a/doc/emacs/ChangeLog.1 b/doc/emacs/ChangeLog.1 index 3f746ebd763f..c5d150af8124 100644 =2D-- a/doc/emacs/ChangeLog.1 +++ b/doc/emacs/ChangeLog.1 @@ -1,3 +1,8 @@ +2016-10-30 Hong Xu + + * maintaining.texi (Version Control Systems): Mention + `vc-responsible-backend' when explaining VC back ends. + 2015-03-29 Dani Moncayo =20 * files.texi (Diff Mode): Doc fix. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index aca29910b7d3..884d40be5634 100644 =2D-- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -223,7 +223,7 @@ Version Control Systems @cindex SRC @cindex src @item =2DSRC (src) is RCS, reloaded - a specialized version-control system +SRC (src) is RCS, reloaded---a specialized version-control system designed for single-file projects worked on by only one person. It allows multiple files with independent version-control histories to exist in one directory, and is thus particularly well suited for @@ -233,6 +233,10 @@ Version Control Systems supports almost all SRC operations. @end itemize =20 +@findex vc-responsible-backend +To determine which back end is in charge of a file, the function +@code{vc-responsible-backend} can be used. + @node VCS Concepts @subsubsection Concepts of Version Control =20 diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ac020d095397..2ddf4e19e1f7 100644 =2D-- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -959,7 +959,11 @@ vc-responsible-backend If FILE is already registered, return the backend of FILE. If FILE is not registered, then the first backend in `vc-handled-backends' that declares itself =2Dresponsible for FILE is returned." +responsible for FILE is returned. + +Note that if FILE is a symbolic link, it will not be resolved -- +the responsible backend system for the symbolic link itself will +be reported." (or (and (not (file-directory-p file)) (vc-backend file)) (catch 'found ;; First try: find a responsible backend. If this is for registration, --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYFnlQAAoJECZsfTOCL4R4JwAQAJ1C4rNT3XzYc7LII/+nKpBT BRulh7Dctx/E2gDIVeK4J4qW63qFuoES4VqttH8zOVjT1DC7u4lP0lyN2UcRIbWl 7CS5UfjlTTbXmghuC8+n0zwDKW+aMr77eeK4lRKzZa4K7gkJdRySbEUlEcZSZN7C VnWWqEerRhwNPhDFJdIEZf32b7QfFI+4Y9SSGgLiDLY1+HogpKmP9eBF5gYldUdZ YqXzEbczsyoSWIDmbtks77R9nw0m6kAKtgnC9hc3ndqsQ42X9phzMlNYdfG0RLLL XPEwhMUeyxOJ25TZTNB2ce09VL4avv7pH6j9FQIKMcNuQ7vjM7/Fsz/yZn10UvIE Ykeug8jdR96frjpw2E/M+zv4mlcHl4esN4dYwZ4DY/0WFUBrQVMV84ValgeMmOM2 m+o5U2I5DhgR7L6R9c4AikjItIzUvW30s9GwsHoe8ds04+AGwWOhTC/B4GtWYSMg ajTyNv8GZaSSsK4+TUHukESOpVs73wg7pU+tpkWkHQEpTn9FhFe2/yc1INQaC2NG tQEiWL/CWftIdc99G54bnnFCQHsihoxZwzzdIPmMSHsZDtTFSBgvQB7/xsR2CysJ +BEEj51i/5s0K+eUyh/nwKqtcfwZLq/Jw0mkopwo7xmrTB5WbEcjfQQp6VYe7s/z 1/rfkEm614Iyy6HFLuJM =Djss -----END PGP SIGNATURE----- --==-=-=--