Mercurial > emacs
comparison lisp/vc-hooks.el @ 94548:089a9212abc0
(vc-call, vc-state): Fix typos in docstrings.
(vc-default-state-heuristic): Doc fix.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 02 May 2008 09:19:29 +0000 |
parents | 135f7ef84766 |
children | a0bb8ca25a33 |
comparison
equal
deleted
inserted
replaced
94547:607b4fd9f3bc | 94548:089a9212abc0 |
---|---|
285 (t (apply f args))))) | 285 (t (apply f args))))) |
286 | 286 |
287 (defmacro vc-call (fun file &rest args) | 287 (defmacro vc-call (fun file &rest args) |
288 "A convenience macro for calling VC backend functions. | 288 "A convenience macro for calling VC backend functions. |
289 Functions called by this macro must accept FILE as the first argument. | 289 Functions called by this macro must accept FILE as the first argument. |
290 ARGS specifies any additional arguments. FUN should be unquoted. | 290 ARGS specifies any additional arguments. FUN should be unquoted. |
291 BEWARE!! `file' is evaluated twice!!" | 291 BEWARE!! FILE is evaluated twice!!" |
292 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) | 292 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) |
293 | 293 |
294 (defsubst vc-parse-buffer (pattern i) | 294 (defsubst vc-parse-buffer (pattern i) |
295 "Find PATTERN in the current buffer and return its Ith submatch." | 295 "Find PATTERN in the current buffer and return its Ith submatch." |
296 (goto-char (point-min)) | 296 (goto-char (point-min)) |
363 root)) | 363 root)) |
364 | 364 |
365 ;; Access functions to file properties | 365 ;; Access functions to file properties |
366 ;; (Properties should be _set_ using vc-file-setprop, but | 366 ;; (Properties should be _set_ using vc-file-setprop, but |
367 ;; _retrieved_ only through these functions, which decide | 367 ;; _retrieved_ only through these functions, which decide |
368 ;; if the property is already known or not. A property should | 368 ;; if the property is already known or not. A property should |
369 ;; only be retrieved by vc-file-getprop if there is no | 369 ;; only be retrieved by vc-file-getprop if there is no |
370 ;; access function.) | 370 ;; access function.) |
371 | 371 |
372 ;; properties indicating the backend being used for FILE | 372 ;; properties indicating the backend being used for FILE |
373 | 373 |
529 without VC knowing it. | 529 without VC knowing it. |
530 | 530 |
531 'unregistered The file is not under version control. | 531 'unregistered The file is not under version control. |
532 | 532 |
533 A return of nil from this function means we have no information on the | 533 A return of nil from this function means we have no information on the |
534 status of this file. | 534 status of this file." |
535 " | |
536 ;; Note: in Emacs 22 and older, return of nil meant the file was unregistered. | 535 ;; Note: in Emacs 22 and older, return of nil meant the file was unregistered. |
537 ;; This is potentially a source of backward-compatibility bugs. | 536 ;; This is potentially a source of backward-compatibility bugs. |
538 | 537 |
539 ;; FIXME: New (sub)states needed (?): | 538 ;; FIXME: New (sub)states needed (?): |
540 ;; - `conflict' (i.e. `edited' with conflict markers) | 539 ;; - `conflict' (i.e. `edited' with conflict markers) |
554 (defsubst vc-up-to-date-p (file) | 553 (defsubst vc-up-to-date-p (file) |
555 "Convenience function that checks whether `vc-state' of FILE is `up-to-date'." | 554 "Convenience function that checks whether `vc-state' of FILE is `up-to-date'." |
556 (eq (vc-state file) 'up-to-date)) | 555 (eq (vc-state file) 'up-to-date)) |
557 | 556 |
558 (defun vc-default-state-heuristic (backend file) | 557 (defun vc-default-state-heuristic (backend file) |
559 "Default implementation of vc-state-heuristic. | 558 "Default implementation of vc-BACKEND-state-heuristic. |
560 It simply calls the real state computation function `vc-BACKEND-state' | 559 It simply calls the real state computation function `vc-BACKEND-state' |
561 and does not employ any heuristic at all." | 560 and does not employ any heuristic at all." |
562 (vc-call-backend backend 'state file)) | 561 (vc-call-backend backend 'state file)) |
563 | 562 |
564 (defun vc-workfile-unchanged-p (file) | 563 (defun vc-workfile-unchanged-p (file) |
677 | 676 |
678 (defun vc-toggle-read-only (&optional verbose) | 677 (defun vc-toggle-read-only (&optional verbose) |
679 "Change read-only status of current buffer, perhaps via version control. | 678 "Change read-only status of current buffer, perhaps via version control. |
680 | 679 |
681 If the buffer is visiting a file registered with version control, | 680 If the buffer is visiting a file registered with version control, |
682 throw an error, because this is not a safe or really meaningful operation | 681 throw an error, because this is not a safe or really meaningful operation |
683 on any version-control system newer than RCS. | 682 on any version-control system newer than RCS. |
684 | 683 |
685 Otherwise, just change the read-only flag of the buffer. | 684 Otherwise, just change the read-only flag of the buffer. |
686 | 685 |
687 If you bind this function to \\[toggle-read-only], then Emacs | 686 If you bind this function to \\[toggle-read-only], then Emacs |
688 will properly intercept all attempts to toggle the read-only flag | 687 will properly intercept all attempts to toggle the read-only flag |