aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2000-10-10 01:28:06 +0000
committerThien-Thi Nguyen2000-10-10 01:28:06 +0000
commit46e33aee25c597e34c7a2aa1a73d0dba410327db (patch)
treea13a6258b80aed4a9ce7dccfa0fcaff8ba7bbda7
parent3885aa01bdcb91dc179fad21505009b28e39116a (diff)
downloademacs-46e33aee25c597e34c7a2aa1a73d0dba410327db.tar.gz
emacs-46e33aee25c597e34c7a2aa1a73d0dba410327db.zip
(with-vc-file, edit-vc-file): Specify `indent-function' property.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/vc.el54
2 files changed, 34 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 991e51b727f..a8be2f6025e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12000-10-09 Thien-Thi Nguyen <ttn@gnu.org>
2
3 * vc.el (with-vc-file, edit-vc-file): Specify `indent-function'
4 property.
5
12000-10-09 Dave Love <fx@gnu.org> 62000-10-09 Dave Love <fx@gnu.org>
2 7
3 * toolbar/tool-bar.el (tool-bar-mode): Check whether tool-bar-map 8 * toolbar/tool-bar.el (tool-bar-mode): Check whether tool-bar-map
@@ -46,7 +51,7 @@
46 * vc.el (vc-version-diff): diff-switches can be a list. 51 * vc.el (vc-version-diff): diff-switches can be a list.
47 Use relative filenames for prettier output. 52 Use relative filenames for prettier output.
48 53
49 * pcvs.el (cvs-append-to-ignore, cvs-vc-command-advice) 54 * pcvs.el (cvs-append-to-ignore, cvs-vc-command-advice)
50 (vc-post-command-functions): Remove old-VC compatibility code. 55 (vc-post-command-functions): Remove old-VC compatibility code.
51 56
52 * newcomment.el (comment-indent-default): Autoload. 57 * newcomment.el (comment-indent-default): Autoload.
diff --git a/lisp/vc.el b/lisp/vc.el
index ef89bc85728..6705ab89182 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see below for full credits) 5;; Author: FSF (see below for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc.el,v 1.278 2000/10/05 22:55:17 monnier Exp $ 8;; $Id: vc.el,v 1.279 2000/10/08 19:12:52 monnier Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -489,7 +489,7 @@ SETTINGS is a list of two-element lists, each of which has the
489 (mapcar (lambda (setting) 489 (mapcar (lambda (setting)
490 (let ((property (car setting))) 490 (let ((property (car setting)))
491 (unless (memq property vc-touched-properties) 491 (unless (memq property vc-touched-properties)
492 (put (intern filename vc-file-prop-obarray) 492 (put (intern filename vc-file-prop-obarray)
493 property (cdr setting))))) 493 property (cdr setting)))))
494 ,settings))) 494 ,settings)))
495 495
@@ -517,6 +517,7 @@ somebody else, signal error."
517 (save-excursion 517 (save-excursion
518 ,@body) 518 ,@body)
519 (vc-checkin file nil ,comment))) 519 (vc-checkin file nil ,comment)))
520(put 'with-vc-file 'indent-function 1)
520 521
521;;;###autoload 522;;;###autoload
522(defmacro edit-vc-file (file comment &rest body) 523(defmacro edit-vc-file (file comment &rest body)
@@ -529,6 +530,7 @@ However, before executing BODY, find FILE, and after BODY, save buffer."
529 (set-buffer (find-file-noselect ,file)) 530 (set-buffer (find-file-noselect ,file))
530 ,@body 531 ,@body
531 (save-buffer))) 532 (save-buffer)))
533(put 'edit-vc-file 'indent-function 1)
532 534
533(defun vc-ensure-vc-buffer () 535(defun vc-ensure-vc-buffer ()
534 "Make sure that the current buffer visits a version-controlled file." 536 "Make sure that the current buffer visits a version-controlled file."
@@ -802,7 +804,7 @@ NOT-URGENT means it is ok to continue if the user says not to save."
802 (let ((unchanged (vc-call workfile-unchanged-p file))) 804 (let ((unchanged (vc-call workfile-unchanged-p file)))
803 (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0)) 805 (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
804 unchanged)))) 806 unchanged))))
805 807
806(defun vc-default-workfile-unchanged-p (file) 808(defun vc-default-workfile-unchanged-p (file)
807 "Default check whether FILE is unchanged: diff against master version." 809 "Default check whether FILE is unchanged: diff against master version."
808 (zerop (vc-call diff file (vc-workfile-version file)))) 810 (zerop (vc-call diff file (vc-workfile-version file))))
@@ -835,7 +837,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
835 (if (buffer-modified-p) 837 (if (buffer-modified-p)
836 (or (y-or-n-p "Operate on disk file, keeping modified buffer? ") 838 (or (y-or-n-p "Operate on disk file, keeping modified buffer? ")
837 (error "Aborted"))))) 839 (error "Aborted")))))
838 840
839 ;; Do the right thing 841 ;; Do the right thing
840 (if (not (vc-registered file)) 842 (if (not (vc-registered file))
841 (vc-register verbose comment) 843 (vc-register verbose comment)
@@ -862,7 +864,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
862 (t 864 (t
863 ;; do nothing 865 ;; do nothing
864 (message "%s is up-to-date" file)))) 866 (message "%s is up-to-date" file))))
865 867
866 ;; Abnormal: edited but read-only 868 ;; Abnormal: edited but read-only
867 ((and visited (eq state 'edited) buffer-read-only) 869 ((and visited (eq state 'edited) buffer-read-only)
868 ;; Make the file+buffer read-write. If the user really wanted to 870 ;; Make the file+buffer read-write. If the user really wanted to
@@ -871,7 +873,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
871 (set-file-modes buffer-file-name 873 (set-file-modes buffer-file-name
872 (logior (file-modes buffer-file-name) 128)) 874 (logior (file-modes buffer-file-name) 128))
873 (toggle-read-only -1)) 875 (toggle-read-only -1))
874 876
875 ;; edited 877 ;; edited
876 ((eq state 'edited) 878 ((eq state 'edited)
877 (cond 879 (cond
@@ -896,7 +898,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
896 (if (member vsym vc-handled-backends) 898 (if (member vsym vc-handled-backends)
897 (vc-transfer-file file vsym) 899 (vc-transfer-file file vsym)
898 (vc-checkin file version comment))))))) 900 (vc-checkin file version comment)))))))
899 901
900 ;; locked by somebody else 902 ;; locked by somebody else
901 ((stringp state) 903 ((stringp state)
902 (if comment 904 (if comment
@@ -906,7 +908,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
906 (if verbose (read-string "Version to steal: ") 908 (if verbose (read-string "Version to steal: ")
907 (vc-workfile-version file)) 909 (vc-workfile-version file))
908 state)) 910 state))
909 911
910 ;; needs-patch 912 ;; needs-patch
911 ((eq state 'needs-patch) 913 ((eq state 'needs-patch)
912 (if (yes-or-no-p (format 914 (if (yes-or-no-p (format
@@ -917,7 +919,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
917 (yes-or-no-p "Lock this version? ")) 919 (yes-or-no-p "Lock this version? "))
918 (vc-checkout file t) 920 (vc-checkout file t)
919 (error "Aborted")))) 921 (error "Aborted"))))
920 922
921 ;; needs-merge 923 ;; needs-merge
922 ((eq state 'needs-merge) 924 ((eq state 'needs-merge)
923 (if (yes-or-no-p (format 925 (if (yes-or-no-p (format
@@ -925,7 +927,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
925 (file-name-nondirectory file))) 927 (file-name-nondirectory file)))
926 (vc-maybe-resolve-conflicts file (vc-call merge-news file)) 928 (vc-maybe-resolve-conflicts file (vc-call merge-news file))
927 (error "Aborted"))) 929 (error "Aborted")))
928 930
929 ;; unlocked-changes 931 ;; unlocked-changes
930 ((eq state 'unlocked-changes) 932 ((eq state 'unlocked-changes)
931 (if (not visited) (find-file-other-window file)) 933 (if (not visited) (find-file-other-window file))
@@ -1060,7 +1062,7 @@ first backend that could register the file is used."
1060 (not (file-exists-p buffer-file-name))) 1062 (not (file-exists-p buffer-file-name)))
1061 (set-buffer-modified-p t)) 1063 (set-buffer-modified-p t))
1062 (vc-buffer-sync) 1064 (vc-buffer-sync)
1063 1065
1064 (vc-start-entry buffer-file-name 1066 (vc-start-entry buffer-file-name
1065 (if set-version 1067 (if set-version
1066 (read-string (format "Initial version level for %s: " 1068 (read-string (format "Initial version level for %s: "
@@ -1084,7 +1086,7 @@ first backend that could register the file is used."
1084 1086
1085(defun vc-responsible-backend (file &optional register) 1087(defun vc-responsible-backend (file &optional register)
1086 "Return the name of a backend system that is responsible for FILE. 1088 "Return the name of a backend system that is responsible for FILE.
1087The optional argument REGISTER means that a backend suitable for 1089The optional argument REGISTER means that a backend suitable for
1088registration should be found. 1090registration should be found.
1089 1091
1090If REGISTER is nil, then if FILE is already registered, return the 1092If REGISTER is nil, then if FILE is already registered, return the
@@ -1112,7 +1114,7 @@ be registered."
1112 (if (not register) 1114 (if (not register)
1113 ;; if this is not for registration, the first backend must do 1115 ;; if this is not for registration, the first backend must do
1114 (car vc-handled-backends) 1116 (car vc-handled-backends)
1115 ;; for registration, we need to find a new backend that 1117 ;; for registration, we need to find a new backend that
1116 ;; could register FILE 1118 ;; could register FILE
1117 (dolist (backend vc-handled-backends) 1119 (dolist (backend vc-handled-backends)
1118 (and (not (vc-call-backend backend 'registered file)) 1120 (and (not (vc-call-backend backend 'registered file))
@@ -1121,7 +1123,7 @@ be registered."
1121 (error "No backend that could register"))))) 1123 (error "No backend that could register")))))
1122 1124
1123(defun vc-default-responsible-p (backend file) 1125(defun vc-default-responsible-p (backend file)
1124 "Indicate whether BACKEND is reponsible for FILE. 1126 "Indicate whether BACKEND is reponsible for FILE.
1125The default is to return nil always." 1127The default is to return nil always."
1126 nil) 1128 nil)
1127 1129
@@ -1166,15 +1168,15 @@ rather than user editing!"
1166 (vc-dired-resynch-file file)) 1168 (vc-dired-resynch-file file))
1167 1169
1168(defun vc-start-entry (file rev comment initial-contents msg action &optional after-hook) 1170(defun vc-start-entry (file rev comment initial-contents msg action &optional after-hook)
1169 "Accept a comment for an operation on FILE revision REV. 1171 "Accept a comment for an operation on FILE revision REV.
1170If COMMENT is nil, pop up a VC-log buffer, emit MSG, and set the 1172If COMMENT is nil, pop up a VC-log buffer, emit MSG, and set the
1171action on close to ACTION. If COMMENT is a string and 1173action on close to ACTION. If COMMENT is a string and
1172INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial 1174INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
1173contents of the log entry buffer. If COMMENT is a string and 1175contents of the log entry buffer. If COMMENT is a string and
1174INITIAL-CONTENTS is nil, do action immediately as if the user had 1176INITIAL-CONTENTS is nil, do action immediately as if the user had
1175entered COMMENT. If COMMENT is t, also do action immediately with an 1177entered COMMENT. If COMMENT is t, also do action immediately with an
1176empty comment. Remember the file's buffer in `vc-parent-buffer' 1178empty comment. Remember the file's buffer in `vc-parent-buffer'
1177\(current one if no file). AFTER-HOOK specifies the local value 1179\(current one if no file). AFTER-HOOK specifies the local value
1178for vc-log-operation-hook." 1180for vc-log-operation-hook."
1179 (let ((parent (or (and file (get-file-buffer file)) (current-buffer)))) 1181 (let ((parent (or (and file (get-file-buffer file)) (current-buffer))))
1180 (if vc-before-checkin-hook 1182 (if vc-before-checkin-hook
@@ -1256,7 +1258,7 @@ REV defaults to the latest revision."
1256(defun vc-finish-steal (file version) 1258(defun vc-finish-steal (file version)
1257 ;; This is called when the notification has been sent. 1259 ;; This is called when the notification has been sent.
1258 (message "Stealing lock on %s..." file) 1260 (message "Stealing lock on %s..." file)
1259 (with-vc-properties 1261 (with-vc-properties
1260 file 1262 file
1261 (vc-call steal-lock file version) 1263 (vc-call steal-lock file version)
1262 `((vc-state . edited))) 1264 `((vc-state . edited)))
@@ -1284,7 +1286,7 @@ Runs the normal hook `vc-checkin-hook'."
1284 ;; RCS 5.7 gripes about white-space-only comments too. 1286 ;; RCS 5.7 gripes about white-space-only comments too.
1285 (or (and comment (string-match "[^\t\n ]" comment)) 1287 (or (and comment (string-match "[^\t\n ]" comment))
1286 (setq comment "*** empty log message ***")) 1288 (setq comment "*** empty log message ***"))
1287 (with-vc-properties 1289 (with-vc-properties
1288 file 1290 file
1289 ;; Change buffers to get local value of vc-checkin-switches. 1291 ;; Change buffers to get local value of vc-checkin-switches.
1290 (with-current-buffer (or (get-file-buffer file) (current-buffer)) 1292 (with-current-buffer (or (get-file-buffer file) (current-buffer))
@@ -1390,7 +1392,7 @@ May be useful as a `vc-checkin-hook' to update change logs automatically."
1390 (bury-buffer) 1392 (bury-buffer)
1391 (pop-to-buffer tmp-vc-parent-buffer)))) 1393 (pop-to-buffer tmp-vc-parent-buffer))))
1392 ;; Now make sure we see the expanded headers 1394 ;; Now make sure we see the expanded headers
1393 (if log-file 1395 (if log-file
1394 (vc-resynch-buffer log-file vc-keep-workfiles t)) 1396 (vc-resynch-buffer log-file vc-keep-workfiles t))
1395 (if vc-dired-mode 1397 (if vc-dired-mode
1396 (dired-move-to-filename)) 1398 (dired-move-to-filename))
@@ -1653,7 +1655,7 @@ See Info node `Merging'."
1653 "File must be checked out for merging. Check out now? ") 1655 "File must be checked out for merging. Check out now? ")
1654 (vc-checkout file t) 1656 (vc-checkout file t)
1655 (error "Merge aborted")))) 1657 (error "Merge aborted"))))
1656 (setq first-version 1658 (setq first-version
1657 (read-string (concat "Branch or version to merge from " 1659 (read-string (concat "Branch or version to merge from "
1658 "(default: news on current branch): "))) 1660 "(default: news on current branch): ")))
1659 (if (string= first-version "") 1661 (if (string= first-version "")
@@ -1663,8 +1665,8 @@ See Info node `Merging'."
1663 (if (not (vc-find-backend-function backend 'merge)) 1665 (if (not (vc-find-backend-function backend 'merge))
1664 (error "Sorry, merging is not implemented for %s" backend) 1666 (error "Sorry, merging is not implemented for %s" backend)
1665 (if (not (vc-branch-p first-version)) 1667 (if (not (vc-branch-p first-version))
1666 (setq second-version 1668 (setq second-version
1667 (read-string "Second version: " 1669 (read-string "Second version: "
1668 (concat (vc-branch-part first-version) "."))) 1670 (concat (vc-branch-part first-version) ".")))
1669 ;; We want to merge an entire branch. Set versions 1671 ;; We want to merge an entire branch. Set versions
1670 ;; accordingly, so that vc-BACKEND-merge understands us. 1672 ;; accordingly, so that vc-BACKEND-merge understands us.
@@ -2255,8 +2257,8 @@ A prefix argument NOREVERT means do not revert the buffer afterwards."
2255 file 2257 file
2256 (vc-call cancel-version file norevert) 2258 (vc-call cancel-version file norevert)
2257 `((vc-state . ,(if norevert 'edited 'up-to-date)) 2259 `((vc-state . ,(if norevert 'edited 'up-to-date))
2258 (vc-checkout-time . ,(if norevert 2260 (vc-checkout-time . ,(if norevert
2259 0 2261 0
2260 (nth 5 (file-attributes file)))) 2262 (nth 5 (file-attributes file))))
2261 (vc-workfile-version . nil))) 2263 (vc-workfile-version . nil)))
2262 (message "Removing last change from %s...done" file) 2264 (message "Removing last change from %s...done" file)
@@ -2625,7 +2627,7 @@ colors. `vc-annotate-background' specifies the background color."
2625 (if (not (vc-find-backend-function vc-annotate-backend 'annotate-command)) 2627 (if (not (vc-find-backend-function vc-annotate-backend 'annotate-command))
2626 (error "Sorry, annotating is not implemented for %s" 2628 (error "Sorry, annotating is not implemented for %s"
2627 vc-annotate-backend)) 2629 vc-annotate-backend))
2628 (with-output-to-temp-buffer temp-buffer-name 2630 (with-output-to-temp-buffer temp-buffer-name
2629 (vc-call-backend vc-annotate-backend 'annotate-command 2631 (vc-call-backend vc-annotate-backend 'annotate-command
2630 (file-name-nondirectory (buffer-file-name)) 2632 (file-name-nondirectory (buffer-file-name))
2631 (get-buffer temp-buffer-name))) 2633 (get-buffer temp-buffer-name)))