[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pcl-cvs and insertion ChangeLogs

From: Alfred M. Szmidt
Subject: pcl-cvs and insertion ChangeLogs
Date: Wed, 01 Dec 2004 02:13:59 +0100


I whiped up this hack, it isn't tested that well at all; so if anyone
thinks of commiting it before the release, don't.  Just sharing it,
and tossing it out for discussion.

Some projects like to insert the full ChangeLog entry into the CVS
log.  And this adds a option that enables such an option, or atleast

Happy hacking (and some serious sleeping for my part)

diff -up /usr/hacks/share/emacs/21.3.50/lisp/log-edit.el 
--- /usr/hacks/share/emacs/21.3.50/lisp/log-edit.el     2004-09-15 
00:01:58.000000000 +0200
+++ /tmp/buffer-content-767267u 2004-12-01 02:06:46.000000000 +0100
@@ -162,6 +162,11 @@ should contain only the text for the cha
 file, because the log is per-file.  This is the behaviour you get
 when this variable is set to nil.")
+(defvar log-edit-changelog-full-entries nil
+  "*If non-nil, include a full ChangeLog entry in the log.
+This may be set in the ``local variables'' section of a ChangeLog, to
+indicate the policy for that ChangeLog.")
 ;;;; Internal global or buffer-local vars
 (defconst log-edit-files-buf "*log-edit-files*")
@@ -488,18 +493,21 @@ To select default log text, we:
 (defun log-edit-narrow-changelog ()
   "Narrow to the top page of the current buffer, a ChangeLog file.
-Actually, the narrowed region doesn't include the date line.
+The narrowed region doesn't include the date line unless
+`log-edit-changelog-full-entries' is non-nil.
 A \"page\" in a ChangeLog file is the area between two dates."
   (or (eq major-mode 'change-log-mode)
       (error "log-edit-narrow-changelog: current buffer isn't a ChangeLog"))
   (goto-char (point-min))
-  ;; Skip date line and subsequent blank lines.
-  (forward-line 1)
-  (if (looking-at "[ \t\n]*\n")
-      (goto-char (match-end 0)))
+  (if (not log-edit-changelog-full-entries)
+      ;; Skip date line and subsequent blank lines.
+      (progn
+       (forward-line 1)
+       (if (looking-at "[ \t\n]*\n")
+           (goto-char (match-end 0)))))
   (let ((start (point)))
     (forward-page 1)
     (narrow-to-region start (point))
@@ -535,14 +543,24 @@ If we are between sub-paragraphs, return
       (list (point) (point)))))
+(defun log-edit-changelog-full ()
+  "Return the bounds of a full ChangeLog entry."
+  (list (point-min) (point-max)))
 (defun log-edit-changelog-entry ()
   "Return the bounds of the ChangeLog entry containing point.
-The variable `log-edit-changelog-full-paragraphs' decides whether an
-\"entry\" is a paragraph or a subparagraph; see its documentation string
-for more details."
-  (if log-edit-changelog-full-paragraphs
-      (log-edit-changelog-paragraph)
-    (log-edit-changelog-subparagraph)))
+The variable `log-edit-changelog-full-paragraphs' decides whether
+an \"entry\" is a paragraph or a subparagraph; see its
+documentation string for more details.  The variable
+`log-edit-full-entries' decides wheter \"entry\" is a full
+ChangeLog entry or not; see its documentation string for more
+  (if log-edit-changelog-full-entries
+      (log-edit-changelog-full)
+    (if log-edit-changelog-full-paragraphs
+       (log-edit-changelog-paragraph)
+      (log-edit-changelog-subparagraph))))
 (defvar user-full-name)
 (defvar user-mail-address)

Diff finished.  Wed Dec  1 02:06:47 2004

reply via email to

[Prev in Thread] Current Thread [Next in Thread]