copyright.el 732 B

1234567891011121314151617181920212223
  1. (defun wi-fullname-and-email ()
  2. (format "%s <%s>" user-full-name user-mail-address))
  3. (define-skeleton copyright
  4. "Insert a copyright by $USER notice at cursor."
  5. "FULL_NAME <EMAIL>: "
  6. comment-start
  7. "; Copyright © " `(format-time-string "%Y") " "
  8. (or (wi-fullname-and-email) str)
  9. '(if (copyright-offset-too-large-p)
  10. (message "Copyright extends beyond `copyright-limit' and won't\
  11. be updated automatically."))
  12. comment-end \n)
  13. (setq copyright-names-regexp (wi-fullname-and-email))
  14. ;; (setq copyright-limit nil) ;scan whole buffer instead of the default 2000 characters
  15. (add-hook 'before-save-hook 'copyright-update)
  16. (setq quickurl-format-function
  17. (lambda (url) (format "<%s>" (quickurl-url-url url))))