Anonymous committed ff4e54a

patch-to-changelog new features

Comments (0)

Files changed (2)

+2000-10-24  Didier Verna  <>
+	* add-log.el (patch-to-change-log): new cl keywords
+	:keep-source-files, :extent-property and :extent-property-value,
+	documented in the docstring.
+	Returns a list of modified ChangeLog buffers.
 2000-10-11  Fraser Young <>
 	* compile.el (compilation-find-file): Reset buffer
 	* compile.el : Added grep-find command (+ associated variables)
 	from FSF Emacs. Only one change to FSF code required, namely to
 	use read-shell-command rather than read-from-minibuffer in
-	grep-find. 
+	grep-find.
 2000-02-16  Yoshiki Hayashi  <>
 	* compile.el: Delete garbage.
 1998-07-01  Carsten Leonhardt  <>
-	* passwd.el (passwd-secure-display): Invert colors only in current 
+	* passwd.el (passwd-secure-display): Invert colors only in current
 	frame. This avoids messing up the colors in tty frames while
 	working in X frames.
 	(passwd-insecure-display): Ditto.
 	* add-log.el (prompt-for-change-log-name): use find-change-log to
 	find the default by searching upwards from the current directory
-	for a ChangeLog file.  Change the read-file-name prompt to present 
+	for a ChangeLog file.  Change the read-file-name prompt to present
 	user with the default, with point at the end of the directory
-	component. 
+	component.
 1998-01-17  SL Baur  <>
 1997-12-20  SL Baur  <>
 	* Makefile: Created.
 running `diff' directly, but *ONLY* unified-format (-u) diffs. #### Someone
 should fix this to handle context diffs as well.
-Allowed keys are :my-name, defaulting to
- (or add-log-full-name (user-full-name)),
-and :my-email, defaulting to
- (or add-log-mailing-address (user-mail-address))."
+The following keys are allowed:
+- :my-name defines the name to use in ChangeLog entries
+  (defaults to `(or add-log-full-name (user-full-name))'),
+- :my-email defines the email address to use in ChangeLog entries
+  (defaults to `(or add-log-mailing-address (user-mail-address))'),
+- :keep-source-files prevents `patch-to-changelog' from killing the source
+  file buffers after the ChangeLog skeleton is created
+  (defaults to nil),
+- :extent-property instructs `patch-to-changelog' to create extents
+  containing the newly created ChangeLog entries, with that property set
+  (defaults to nil),
+- :extent-property-value is used in conjunction with :extent-property to
+  specify a value for the extent property
+  (defaults to nil)."
   (interactive "DBase directory of patch: ")
       ((:my-name (or add-log-full-name (user-full-name)))
-       (:my-email (or add-log-mailing-address (user-mail-address))))
+       (:my-email (or add-log-mailing-address (user-mail-address)))
+       :keep-source-files :extent-property :extent-property-value)
     (let* ((font-lock-auto-fontify nil)
 	   (file-re1 "Index: \\(\\S-*\\)")
 	   (done-hash (make-hashtable 20 'equal))
 	   (new-fun-hash (make-hashtable 20 'equal))
 	   (nomore-fun-hash (make-hashtable 20 'equal))
-	   change-log-buffer
+	   change-log-buffer change-log-buffers
 	   file absfile limit current-defun delete-p
 	   dirname basename previous-dirname dirname-relative-to-change-log
 	   all-entries first-file-re-p
+	      (push change-log-buffer change-log-buffers)
 	      (add-change-log-string "\n")
 	      (with-current-buffer change-log-buffer
 		(goto-char (point-min)))))
                    (cd dirname)
+	      (when cl-extent-property
+		(with-current-buffer change-log-buffer
+		  (set-extent-properties (make-extent (point-min) (point-min))
+		    `(end-open nil
+                      ,cl-extent-property ,cl-extent-property-value))
+		  ))
 	      (setq insertion-marker (point-min-marker change-log-buffer))
 	       (format (concat "%s  " cl-my-name "  <" cl-my-email
 		      (format "\t* %s (%s): Removed.\n" basename fun)))
 		;; now try to handle what changed.
 		(let (trylines
 		      (trystart t)
 					     "\t* %s (%s):\n" "\t* %s:\n")
 					 basename current-defun)))
-		      (unless already-visiting-p
+		      (unless (or already-visiting-p cl-keep-source-files)
 			(kill-buffer (current-buffer))))))))
-	(add-change-log-string "\n")))))
+	(add-change-log-string "\n")
+	;; return the list of ChangeLog buffers
+	change-log-buffers))))
 (provide 'add-log)