>>>> "Stephen" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
Stephen> Hacked this up while not proctoring the national
Stephen> university entrance exam (still had to sit around with no
Stephen> net access in case one of the proctors got sick).
Stephen> Lightly tested. An early version generated the patch "New FAQ.
Stephen> XEmacs bitches about xmodmap."
Hi Stephen,
here's the patch I promised in another patch :-)
This works on Windows 2000 too now.
TODO:
ChangeLogs should be searched like patch-to-change-log does it (using
find-change-log).
See
(defun patch-to-change-log (devdir &rest cl-keys)
in
"c:\\Program Files\\XEmacs\\xemacs-packages\\lisp\\xemacs-base\\add-log.el"
I can't get it to produce -U 0 diffs for ChangeLog files and -u diffs
for other files.
Don't know why this is so, not even the cvs -f switch helped. It's
either that or the other for all files even though you use two
separate commands in (shell-command ...). I don't understand that
one.
Anyway, I am using gnus/message and this works fine.
Hope this still works for you with VM after you set mail-user-agent
accordingly, if you haven't yet done so.
Best regards,
Adrian
ChangeLog:
2001-01-21 Adrian Aichner <adrian(a)xemacs.org>
* sjt-prepare-xemacs-patch.el: Don't require vm any longer.
Update comments.
* sjt-prepare-xemacs-patch.el (sjt/prepare-xemacs-patch): Convert
to user-configurable `compose-mail'. Fix infinite loop bug in
event of missing ChangeLog entries.
patch:
Don't know where you want to put it, I just have it in xemacsweb
because I had to save it somewhere. I won't check it in there, of
course.
cd c:\Hacking\Sourceforge\xemacsweb\
diff -u sjt-prepare-xemacs-patch.el.orig sjt-prepare-xemacs-patch.el
Compilation started at Sun Jan 21 01:34:00 2001 +0100 (W. Europe Standard Time)
--- sjt-prepare-xemacs-patch.el.orig Sun Jan 21 01:26:07 2001
+++ sjt-prepare-xemacs-patch.el Sun Jan 21 01:33:41 2001
@@ -27,6 +27,8 @@
;;
;; * Currently only knows about VM, but should be easily adaptable to
;; message. (Patches welcome!)
+;; * APA: Use compose-mail instead of vm-mail. This allows user to
+;; choose favorite `mail-user-agent'.
;; * Isn't a Perl script.
;;
;; To do:
@@ -37,8 +39,6 @@
;; * Customize.
;; * Port to Perl.
-(require 'vm)
-
(defvar sjt/prepare-xemacs-patch-root
"/coda/Projects/XEmacs"
"Root of XEmacs workspace. XEmacs modules should be checked out into
@@ -80,19 +80,19 @@
in the same directory, the parent, and so on up to top level. They may be
omitted from FILES.
-Example: (sjt/prepare-xemacs-patch "21.2-HEAD"
"man/xemacs-faq.texi")
+Example: (sjt/prepare-xemacs-patch \"21.2-HEAD\"
\"man/xemacs-faq.texi\")
does
cd /coda/Projects/XEmacs/21.2-HEAD
- diff -U 0 man/ChangeLog
- diff -u man/xemacs-faq.texi
+ cvs diff -U 0 man/ChangeLog
+ cvs diff -u man/xemacs-faq.texi
and sets up the header
To: XEmacs Patches <xemacs-patches(a)xemacs.org>
Subject: [21.2]
-BUG: The only message agent available is vm-mail."
+"
;; #### Do argument parsing with existence check on $top/$module, and
;; using an iterator to get filenames with check and completion.
@@ -100,9 +100,9 @@
;; Parse the arguments.
(let ((top (expand-file-name module sjt/prepare-xemacs-patch-root))
- (relpaths (split-string files))
- (logs nil)
- (notfound nil))
+ (relpaths (split-string files))
+ (logs nil)
+ (notfound nil))
;; Air-check module
(if (not (file-exists-p top))
@@ -156,25 +156,29 @@
notfound)))
(message "Aborted!")
;; Set up message buffer.
- (vm-mail "XEmacs Patches <xemacs-patches(a)xemacs.org>")
- (insert "\n\n\n")
- (backward-char)
+ ;; Use compose-mail so user can pick favorite `mail-user-agent'.
+ (compose-mail
+ "XEmacs Patches <xemacs-patches(a)xemacs.org>"
+ (format "[%s]"
+ (cdr (assoc module
+ sjt/prepare-xemacs-patch-module-tag-alist))))
+ (insert "\n")
+ (cd (directory-file-name top))
(shell-command
- (apply #'concat
- `("cd "
- ,(directory-file-name top)
- " ; cvs diff -U 0"
+ (apply 'concat
+ `("cvs -f -z3 diff -U 0"
,@(mapcar #'(lambda (el) (concat " " el)) logs)
- " 2>/dev/null ; cvs diff -u"
+ " 2>" ,grep-null-device " ; cvs -f -z3 diff -u"
,@(mapcar #'(lambda (el) (concat " " el)) relpaths)
- " 2>/dev/null"))
+ " 2>" ,grep-null-device))
t)
;; Check for successful cvs diff and munge change lines like mrb's
;; cvs-diff
(let ((diffs (append logs relpaths)))
(mail-text)
- (while diffs
+ ;; APA: avoid infinite looping by checking for eobp
+ (while (and (not (eobp)) diffs)
(re-search-forward sjt/diff-index-re nil t)
(let ((full (match-string 1))
(prefix (match-string 2))
@@ -206,10 +210,7 @@
;; could try redoing the diff here
(when diffs
(mail-text)
- (insert (format "**** cvs diff of %s failed! *****" diffs))))
+ (insert (format "**** cvs diff of %s failed! *****\n" diffs))))
- ;; Set up subject header
- (mail-subject)
- (let ((tag (cdr (assoc module
- sjt/prepare-xemacs-patch-module-tag-alist))))
- (if tag (insert "[" tag "] "))))))
+ ;; Go to subject header
+ (mail-subject))))
Compilation exited abnormally with code 1 at Sun Jan 21 01:34:00
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/