aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-05-12 16:37:30 +0000
committerDan Nicolaescu2008-05-12 16:37:30 +0000
commit93614fc1f83ac10ea4bf179b85722ca7e724f31e (patch)
treeedeaa34d3733da8a1b9b61dc03615362c1b4bec0
parentb257def74f82f6ec650636014ecd2acba76aaf3c (diff)
downloademacs-93614fc1f83ac10ea4bf179b85722ca7e724f31e.tar.gz
emacs-93614fc1f83ac10ea4bf179b85722ca7e724f31e.zip
(with-vc-file, edit-vc-file): Remove unused macros.
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/vc.el39
2 files changed, 1 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ae63e0b4065..49388f59fbc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
2 2
3 * vc.el (vc-annotate-show-diff-revision-at-line): Remove incorrect 3 * vc.el (vc-annotate-show-diff-revision-at-line): Remove incorrect
4 cons. Use vc-annotate-backend. 4 cons. Use vc-annotate-backend.
5 (with-vc-file, edit-vc-file): Remove unused macros.
5 6
62008-05-12 Teodor Zlatanov <tzz@lifelogs.com> 72008-05-12 Teodor Zlatanov <tzz@lifelogs.com>
7 8
diff --git a/lisp/vc.el b/lisp/vc.el
index 68f0aa2c464..c0998be883a 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -922,45 +922,6 @@ been updated to their corresponding values."
922 (put (intern file vc-file-prop-obarray) 922 (put (intern file vc-file-prop-obarray)
923 property (cdr setting)))))))) 923 property (cdr setting))))))))
924 924
925;; Two macros for elisp programming
926
927;;;###autoload
928(defmacro with-vc-file (file comment &rest body)
929 "Check out a writable copy of FILE if necessary, then execute BODY.
930Check in FILE with COMMENT (a string) after BODY has been executed.
931FILE is passed through `expand-file-name'; BODY executed within
932`save-excursion'. If FILE is not under version control, or you are
933using a locking version-control system and the file is locked by
934somebody else, signal error."
935 (declare (debug t) (indent 2))
936 (let ((filevar (make-symbol "file")))
937 `(let ((,filevar (expand-file-name ,file)))
938 (or (vc-backend ,filevar)
939 (error "File not under version control: `%s'" file))
940 (unless (vc-editable-p ,filevar)
941 (let ((state (vc-state ,filevar)))
942 (if (stringp state)
943 (error "`%s' is locking `%s'" state ,filevar)
944 (vc-checkout ,filevar t))))
945 (save-excursion
946 ,@body)
947 (vc-checkin (list ,filevar) nil ,comment))))
948
949;;;###autoload
950(defmacro edit-vc-file (file comment &rest body)
951 "Edit FILE under version control, executing body.
952Checkin with COMMENT after executing BODY.
953This macro uses `with-vc-file', passing args to it.
954However, before executing BODY, find FILE, and after BODY, save buffer."
955 (declare (debug t) (indent 2))
956 (let ((filevar (make-symbol "file")))
957 `(let ((,filevar (expand-file-name ,file)))
958 (with-vc-file
959 ,filevar ,comment
960 (set-buffer (find-file-noselect ,filevar))
961 ,@body
962 (save-buffer)))))
963
964;;; Code for deducing what fileset and backend to assume 925;;; Code for deducing what fileset and backend to assume
965 926
966(defun vc-responsible-backend (file &optional register) 927(defun vc-responsible-backend (file &optional register)