Emacs: Ask to update copyright years in prog-mode.
This commit is contained in:
parent
7a2035f283
commit
2e1c41f757
|
@ -1,6 +1,6 @@
|
||||||
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
|
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Time-stamp: <2020-01-27T09:13:20+0100>
|
;; Time-stamp: <2020-01-28T03:25:54+0100>
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
|
@ -27,6 +27,17 @@
|
||||||
;; Switch between header and implementation.
|
;; Switch between header and implementation.
|
||||||
("C-:" . ff-find-other-file)
|
("C-:" . ff-find-other-file)
|
||||||
)
|
)
|
||||||
|
(use-package copyright
|
||||||
|
:config
|
||||||
|
(defun my/maybe-copyright-update ()
|
||||||
|
"Update existing copyright notice to indicate the current
|
||||||
|
year if mode is derived from prog-mode."
|
||||||
|
(if (derived-mode-p 'prog-mode)
|
||||||
|
(copyright-update)))
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(before-save . my/maybe-copyright-update)
|
||||||
|
)
|
||||||
|
|
||||||
;; Guess indentation and if spaces or tabs are to be used.
|
;; Guess indentation and if spaces or tabs are to be used.
|
||||||
(use-package dtrt-indent
|
(use-package dtrt-indent
|
||||||
|
|
Loading…
Reference in New Issue
Block a user