diff options
| author | Hong Xu | 2016-11-04 12:06:00 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-11-04 12:06:00 +0200 |
| commit | 23570fd995a1a5586c85b440d552ec5b6077ed39 (patch) | |
| tree | 19ed57a3057ba2e12c0a4fd36a12f3c66d4a7875 | |
| parent | f708cb22a1608f8a5aea671afebea44d216d9496 (diff) | |
| download | emacs-23570fd995a1a5586c85b440d552ec5b6077ed39.tar.gz emacs-23570fd995a1a5586c85b440d552ec5b6077ed39.zip | |
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.
| -rw-r--r-- | doc/emacs/maintaining.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 15 | ||||
| -rw-r--r-- | 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 aca29910b7d..0a47b4c3b76 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -223,7 +223,7 @@ basic editing operations under Bazaar. | |||
| 223 | @cindex SRC | 223 | @cindex SRC |
| 224 | @cindex src | 224 | @cindex src |
| 225 | @item | 225 | @item |
| 226 | SRC (src) is RCS, reloaded - a specialized version-control system | 226 | SRC (src) is RCS, reloaded---a specialized version-control system |
| 227 | designed for single-file projects worked on by only one person. It | 227 | designed for single-file projects worked on by only one person. It |
| 228 | allows multiple files with independent version-control histories to | 228 | allows multiple files with independent version-control histories to |
| 229 | exist in one directory, and is thus particularly well suited for | 229 | exist in one directory, and is thus particularly well suited for |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 6b7ee19d5f3..544992d4ba5 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 | |||
| 1138 | name an existing directory, the return value is @code{nil}. | 1138 | name an existing directory, the return value is @code{nil}. |
| 1139 | @end defun | 1139 | @end defun |
| 1140 | 1140 | ||
| 1141 | @defun vc-responsible-backend file | ||
| 1142 | This function determines the responsible VC backend of the given | ||
| 1143 | @var{file}. For example, if @file{emacs.c} is a file tracked by Git, | ||
| 1144 | @w{@code{(vc-responsible-backend "emacs.c")}} returns @samp{Git}. | ||
| 1145 | Note that if @var{file} is a symbolic link, | ||
| 1146 | @code{vc-responsible-backend} will not resolve it---the backend of the | ||
| 1147 | symbolic link file itself is reported. To get the backend VC of the | ||
| 1148 | file to which @var{file} refers, wrap @var{file} with a symbolic link | ||
| 1149 | resolving function such as @code{file-chase-links}: | ||
| 1150 | |||
| 1151 | @smallexample | ||
| 1152 | (vc-responsible-backend (file-chase-links "emacs.c")) | ||
| 1153 | @end smallexample | ||
| 1154 | @end defun | ||
| 1155 | |||
| 1141 | @node File Attributes | 1156 | @node File Attributes |
| 1142 | @subsection File Attributes | 1157 | @subsection File Attributes |
| 1143 | @cindex file attributes | 1158 | @cindex file attributes |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ac020d09539..2ddf4e19e1f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -959,7 +959,11 @@ use." | |||
| 959 | If FILE is already registered, return the | 959 | If FILE is already registered, return the |
| 960 | backend of FILE. If FILE is not registered, then the | 960 | backend of FILE. If FILE is not registered, then the |
| 961 | first backend in `vc-handled-backends' that declares itself | 961 | first backend in `vc-handled-backends' that declares itself |
| 962 | responsible for FILE is returned." | 962 | responsible for FILE is returned. |
| 963 | |||
| 964 | Note that if FILE is a symbolic link, it will not be resolved -- | ||
| 965 | the responsible backend system for the symbolic link itself will | ||
| 966 | be reported." | ||
| 963 | (or (and (not (file-directory-p file)) (vc-backend file)) | 967 | (or (and (not (file-directory-p file)) (vc-backend file)) |
| 964 | (catch 'found | 968 | (catch 'found |
| 965 | ;; First try: find a responsible backend. If this is for registration, | 969 | ;; First try: find a responsible backend. If this is for registration, |