Gnus development mailing list
 help / color / mirror / Atom feed
* Update copyright years automatically?
@ 2011-01-02  5:26 Lars Magne Ingebrigtsen
  2011-01-02 13:49 ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-02  5:26 UTC (permalink / raw)
  To: ding

Should we add `copyright-fix-years' to .dir-locals in gnus/lisp to have
that happen automatically, or is that too annoying?

If it is, what would be the most convenient way for me to have that
happen anyway?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Update copyright years automatically?
  2011-01-02  5:26 Update copyright years automatically? Lars Magne Ingebrigtsen
@ 2011-01-02 13:49 ` Andreas Schwab
  2011-01-02 19:36   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2011-01-02 13:49 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Should we add `copyright-fix-years' to .dir-locals in gnus/lisp to have
> that happen automatically, or is that too annoying?
>
> If it is, what would be the most convenient way for me to have that
> happen anyway?  :-)

(add-hook 'write-file-functions 'copyright-update)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Update copyright years automatically?
  2011-01-02 13:49 ` Andreas Schwab
@ 2011-01-02 19:36   ` Lars Magne Ingebrigtsen
  2011-01-02 23:18     ` Kevin Ryde
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-02 19:36 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:

> (add-hook 'write-file-functions 'copyright-update)

I did

(setq before-save-hook
      (lambda ()
	(when (string-match "gnus/lisp/.*.el\\'" (buffer-file-name))
	  (copyright-update))))

to avoid having that happen other places.

It's kinda annoying that `copyright-update' queries me when saving, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Update copyright years automatically?
  2011-01-02 19:36   ` Lars Magne Ingebrigtsen
@ 2011-01-02 23:18     ` Kevin Ryde
  2011-01-02 23:48       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Ryde @ 2011-01-02 23:18 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> (setq before-save-hook
>       (lambda ()

Supposedly there may be an incompatible change planned in the future to
take away that single func in a hook feature
(http://debbugs.gnu.org/cgi-bin/bugreport.cgi?bug=5026)

> 	(when (string-match "gnus/lisp/.*.el\\'" (buffer-file-name))
> 	  (copyright-update))))

I never found a clean way to express what should or shouldn't be
updated.

> It's kinda annoying that `copyright-update' queries me when saving, though.

Maybe `copyright-query'.  I'd like it to show the buffer and highlight
the change it's about to make, like a query-replace, since occasionally
it's wrong.



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

* Re: Update copyright years automatically?
  2011-01-02 23:18     ` Kevin Ryde
@ 2011-01-02 23:48       ` Lars Magne Ingebrigtsen
  2011-01-03  1:01         ` Kevin Ryde
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-02 23:48 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

> Maybe `copyright-query'.  I'd like it to show the buffer and highlight
> the change it's about to make, like a query-replace, since occasionally
> it's wrong.

What about changing it so that it's always right?  :-)

Ok, that may not be generally possible, but in, er, well-maintained
Emacs-included code like the gnus .el files, the format is very regular,
so just updating it without querying should be possible, I think.
Perhaps an optional parameter to `copyright-update'?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Update copyright years automatically?
  2011-01-02 23:48       ` Lars Magne Ingebrigtsen
@ 2011-01-03  1:01         ` Kevin Ryde
  2011-01-03  4:43           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Ryde @ 2011-01-03  1:01 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> Perhaps an optional parameter to `copyright-update'?

Oh, is it (setq copyright-query nil) though?



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

* Re: Update copyright years automatically?
  2011-01-03  1:01         ` Kevin Ryde
@ 2011-01-03  4:43           ` Lars Magne Ingebrigtsen
  2011-01-03  4:55             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-03  4:43 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

> Oh, is it (setq copyright-query nil) though?

Ah, that should do the trick.  Thanks.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Update copyright years automatically?
  2011-01-03  4:43           ` Lars Magne Ingebrigtsen
@ 2011-01-03  4:55             ` Lars Magne Ingebrigtsen
  2011-01-10 22:32               ` Kevin Ryde
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-03  4:55 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Ah, that should do the trick.  Thanks.

The only annoyance now is that it doesn't re-fill the paragraph after
inserting the new year.  Shouldn't it just do that unconditionally?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Update copyright years automatically?
  2011-01-03  4:55             ` Lars Magne Ingebrigtsen
@ 2011-01-10 22:32               ` Kevin Ryde
  2011-01-10 23:29                 ` Russ Allbery
  2011-01-11 18:48                 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Kevin Ryde @ 2011-01-10 22:32 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> The only annoyance now is that it doesn't re-fill the paragraph after
> inserting the new year.  Shouldn't it just do that unconditionally?

It could helpfully do that.  There seems to be a refill when it "fixes"
two-digit years, but not when just adding.

I suppose hanging indents like

 ;; Copyright (C) 1985, 1986, 1988, 1993, 1994, 1997, 1998, 2000, 2001,
 ;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 ;;   Free Software Foundation, Inc.

might need a helping hand to create correctly when one-line becomes long
enough to turn into two-lines.



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

* Re: Update copyright years automatically?
  2011-01-10 22:32               ` Kevin Ryde
@ 2011-01-10 23:29                 ` Russ Allbery
  2011-01-11 18:48                 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 11+ messages in thread
From: Russ Allbery @ 2011-01-10 23:29 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

> It could helpfully do that.  There seems to be a refill when it "fixes"
> two-digit years, but not when just adding.

> I suppose hanging indents like

>  ;; Copyright (C) 1985, 1986, 1988, 1993, 1994, 1997, 1998, 2000, 2001,
>  ;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
>  ;;   Free Software Foundation, Inc.

> might need a helping hand to create correctly when one-line becomes long
> enough to turn into two-lines.

BTW, the GNU coding standards have been modified to allow compaction of
dates into a range (like 1997-2009) provided that the project has a note
in the README explaining what the range means.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



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

* Re: Update copyright years automatically?
  2011-01-10 22:32               ` Kevin Ryde
  2011-01-10 23:29                 ` Russ Allbery
@ 2011-01-11 18:48                 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-11 18:48 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

> I suppose hanging indents like
>
>  ;; Copyright (C) 1985, 1986, 1988, 1993, 1994, 1997, 1998, 2000, 2001,
>  ;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
>  ;;   Free Software Foundation, Inc.
>
> might need a helping hand to create correctly when one-line becomes long
> enough to turn into two-lines.

`M-q' in these cases seem to do the right thing, so the copyright code
could just call that function.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2011-01-11 18:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-02  5:26 Update copyright years automatically? Lars Magne Ingebrigtsen
2011-01-02 13:49 ` Andreas Schwab
2011-01-02 19:36   ` Lars Magne Ingebrigtsen
2011-01-02 23:18     ` Kevin Ryde
2011-01-02 23:48       ` Lars Magne Ingebrigtsen
2011-01-03  1:01         ` Kevin Ryde
2011-01-03  4:43           ` Lars Magne Ingebrigtsen
2011-01-03  4:55             ` Lars Magne Ingebrigtsen
2011-01-10 22:32               ` Kevin Ryde
2011-01-10 23:29                 ` Russ Allbery
2011-01-11 18:48                 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).