This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Copyright updates
> Date: Wed, 3 Jan 2007 23:41:49 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb@sourceware.org
>
> On Thu, Jan 04, 2007 at 06:32:06AM +0200, Eli Zaretskii wrote:
> > Why are we including a package in GDB that is part of Emacs, and
> > why modify it while doing that? Can't we simply tell people ``use
> > copyright.el from Emacs''?
>
> Pragmatics: Because I needed to modify it to get the results I posted.
> Otherwise, it has no respect for margins - it would just push things
> further and further out to the right.
I suggest below a modification in your script that should take care of
filling the copyright years, please see if it solves the problem.
I promised to see if copyright.el can be fixed to fill the results
after adding the missing year, but I cannot see any good way of doing
that, since copyright.el does not only support FSF copyrights, but is
supposed to honor copyrights of other organizations. So I think it's
best to refill in your script, which is what I've done below.
> And because the version in the last release of emacs was too old to
> use
I tested the change I suggest below with Emacs 21.4. It works, but I
don't recommend using copyright.el from v21.x, as it has bugs when the
copyright years span more than one line. For example, it goofs with
ada-typeprint.c: it adds 2007 after 2000, not after 2004. Perhaps we
should add a comment about this in your script.
> +cat > copytmp.el <<EOF
> +(setq copyright-query nil)
> +(setq vc-cvs-stay-local nil)
> +(load-file "copyright.el")
> +EOF
> +
> +for f in $prunes $byhand; do
> + prune_opts="$prune_opts -name $f -prune -o"
> +done
> +
> +for f in $(find . $prune_opts -type f -print); do
> + cat >> copytmp.el <<EOF
> +(switch-to-buffer (find-file "$f"))
> +(setq backup-inhibited t)
> +(setq write-file-hooks '())
> +(copyright-update) <<<<<<<<<<
> +(save-buffer)
> +(kill-buffer (buffer-name))
> +EOF
> +done
> +
> +cat >> copytmp.el <<EOF
> +(kill-emacs)
> +(delete-file "copytmp.el")
> +EOF
I suggest to modify this slightly: instead of the single line marked
with <<<<<<<<<<, use the following lines (indentation is not
important, it's here for readability):
(widen)
(goto-char (point-min))
(if (re-search-forward copyright-regexp (+ (point) copyright-limit) t)
(progn
(setq copyright-update t
copyright-query nil
fill-column 78
start (point-marker)
end (progn
(re-search-forward
"Free[ \t\n]+Software[ \t\n]+Foundation,[ \t\n]+Inc\."
(+ (point) copyright-limit) t)
(point-marker))
fsf-start (copy-marker (match-beginning 0)))
(replace-match "Free_Software_Foundation,_Inc." t t)
(copyright-update)
(fill-region-as-paragraph start end)
(replace-string "_" " " nil fsf-start end))
(message "WARNING: No copyright message found in $f"))
In case you wonder, the "Free_Software_Foundation,_Inc." gork is to
avoid breaking up "Free Software Foundation, Inc." during filling, but
at the same time to account for its length.