]> git.eshelyaron.com Git - emacs.git/commit
Fix copyright-fix-years, use a dash to separate years in a range
authorLele Gaifax <lele@metapensiero.it>
Fri, 28 Jan 2022 07:41:51 +0000 (08:41 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 28 Jan 2022 14:23:05 +0000 (15:23 +0100)
commit70c3437ae1f20c050ecb96a642c9a568fd656105
tree7643bc6c4c10209eb0589e5421b733ad24b1be2b
parent7ba197a163ddf4002253d7b9a26fb28076e1cef7
Fix copyright-fix-years, use a dash to separate years in a range

Commit 7a46fa9c751f7c3147cd9b27fe84c1ce25419d3b, allowing en-dash as
years separator, changed the way the years range is composed taking the
separator from the `sep' variable instead of always using an hardwired
hyphen. Since the code explicitly avoid to touch (that is, extend)
existing ranges, that `sep' variable is almost always a space, or
whatever character precedes the last parsed year, thus generating a
range like "2020 2022" instead of "2020-2022".

* lisp/emacs-lisp/copyright.el (copyright-fix-years): Always use an dash
to separate years in a range.

* test/lisp/emacs-lisp/copyright-tests.el (with-copyright-fix-years-test):
(copyright-fix-years-tests--data):
(text-copyright-fix-years): New test cases (bug#53597).
lisp/emacs-lisp/copyright.el
test/lisp/emacs-lisp/copyright-tests.el