Commit a52f3e5d authored by Pascal J. Bourguignon's avatar Pascal J. Bourguignon

Bumped copyright year.

parent de2206f5
......@@ -13,7 +13,7 @@
#LEGAL
# GPL
#
# Copyright Pascal J. Bourguignon 2003 - 2003
# Copyright Pascal J. Bourguignon 2003 - 2011
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2006 - 2006
;;;; Copyright Pascal J. Bourguignon 2006 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2005 - 2005
;;;; Copyright Pascal Bourguignon 2005 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -19,7 +19,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2004
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2005 - 2005
;;;; Copyright Pascal Bourguignon 2005 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2003
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2004 - 2004
;;;; Copyright Pascal Bourguignon 2004 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -27,7 +27,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2006
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -21,7 +21,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2010 - 2010
;;;; Copyright Pascal J. Bourguignon 2010 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2004 - 2004
;;;; Copyright Pascal Bourguignon 2004 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2003 - 2003
;;;; Copyright Pascal Bourguignon 2003 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2005 - 2005
;;;; Copyright Pascal Bourguignon 2005 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2003 - 2003
;;;; Copyright Pascal Bourguignon 2003 - 2011
;;;; mailto:pjb@informatimago.com
;;;;
;;;; This program is free software; you can redistribute it and/or
......
......@@ -22,7 +22,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2010
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......@@ -2057,6 +2057,102 @@ to the buffer instead of local to the mode."
;;;----------------------------------------
;;; Radio Londre
;;;----------------------------------------
(defvar *radio-londre-messages*
'("Andromaque se parfume à la lavande."
"Athalie est restée en extase. Nous disons deux fois : Athalie est restée en extase."
"Attention elle mord. Nous disons trois fois."
"Baissez donc les paupières."
"Bercent mon coeur d'une langueur monotone."
"C'est évidemment un tort."
"Clarisse a les yeux bleus, nous disons, Clarisse a les yeux bleus."
"Clarisse sera vengée. Nous disons deux fois..."
"Clémentine peut se curer les dents."
"De Camille à Amicha : six amis trouveront qu'elle mord ce soir. Nous disons : six amis trouveront qu'elle mord ce soir."
"De Marie-Thérèse à Marie-Louise : un ami viendra ce soir."
"Demain, la mélasse deviendra du cognac."
"Du bouledogue au sanglier : vous recevrez encore des amis ce soir. Le vent souffle les flambeaux. Nous disons : vous recevrez encore des amis ce soir. Le vent souffle les flambeaux.."
"Écoute mon cœur qui pleure."
"Elle est rasoir, Jeannie. Nous disons deux fois..."
"Elle restera sur le dos."
"Fréderick était roi de Prusse; nous disons quatre fois."
"Gabrielle vous envoie ses amitiés."
"Grand-Mère mange nos bonbons."
"Gustave est très doux. Nous disons deux fois..."
"Heureux qui comme Ulysse a fait un long voyage."
"Il a pleuré de joie."
"Il a une voix de fausset."
"Il est sévère mais juste (+ code du département)."
"Il est temps de cueillir des tomates."
"Il fait chaud à Suez."
"Il faut avoir des pipes pour trier les lentilles."
"Il n'y a plus de tabac dans la tabatière."
"Il pleut toujours en Angleterre."
"J'aime les chats siamois."
"Je n'aime pas la blanquette de veau."
"Je n'aime pas les crêpes Suzette."
"Je veux être parrain."
"Jean a une moustache très longue."
"Jeannette a du cran. Nous disons deux fois."
"L'acide rougit le tournesol."
"L'angora a les poils longs."
"L'éléphant s'est cassé une défense."
"L'heure des combats viendra."
"L'infirme veut courir."
"La Bénédictine est une liqueur douce."
"La fortune vient en dormant."
"La jeunesse est l'espoir du pays."
"La mort de Turenne est irréparable."
"La secrétaire est jolie."
"La vache saute par dessus la lune."
"La vertu réduit dans tous les yeux."
"Le canapé se trouve au milieu du salon."
"Le chacal n'aime pas le vermicelle. Nous disons : Le chacal n'aime pas le vermicelle."
"Le chat a neuf vies."
"Le chercheur d'or ira à la foire. Nous disons deux fois..."
"Le cheval bleu se promène sur l'horizon."
"Le chimpanzé est protocolaire. Nous disons trois fois..."
"Le cocker est bon chasseur. Nous disons trois fois..."
"Le coq chantera à minuit."
"Le facteur s'est endormi."
"Le grand blond s'appelle Bill."
"Le musicien est enthousiaste."
"Le père La Cerise est verni."
"Le sapin est vert, je répète, le sapin est vert."
"Le soleil se lève à l'Est le dimanche."
"Les carottes sont cuites."
"Les dés sont sur la table."
"Les fraises sont dans leur jus."
"Les girafes ne portent pas de faux-col."
"Les noix sont sèches."
"Les sanglots longs des violons de l'automne."
"Lily embrasse Mimi. Nous disons : Lily embrasse Mimi..."
"Lisette va bien."
"Louis a deux cochons."
"Ma femme à l'oeil vif."
"Message très important pour Samuel : L'octogénaire ne se déride pas. Attendez deux voitures et des amis sur le bonbon. Nous disons : L'octogénaire ne se déride pas. Attendez deux voitures et des amis sur le bonbon..."
"Messieurs faites vos jeux."
"Michel-Ange et Raphael sont immortels."
"Paul a du bon tabac."
"Pierrot ressemble à son grand-père."
"Rien ne m'est plus."
"Saint Liguori fonda Naples."
"Tambours, battez la charge, quatre fois. Nous disons : Tambours, battez la charge, quatre fois."
"Tante Amélie fait du vélo en short."
"Tu monteras la colline deux fois."
"Une poule sur un mur picore du pain dur."
"Véronèse était un peintre."
"Yvette aime les grosses carottes."))
(defun radio-londre (&optional insertp)
(interactive "P")
(funcall (if insertp
(function insert)
(function message))
(elt *radio-londre-messages* (random (length *radio-londre-messages*)))))
;;;----------------------------------------
......@@ -2177,21 +2273,25 @@ EXCEPTIONS: either a list of pathnames that musthn't be processed,
or a predicate indicating the pathnames that mustn't be processed.
"
(dolist (file (directory-files directory))
(let ((stat (file-attributes file))
(predicate (cond
((null exceptions)
(constantly nil))
((functionp exceptions)
exceptions)
((listp exceptions)
(byte-compile `(lambda (x) (member* x ',exceptions :test (function string=)))))
(t (error "exceptions must be either a list or a function, not a ~S: ~S"
(type-of exceptions) exceptions))))
(path (concat directory
(if (string= (subseq directory (1- (length directory)))
"/")
"" "/")
file)))
(let* ((predicate (cond
((null exceptions)
(constantly nil))
((functionp exceptions)
exceptions)
((listp exceptions)
(byte-compile `(lambda (x) (member* x ',exceptions :test (function string=)))))
(t (error "exceptions must be either a list or a function, not a ~S: ~S"
(type-of exceptions) exceptions))))
(path (concat directory
(if (string= (subseq directory (1- (length directory)))
"/")
"" "/")
file))
(stat (file-attributes path)))
;; (message "\n\nstat = %S" stat)
;; (message "recursive = %S" recursive)
;; (message "path = %S" path)
;; (message "filter (funcall predicate path) -> %S" (funcall predicate path))
(case (first stat)
((t) ; directory
(unless (or (string= "." file) (string= ".." file))
......@@ -2200,7 +2300,7 @@ EXCEPTIONS: either a list of pathnames that musthn't be processed,
(mapfiles thunk path recursive predicate)))))
((nil) ; file
(unless (funcall predicate path)
(funcall thunk path)))
(funcall thunk path)))
(otherwise ; symlink
;; NOP
)))))
......@@ -2215,10 +2315,8 @@ EXCEPTIONS: either a list of pathnames that musthn't be processed,
;;; multi-file replace
;;;----------------------------------------
(defvar *recursive-replace-ignored-directories*
'("_darcs" ".darcsrepo" ".svn" ".hg" ".git" "CVS" "RCS" "MT" "SCCS"
".tmp_versions" "{arch}" ".arch-ids"
"BitKeeper" "ChangeSet" "autom4te.cache"))
(defvar *recursive-replace-ignored-directories* *ignorable-directories*)
(defun recursive-replace-string (from-string to-string &optional directory recursive delimited)
......
......@@ -40,7 +40,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2006 - 2006
;;;; Copyright Pascal Bourguignon 2006 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2006 - 2006
;;;; Copyright Pascal Bourguignon 2006 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2010 - 2010
;;;; Copyright Pascal J. Bourguignon 2010 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2003 - 2003
;;;; Copyright Pascal Bourguignon 2003 - 2011
;;;; mailto:pjb@informatimago.com
;;;;
;;;; This program is free software; you can redistribute it and/or
......
......@@ -24,7 +24,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2007 - 2007
;;;; Copyright Pascal Bourguignon 2007 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -23,7 +23,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -22,7 +22,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -17,7 +17,7 @@
;;;; 2002-12-03 <PJB> Common-Lisp'ized.
;;;;BUGS
;;;;LEGAL
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This script is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2010 - 2010
;;;; Copyright Pascal J. Bourguignon 2010 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -23,7 +23,7 @@
;;;; 2002-11-16 <PJB> Created.
;;;;BUGS
;;;;LEGAL
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This script is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2005 - 2005
;;;; Copyright Pascal Bourguignon 2005 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -41,7 +41,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2001 - 2001
;;;; Copyright Pascal J. Bourguignon 2001 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -388,7 +388,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2003 - 2010
;;;; Copyright Pascal J. Bourguignon 2003 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -19,7 +19,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2007 - 2007
;;;; Copyright Pascal Bourguignon 2007 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -20,7 +20,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2003 - 2003
;;;; Copyright Pascal Bourguignon 2003 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2001
;;;; Copyright Pascal J. Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 2002 - 2002
;;;; Copyright Pascal J. Bourguignon 2002 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......
......@@ -16,7 +16,7 @@
;;;;LEGAL
;;;; GPL
;;;;
;;;; Copyright Pascal Bourguignon 2004 - 2004
;;;; Copyright Pascal Bourguignon 2004 - 2011
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
......
......@@ -37,7 +37,7 @@
;;;;LEGAL
;;;; LGPL
;;;;
;;;; Copyright Pascal J. Bourguignon 1990 - 2004
;;;; Copyright Pascal Bourguignon 1990 - 2011
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
......@@ -94,6 +94,16 @@
(defun mode-name (&optional mode)
"
RETURN: A string containing the name of the mode, without the -mode suffix.
"
(let ((mode (string* (or mode major-mode))))
(if (and (< 5 (length mode))
(string= "-mode" (subseq mode (- (length mode) 5))))
(subseq mode 0 (- (length mode) 5))
mode)))
;; ------------------------------------------------------------------------
(defun ooestimate (project-name
......@@ -1834,6 +1844,124 @@ EXAMPLE: (COMBINE '(WWW FTP) '(EXA) '(COM ORG)))
;; ------------------------------------------------------------------------
;; Extract, format, and update copyright lines.
;; ------------------------------------------------------------------------
(defun pjb-copyright-regexp (hcd)
(let* ((comment-format (or (hcd-header-comment-format hcd) "%s"))
(pattern "Copyright ")
(base-re (format "^%s" (regexp-quote (format comment-format pattern))))
(pos (+ (search pattern base-re) (length pattern)))
(left-re (subseq base-re 0 pos))
(right-re (subseq base-re pos)))
(format "%s *\\(.*?\\) +\\([0-9]+\\)\\(\\( +-\\|,\\) +\\([0-9]+\\)\\)*\\( +-\\|,\\) +\\([0-9]+\\).*%s"
left-re right-re)))
(defun regexp-results (match string)
(let ((data (match-data t)))
(when data
(coerce
(loop
for (beg end) on data by (function cddr)
while (or (null beg) (integerp beg))
collect (list beg end (when (and beg end) (subseq string (1- beg) (1- end)))))
'vector))))
(defun pjb-process-copyrights (hcd fun)
"
Call the function `fun' with the beginning and end points of each
copyright line, and a list containing the copyright owner, the first
and last year of the copyright.
"
(let ((re (pjb-copyright-regexp hcd))
(text (buffer-substring-no-properties (point-min) (point-max))))
(save-excursion
(goto-char (point-min))
(with-marker (end (point-max))
(loop
with next = (make-marker)
while (re-search-forward re end t)
do (let ((res (regexp-results t text)))
(set-marker next (1+ (second (aref res 0))))
(funcall fun
(first (aref res 0))
(second (aref res 0))
(list (third (aref res 1))
(parse-integer (third (aref res 2)))
(parse-integer (third (aref res 7)))))
(goto-char (1- (marker-position next)))))))))
(defun pjb-extract-copyrights (hcd)
(let ((pjb-extract-copyrights/result '()))
(pjb-process-copyrights hcd
(lambda (start end copyright)
(declare (ignore start end))
(push copyright pjb-extract-copyrights/result)))
(nreverse pjb-extract-copyrights/result)))
;; (pjb-extract-copyrights (header-comment-description-for-mode major-mode))
(defun pjb-format-copyright (hcd author first-year last-year)
(let ((comment-format (hcd-header-comment-format hcd)))
(format comment-format
(format "Copyright %s %04d - %04d"
author first-year last-year))))
(defun pjb-update-copyright ()
"
Update the copyright lines with the current year.
NOTE: only for Copyright Pascal Bourguignon.
"
(interactive)
(let ((current-year (third (calendar-current-date)))
(hcd (header-comment-description-for-mode major-mode)))
(pjb-process-copyrights
hcd
(lambda (start end copyright)
(destructuring-bind (owner first-year last-year) copyright
(declare (ignore last-year))
(when (and (search "Pascal" owner)
(search "Bourguignon" owner))
(delete-region start end)
(insert (pjb-format-copyright hcd owner first-year current-year))))))))
(defvar *source-extensions*
'(".lisp" ".cl" ".asd" ".el"
"Makefile"
".c" ".cc" ".cpp" ".c++"
".h" ".hh" ".hpp" ".h++"
".m" ".mm"))
(defvar *ignorable-directories*
'("_darcs" ".darcsrepo" ".svn" ".hg" ".git" "CVS" "RCS" "MT" "SCCS"
".tmp_versions" "{arch}" ".arch-ids"
"BitKeeper" "ChangeSet" "autom4te.cache"))
(defun pjb-update-copyright-directory ()
(interactive)
(let ((good-files-re (format "\\(%s\\)$" (regexp-opt *source-extensions*)))
(bad-directories-re