diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert-x.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/helper.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/pcase.el | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index dd3da9ae8c0..3541e3d0a57 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2109,7 +2109,7 @@ The text checked is between START and LIMIT." (goto-char start) (while (and (< (point) p) (re-search-forward "\\\\\"" limit t)) (setq c (1+ c))) - (and (< 0 c) (= (% c 2) 0)))))) + (and (< 0 c) (evenp c)))))) (defun checkdoc-in-abbreviation-p (begin) "Return non-nil if point is at an abbreviation. diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 8665934ebfd..0f029813f80 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -115,7 +115,7 @@ and reference them using the function `class-option'." (cl-check-type superclasses list) (cond ((and (stringp (car options-and-doc)) - (/= 1 (% (length options-and-doc) 2))) + (evenp (length options-and-doc))) (error "Too many arguments to `defclass'")) ((and (symbolp (car options-and-doc)) (oddp (length options-and-doc))) diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 147787d3d38..0dacec130a0 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -260,7 +260,7 @@ structure with the plists in ARGS." (string (let ((begin (point))) (insert x) (set-text-properties begin (point) current-plist))) - (list (unless (zerop (mod (length x) 2)) + (list (unless (evenp (length x)) (error "Odd number of args in plist: %S" x)) (setq current-plist x)))) (buffer-string))) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 5d1b9f2acbb..e8012326eb3 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -576,7 +576,7 @@ Return nil if they are." (defun ert--significant-plist-keys (plist) "Return the keys of PLIST that have non-null values, in order." - (cl-assert (zerop (mod (length plist) 2)) t) + (cl-assert (evenp (length plist)) t) (cl-loop for (key value . rest) on plist by #'cddr unless (or (null value) (memq key accu)) collect key into accu finally (cl-return accu))) @@ -587,8 +587,8 @@ Return nil if they are." Returns nil if they are equivalent, i.e., have the same value for each key, where absent values are treated as nil. The order of key/value pairs in each list does not matter." - (cl-assert (zerop (mod (length a) 2)) t) - (cl-assert (zerop (mod (length b) 2)) t) + (cl-assert (evenp (length a)) t) + (cl-assert (evenp (length b)) t) ;; Normalizing the plists would be another way to do this but it ;; requires a total ordering on all lisp objects (since any object ;; is valid as a text property key). Perhaps defining such an diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el index d8f758d2fe5..8a173219545 100644 --- a/lisp/emacs-lisp/helper.el +++ b/lisp/emacs-lisp/helper.el @@ -80,7 +80,7 @@ (recenter)) ((and (or (eq continue 'backspace) (eq continue ?\177)) - (zerop (% state 2))) + (evenp state)) (scroll-down)) (t (setq continue nil)))))))) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index a6a4751f49a..c68b8961ee3 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -370,7 +370,7 @@ undetected, binding variables to arbitrary values, such as nil. (cond (args (let ((arg-length (length args))) - (unless (= 0 (mod arg-length 2)) + (unless (evenp arg-length) (signal 'wrong-number-of-arguments (list 'pcase-setq (+ 2 arg-length))))) (let ((result)) |