[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 23570fd: Clarify documentation of 'vc-responsible
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 23570fd: Clarify documentation of 'vc-responsible-backend' wrt symlinks |
Date: |
Fri, 4 Nov 2016 10:06:56 +0000 (UTC) |
branch: emacs-25
commit 23570fd995a1a5586c85b440d552ec5b6077ed39
Author: Hong Xu <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Clarify documentation of 'vc-responsible-backend' wrt symlinks
* lisp/vc/vc.el (vc-responsible-backend): Clarify that symlinks
are not resolved when the VC backend is reported.
* doc/lispref/files.texi (Truenames): Document
'vc-responsible-backend'. (Bug#23436)
* doc/emacs/maintaining.texi (Version Control Systems): Fix a
typo.
---
doc/emacs/maintaining.texi | 2 +-
doc/lispref/files.texi | 15 +++++++++++++++
lisp/vc/vc.el | 6 +++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index aca2991..0a47b4c 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -223,7 +223,7 @@ basic editing operations under Bazaar.
@cindex SRC
@cindex src
@item
-SRC (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
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 6b7ee19..544992d 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1138,6 +1138,21 @@ compares the truenames of the two directories. If
@var{dir} does not
name an existing directory, the return value is @code{nil}.
@end defun
address@hidden vc-responsible-backend file
+This function determines the responsible VC backend of the given
address@hidden For example, if @file{emacs.c} is a file tracked by Git,
address@hidden@code{(vc-responsible-backend "emacs.c")}} returns @samp{Git}.
+Note that if @var{file} is a symbolic link,
address@hidden will not resolve it---the backend of the
+symbolic link file itself is reported. 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}:
+
address@hidden
+(vc-responsible-backend (file-chase-links "emacs.c"))
address@hidden smallexample
address@hidden defun
+
@node File Attributes
@subsection File Attributes
@cindex file attributes
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index ac020d0..2ddf4e1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -959,7 +959,11 @@ use."
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
-responsible 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,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 23570fd: Clarify documentation of 'vc-responsible-backend' wrt symlinks,
Eli Zaretskii <=