Function: copyright-update-directory

copyright-update-directory is an autoloaded, interactive and byte-compiled function defined in copyright.el.gz.

Signature

(copyright-update-directory DIRECTORY MATCH &optional FIX)

Documentation

Update copyright notice for all files in DIRECTORY matching MATCH.

If FIX is non-nil, run copyright-fix-years instead.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/copyright.el.gz
;; TODO: recurse, exclude COPYING etc.
;;;###autoload
(defun copyright-update-directory (directory match &optional fix)
  "Update copyright notice for all files in DIRECTORY matching MATCH.
If FIX is non-nil, run `copyright-fix-years' instead."
  (interactive "DDirectory: \nMFilenames matching (regexp): ")
  (dolist (file (directory-files directory t match nil))
    (unless (file-directory-p file)
      (message "Updating file `%s'" file)
      ;; FIXME we should not use find-file+save+kill.
      (let ((enable-local-variables :safe)
	    (enable-local-eval nil))
	(find-file file))
      (let ((inhibit-read-only t))
	(if fix
	    (copyright-fix-years)
	  (copyright-update)))
      (save-buffer)
      (kill-buffer (current-buffer)))))