all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* copyright-update-directory / Copyright at the bottom of files
@ 2008-03-02 15:31 Reiner Steib
  2008-03-03  2:00 ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2008-03-02 15:31 UTC (permalink / raw)
  To: emacs-devel; +Cc: Glenn Morris

Hi,

(1) copyright-update-directory

I found the command `copyright-update-directory' (see below) quite
handy for updating the copyright years in Gnus (v5_10 branch).

But maybe such a functionality is already there?  Glenn, how did you
handle updating the years and the switch to GPLv3?

Unless there are objections or there is a better solution available,
I'll add this to `copyright.el' in a few days:

--8<---------------cut here---------------start------------->8---
(defun copyright-update-directory (directory match)
  "Update copyright notice for all files in DIRECTORY matching MATCH."
  (interactive "DDirectory: \nMFilenames matching: ")
  (dolist (file (directory-files directory t match nil))
    (find-file file)
    (let ((copyright-query nil))
      (copyright-update))
    (save-buffer)
    (kill-buffer (current-buffer))))
--8<---------------cut here---------------end--------------->8---

(2) Update copyright at the bottom of files

As because of `copyright-limit's default of 2000, it fails to update
the years in (Gnus) ChangeLog files.  Maybe `copyright-update' should
search at the bottom of the file as well?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: copyright-update-directory / Copyright at the bottom of files
  2008-03-02 15:31 copyright-update-directory / Copyright at the bottom of files Reiner Steib
@ 2008-03-03  2:00 ` Glenn Morris
  2008-04-12 10:06   ` Reiner Steib
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2008-03-03  2:00 UTC (permalink / raw)
  To: emacs-devel

Reiner Steib wrote:

> But maybe such a functionality is already there?  Glenn, how did you
> handle updating the years and the switch to GPLv3?

I used a shell-script with awk. :)

> Unless there are objections or there is a better solution available,
> I'll add this to `copyright.el' in a few days:
>
> --8<---------------cut here---------------start------------->8---
> (defun copyright-update-directory (directory match)
>   "Update copyright notice for all files in DIRECTORY matching MATCH."

Worth having, IMO.

> As because of `copyright-limit's default of 2000, it fails to update
> the years in (Gnus) ChangeLog files.  Maybe `copyright-update' should
> search at the bottom of the file as well?

Good idea. Perhaps controlled by a buffer-local variable that could be
set non-nil in ChangeLogs?




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: copyright-update-directory / Copyright at the bottom of files
  2008-03-03  2:00 ` Glenn Morris
@ 2008-04-12 10:06   ` Reiner Steib
  2008-04-22  2:58     ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2008-04-12 10:06 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

On Mon, Mar 03 2008, Glenn Morris wrote:

> Reiner Steib wrote:
[...]
>> Unless there are objections or there is a better solution available,
>> I'll add this to `copyright.el' in a few days:
>>
>> --8<---------------cut here---------------start------------->8---
>> (defun copyright-update-directory (directory match)
>>   "Update copyright notice for all files in DIRECTORY matching MATCH."
>
> Worth having, IMO.

Added.

>> As because of `copyright-limit's default of 2000, it fails to update
>> the years in (Gnus) ChangeLog files.  Maybe `copyright-update' should
>> search at the bottom of the file as well?
>
> Good idea. Perhaps controlled by a buffer-local variable that could be
> set non-nil in ChangeLogs?

A buffer-local variable makes sense.  But ChangeLogs should be treated
like this automatically (i.e. w/o such a variable, maybe by checking
major-mode).  Are there any other files that usually have the
copyright near the end?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: copyright-update-directory / Copyright at the bottom of files
  2008-04-12 10:06   ` Reiner Steib
@ 2008-04-22  2:58     ` Glenn Morris
  0 siblings, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2008-04-22  2:58 UTC (permalink / raw)
  To: emacs-devel

Reiner Steib wrote:

> A buffer-local variable makes sense.  But ChangeLogs should be treated
> like this automatically (i.e. w/o such a variable, maybe by checking
> major-mode).

Added `copyright-at-end-flag', set non-nil in change-log-mode.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-22  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-02 15:31 copyright-update-directory / Copyright at the bottom of files Reiner Steib
2008-03-03  2:00 ` Glenn Morris
2008-04-12 10:06   ` Reiner Steib
2008-04-22  2:58     ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.