User: scop
Date: 05/11/28 22:08:23
Modified: packages/unsupported/scop/vc ChangeLog log-edit.el
Log:
Sync log-edit.el with upstream.
Revision Changes Path
1.50 +1 -1 XEmacs/packages/unsupported/scop/STATUS
Index: STATUS
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/STATUS,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -p -r1.49 -r1.50
--- STATUS 2005/11/14 22:32:24 1.49
+++ STATUS 2005/11/28 21:08:19 1.50
@@ -17,5 +17,5 @@ generic-modes: generic.el and generic-x.
- Compiles, seems to work, auto-mode-alist and autoloads may need spanking.
vc: vc*.el and a few other related files from GNU Emacs
-- Up to date with GNU Emacs CVS HEAD as of 2005-11-15.
+- Up to date with GNU Emacs CVS HEAD as of 2005-11-28.
- Compiles, something even works.
1.36 +4 -0 XEmacs/packages/unsupported/scop/vc/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/vc/ChangeLog,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -p -r1.35 -r1.36
--- ChangeLog 2005/11/14 22:52:32 1.35
+++ ChangeLog 2005/11/28 21:08:22 1.36
@@ -1,3 +1,7 @@
+2005-11-28 Ville Skyttä <scop(a)xemacs.org>
+
+ * log-edit.el: Sync with upstream.
+
2005-11-15 Ville Skyttä <scop(a)xemacs.org>
* vc-svn.el: Sync with upstream.
1.7 +65 -46 XEmacs/packages/unsupported/scop/vc/log-edit.el
Index: log-edit.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/vc/log-edit.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- log-edit.el 2005/10/08 14:43:00 1.6
+++ log-edit.el 2005/11/28 21:08:23 1.7
@@ -120,8 +120,10 @@ If SETUP is 'force, this variable has no
log-edit-insert-changelog)
"*Hook run at the end of `log-edit'."
:group 'log-edit
-:type '(hook :options (log-edit-insert-cvs-template
- log-edit-insert-changelog)))
+:type '(hook :options (log-edit-insert-changelog
+ log-edit-insert-cvs-rcstemplate
+ log-edit-insert-cvs-template
+ log-edit-insert-filenames)))
(defcustom log-edit-mode-hook (if (boundp 'vc-log-mode-hook) vc-log-mode-hook)
"*Hook run when entering `log-edit-mode'."
@@ -281,21 +283,14 @@ automatically."
(insert "\n"))))
;; Compatibility with old names.
-;; XEmacs change: only 2 args to `make-obsolete(-variable)' in < 21.4.17
-(defvaralias 'vc-comment-ring 'log-edit-comment-ring)
-(make-obsolete-variable 'vc-comment-ring 'log-edit-comment-ring)
-(defvaralias 'vc-comment-ring-index 'log-edit-comment-ring-index)
-(make-obsolete-variable 'vc-comment-ring-index 'log-edit-comment-ring-index)
-(defalias 'vc-previous-comment 'log-edit-previous-comment)
-(make-obsolete 'vc-previous-comment 'log-edit-previous-comment)
-(defalias 'vc-next-comment 'log-edit-next-comment)
-(make-obsolete 'vc-next-comment 'log-edit-next-comment)
-(defalias 'vc-comment-search-reverse 'log-edit-comment-search-backward)
-(make-obsolete 'vc-comment-search-reverse 'log-edit-comment-search-backward)
-(defalias 'vc-comment-search-forward 'log-edit-comment-search-forward)
-(make-obsolete 'vc-comment-search-forward 'log-edit-comment-search-forward)
-(defalias 'vc-comment-to-change-log 'log-edit-comment-to-change-log)
-(make-obsolete 'vc-comment-to-change-log 'log-edit-comment-to-change-log)
+;; XEmacs change: only 2 args to `define-obsolete-*-alias'
+(define-obsolete-variable-alias 'vc-comment-ring 'log-edit-comment-ring)
+(define-obsolete-variable-alias 'vc-comment-ring-index
'log-edit-comment-ring-index)
+(define-obsolete-function-alias 'vc-previous-comment 'log-edit-previous-comment)
+(define-obsolete-function-alias 'vc-next-comment 'log-edit-next-comment)
+(define-obsolete-function-alias 'vc-comment-search-reverse
'log-edit-comment-search-backward)
+(define-obsolete-function-alias 'vc-comment-search-forward
'log-edit-comment-search-forward)
+(define-obsolete-function-alias 'vc-comment-to-change-log
'log-edit-comment-to-change-log)
;;;
;;; Actual code
@@ -397,31 +392,6 @@ If you want to abort the commit, simply
"Return the list of files that are about to be committed."
(ignore-errors (funcall log-edit-listfun)))
-
-(defun log-edit-insert-changelog ()
- "Insert a log message by looking at the ChangeLog.
-The idea is to write your ChangeLog entries first, and then use this
-command to commit your changes.
-
-To select default log text, we:
-- find the ChangeLog entries for the files to be checked in,
-- verify that the top entry in the ChangeLog is on the current date
- and by the current user; if not, we don't provide any default text,
-- search the ChangeLog entry for paragraphs containing the names of
- the files we're checking in, and finally
-- use those paragraphs as the log text."
- (interactive)
- (log-edit-insert-changelog-entries (log-edit-files))
- (log-edit-set-common-indentation)
- (goto-char (point-min))
- (when (looking-at "\\*\\s-+")
- (forward-line 1)
- (when (not (re-search-forward "^\\*\\s-+" nil t))
- (goto-char (point-min))
- (skip-chars-forward "^():")
- (skip-chars-forward ": ")
- (delete-region (point-min) (point)))))
-
(defun log-edit-mode-help ()
"Provide help for the `log-edit-mode-map'."
(interactive)
@@ -466,11 +436,27 @@ To select default log text, we:
(selected-window)))))
(defun log-edit-insert-cvs-template ()
- "Insert the template specified by the CVS administrator, if any."
+ "Insert the template specified by the CVS administrator, if any.
+This simply uses the local CVS/Template file."
+ (interactive)
+ (when (or (interactive-p) (= (point-min) (point-max)))
+ (when (file-readable-p "CVS/Template")
+ (insert-file-contents "CVS/Template"))))
+
+(defun log-edit-insert-cvs-rcstemplate ()
+ "Insert the rcstemplate from the CVS repository.
+This contacts the repository to get the rcstemplate file and
+can thus take some time."
(interactive)
- (when (file-readable-p "CVS/Template")
- (insert-file-contents "CVS/Template")))
+ (when (or (interactive-p) (= (point-min) (point-max)))
+ (when (file-readable-p "CVS/Entries")
+ (call-process "cvs" nil t nil "checkout" "-p"
"CVSROOT/rcstemplate"))))
+(defun log-edit-insert-filenames ()
+ "Insert the list of files that are to be committed."
+ (interactive)
+ (insert "Affected files: \n"
+ (mapconcat 'identity (log-edit-files) " \n")))
(defun log-edit-add-to-changelog ()
"Insert this log message into the appropriate ChangeLog file."
@@ -483,6 +469,37 @@ To select default log text, we:
(save-excursion
(log-edit-comment-to-change-log)))))
+(defvar log-edit-changelog-use-first nil)
+(defun log-edit-insert-changelog (&optional use-first)
+ "Insert a log message by looking at the ChangeLog.
+The idea is to write your ChangeLog entries first, and then use this
+command to commit your changes.
+
+To select default log text, we:
+- find the ChangeLog entries for the files to be checked in,
+- verify that the top entry in the ChangeLog is on the current date
+ and by the current user; if not, we don't provide any default text,
+- search the ChangeLog entry for paragraphs containing the names of
+ the files we're checking in, and finally
+- use those paragraphs as the log text.
+
+If the optional prefix arg USE-FIRST is given (via \\[universal-argument]),
+or if the command is repeated a second time in a row, use the first log entry
+regardless of user name or time."
+ (interactive "P")
+ (let ((log-edit-changelog-use-first
+ (or use-first (eq last-command 'log-edit-insert-changelog))))
+ (log-edit-insert-changelog-entries (log-edit-files)))
+ (log-edit-set-common-indentation)
+ (goto-char (point-min))
+ (when (looking-at "\\*\\s-+")
+ (forward-line 1)
+ (when (not (re-search-forward "^\\*\\s-+" nil t))
+ (goto-char (point-min))
+ (skip-chars-forward "^():")
+ (skip-chars-forward ": ")
+ (delete-region (point-min) (point)))))
+
;;;;
;;;; functions for getting commit message from ChangeLog a file...
;;;; Courtesy Jim Blandy
@@ -562,7 +579,9 @@ Return non-nil iff it is."
(functionp add-log-time-format)
(funcall add-log-time-format))
(format-time-string "%Y-%m-%d"))))
- (looking-at (regexp-quote (format "%s %s <%s>" time name mail)))))
+ (looking-at (if log-edit-changelog-use-first
+ "[^ \t]"
+ (regexp-quote (format "%s %s <%s>" time name
mail))))))
(defun log-edit-changelog-entries (file)
"Return the ChangeLog entries for FILE, and the ChangeLog they came from.
Show replies by date