summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-07-03 18:41:10 +0200
committerUlrich Müller <ulm@gentoo.org>2024-07-03 18:41:10 +0200
commitd8429412cacfd0613347c7d8d3beb365a967846d (patch)
tree31abb7ff9b9bc5f59d9380ce82353275858b77b2
parentVersion 1.72 released (diff)
downloadebuild-mode-d8429412cacfd0613347c7d8d3beb365a967846d.tar.gz
ebuild-mode-d8429412cacfd0613347c7d8d3beb365a967846d.tar.bz2
ebuild-mode-d8429412cacfd0613347c7d8d3beb365a967846d.zip
Replace nested ifs with cond
* ebuild-mode.el (ebuild-mode-update-copyright): Replace nested ifs with cond. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--ebuild-mode.el23
2 files changed, 17 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 7718810..b7bdc28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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")