diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ebuild-mode.el | 23 |
2 files changed, 17 insertions, 11 deletions
@@ -1,3 +1,8 @@ +2024-07-03 Ulrich Müller <ulm@gentoo.org> + + * ebuild-mode.el (ebuild-mode-update-copyright): Replace nested + ifs with cond. + 2024-06-29 Ulrich Müller <ulm@gentoo.org> * Version 1.72 released. diff --git a/ebuild-mode.el b/ebuild-mode.el index 3e057e0..aa63cbc 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -382,18 +382,19 @@ Compatibility function for XEmacs." (y (string-to-number year))) (if y2 ;; Update range of years - (if (or (> 1999 y1) (>= y1 y2) (> y2 y)) - ;; XEmacs wants 'warning instead of :warning, - ;; but nil always works (and defaults to :warning) - (lwarn 'ebuild nil - "Suspicious range of copyright years: %d-%d" y1 y2) - (if (/= y2 y) - (replace-match year t t nil 2))) + (cond ((or (> 1999 y1) (>= y1 y2) (> y2 y)) + ;; XEmacs wants 'warning instead of :warning, + ;; but nil always works (and defaults to :warning) + (lwarn 'ebuild nil + "Suspicious range of copyright years: %d-%d" + y1 y2)) + ((/= y2 y) + (replace-match year t t nil 2))) ;; Update single year and convert to range if necessary - (if (or (> 1999 y1) (> y1 y)) - (lwarn 'ebuild nil "Suspicious copyright year: %d" y1) - (if (/= y1 y) - (replace-match (concat "\\1-" year) t nil nil 1)))))) + (cond ((or (> 1999 y1) (> y1 y)) + (lwarn 'ebuild nil "Suspicious copyright year: %d" y1)) + ((/= y1 y) + (replace-match (concat "\\1-" year) t nil nil 1)))))) (if update-author ;; Update default author in copyright notice (if (string-equal (match-string 3) "Gentoo Foundation") |