summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-12-01 23:49:35 -0500
committerEric S. Raymond <esr@thyrsus.com>2014-12-01 23:49:35 -0500
commit2fb8b146f74791d7cbe702292b8197913d437c75 (patch)
treef0f5b8d13ff9d2e94db08e398a8127b90b4b0b32 /lisp
parentea99f8c1ab8e97a54116e50157dd4bd6f1247b91 (diff)
downloademacs-2fb8b146f74791d7cbe702292b8197913d437c75.tar.gz
Remove clear-headers from VC's public method set.
* vc/vc.el and all backends: API simplification; clear-headers is no longer a public method. It is now local to the one place it's used, in the RCS steal-lock method.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc/vc-git.el1
-rw-r--r--lisp/vc/vc-hg.el1
-rw-r--r--lisp/vc/vc-rcs.el19
-rw-r--r--lisp/vc/vc-src.el1
-rw-r--r--lisp/vc/vc.el31
6 files changed, 23 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6c2b33ea566..d005cbef920 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-02 Eric S. Raymond <esr@snark.thyrsus.com>
+
+ * vc/vc.el and all backends: API simplification; clear-headers
+ is no longer a public method. It is now local to the one place
+ it's used, in the RCS steal-lock method.
+
2014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el and all backends: API simplification; could-register
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 93c5ff805f6..3538f2c3828 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -95,7 +95,6 @@
;; - previous-revision (file rev) OK
;; - next-revision (file rev) OK
;; - check-headers () COULD BE SUPPORTED
-;; - clear-headers () NOT NEEDED
;; - delete-file (file) OK
;; - rename-file (old new) OK
;; - find-file-hook () OK
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index b5be8d5f04c..35f5354da65 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -85,7 +85,6 @@
;; - previous-revision (file rev) OK
;; - next-revision (file rev) OK
;; - check-headers () ??
-;; - clear-headers () ??
;; - delete-file (file) TEST IT
;; - rename-file (old new) OK
;; - find-file-hook () added for bug#10709
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index c9e4d409924..40a102789b9 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -528,7 +528,22 @@ Needs RCS 5.6.2 or later for -M."
(vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev))
;; Do a real checkout after stealing the lock, so that we see
;; expanded headers.
- (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev))))
+ (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev))
+ ;; Must clear any headers here because they wouldn't
+ ;; show that the file is locked now.
+ (let* ((filename (or file buffer-file-name))
+ (visited (find-buffer-visiting filename)))
+ (if visited
+ (let ((context (vc-buffer-context)))
+ ;; save-excursion may be able to relocate point and mark
+ ;; properly. If it fails, vc-restore-buffer-context
+ ;; will give it a second try.
+ (save-excursion
+ (vc-rcs-clear-headers))
+ (vc-restore-buffer-context context))
+ (set-buffer (find-file-noselect filename))
+ (vc-rcs-clear-headers)
+ (kill-buffer filename)))))
(defun vc-rcs-modify-change-comment (files rev comment)
"Modify the change comments change on FILES on a specified REV. If FILE is a
@@ -943,7 +958,7 @@ Uses `rcs2log' which only works for RCS and CVS."
\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
(defun vc-rcs-clear-headers ()
- "Implementation of vc-clear-headers for RCS."
+ "Clear RCS header value parts."
(let ((case-fold-search nil))
(goto-char (point-min))
(while (re-search-forward
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index c93ff96fd29..f3d0585b30c 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -73,7 +73,6 @@
;; - previous-revision (file rev) ??
;; - next-revision (file rev) ??
;; - check-headers () ??
-;; - clear-headers () ??
;; - delete-file (file) ??
;; * rename-file (old new) OK
;; - find-file-hook () NOT NEEDED
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9e6b049e084..52deb13e4dd 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -514,15 +514,6 @@
;;
;; Return non-nil if the current buffer contains any version headers.
;;
-;; - clear-headers ()
-;;
-;; In the current buffer, reset all version headers to their unexpanded
-;; form. This function should be provided if the state-querying code
-;; for this backend uses the version headers to determine the state of
-;; a file. This function will then be called whenever VC changes the
-;; version control state in such a way that the headers would give
-;; wrong information.
-;;
;; - delete-file (file)
;;
;; Delete FILE and mark it as deleted in the repository. If this
@@ -1287,9 +1278,6 @@ For old-style locking-based version control systems, like RCS:
"Claim lock retaining changes? ")))
(progn (vc-call-backend backend 'steal-lock file)
(clear-visited-file-modtime)
- ;; Must clear any headers here because they wouldn't
- ;; show that the file is locked now.
- (vc-clear-headers file)
(write-file buffer-file-name)
(vc-mode-line file backend))
(if (not (yes-or-no-p
@@ -2001,25 +1989,6 @@ the variable `vc-BACKEND-header'."
(when (string-match (car f) buffer-file-name)
(insert (format (cdr f) (car hdstrings)))))))))))
-(defun vc-clear-headers (&optional file)
- "Clear all version headers in the current buffer (or FILE).
-The headers are reset to their non-expanded form."
- (let* ((filename (or file buffer-file-name))
- (visited (find-buffer-visiting filename))
- (backend (vc-backend filename)))
- (when (vc-find-backend-function backend 'clear-headers)
- (if visited
- (let ((context (vc-buffer-context)))
- ;; save-excursion may be able to relocate point and mark
- ;; properly. If it fails, vc-restore-buffer-context
- ;; will give it a second try.
- (save-excursion
- (vc-call-backend backend 'clear-headers))
- (vc-restore-buffer-context context))
- (set-buffer (find-file-noselect filename))
- (vc-call-backend backend 'clear-headers)
- (kill-buffer filename)))))
-
(defun vc-modify-change-comment (files rev oldcomment)
"Edit the comment associated with the given files and revision."
;; Less of a kluge than it looks like; log-view mode only passes