diff --git a/lisp/align.el b/lisp/align.el index 6467c2b6f57..4263dfe0fa0 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1076,7 +1076,7 @@ current position." (while (and (> pos (point-min)) (eq (char-before pos) ?\\)) (setq count (1+ count) pos (1- pos))) - (eq (mod count 2) 1)) + (oddp count)) (goto-char (match-beginning (if reverse 1 2))))) result)) diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el index 28e9c1f30bb..8535e580da7 100644 --- a/lisp/calc/calc-funcs.el +++ b/lisp/calc/calc-funcs.el @@ -867,7 +867,7 @@ (nreverse coefs))) (defun math-bernoulli-number (n) - (if (= (% n 2) 1) + (if (oddp n) (if (= n 1) '(frac -1 2) 0) diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index 436db3c8381..2f1e818e079 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -765,7 +765,7 @@ In Emacs Lisp this is easily defined by parenthesis bounding." (forward-comment 1) (setq start (point)) (forward-sexp 1) - (if (= (% count 2) 1) + (if (oddp count) (setq lastodd (buffer-substring-no-properties start (point)))) ) diff --git a/lisp/comint.el b/lisp/comint.el index 5d6d02207ad..cece5545bfb 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1756,7 +1756,7 @@ Go to the history element by the absolute history position HIST-POS." Quotes are single and double." (let ((countsq (comint-how-many-region "\\(^\\|[^\\]\\)'" beg end)) (countdq (comint-how-many-region "\\(^\\|[^\\]\\)\"" beg end))) - (or (= (mod countsq 2) 1) (= (mod countdq 2) 1)))) + (or (oddp countsq) (oddp countdq)))) (defun comint-how-many-region (regexp beg end) "Return number of matches for REGEXP from BEG to END." diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 6f2f85fc765..2a01501f99e 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -347,7 +347,7 @@ of the drawing." (odd nil) p1) (while s - (setq odd (= (% (length s) 2) 1)) + (setq odd (oddp (length s))) (setq r (chart-translate-namezone (oref a chart) i)) (if (eq dir 'vertical) (setq p (/ (+ (car r) (cdr r)) 2)) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 09470457d93..ab06682cf93 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -392,7 +392,7 @@ With two arguments, return rounding and remainder of their quotient." (res (cl-floor (+ x hy) y))) (if (and (= (car (cdr res)) 0) (= (+ hy hy) y) - (/= (% (car res) 2) 0)) + (oddp (car res))) (list (1- (car res)) hy) (list (car res) (- (car (cdr res)) hy)))) (let ((q (round (/ x y)))) diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 1fa177b08da..8665934ebfd 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -118,7 +118,7 @@ and reference them using the function `class-option'." (/= 1 (% (length options-and-doc) 2))) (error "Too many arguments to `defclass'")) ((and (symbolp (car options-and-doc)) - (/= 0 (% (length options-and-doc) 2))) + (oddp (length options-and-doc))) (error "Too many arguments to `defclass'"))) (if (stringp (car options-and-doc)) diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 0f5d15be838..b63bcd44edf 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -798,7 +798,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code." (defun elint-check-setq-form (form env) "Lint the setq FORM in ENV." - (or (= (mod (length form) 2) 1) + (or (oddp (length form)) ;; (setq foo) is valid and equivalent to (setq foo nil). (elint-warning "Missing value in setq: %s" form)) (let ((newenv env) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 27eed91927f..e224d4ce248 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -187,7 +187,7 @@ Activates the region if needed. Only lasts until the region is deactivated." ;; t if point is on right side of rectangle. (if (and topbot (= (cua--rectangle-left) (cua--rectangle-right))) (< (cua--rectangle-corner) 2) - (= (mod (cua--rectangle-corner) 2) 1))) + (oddp (cua--rectangle-corner)))) (defun cua--rectangle-column () (if (cua--rectangle-right-side) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 7ced54170ff..3cca55be3a7 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -919,7 +919,7 @@ CONTEXT is the text before COMMAND on the line." (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos) (setq count (1+ count) pos (match-end 0))) - (and (= (mod count 2) 1) + (and (oddp count) (setq complete-list (list (concat str "'")))))) complete-list) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index c1258db2c54..d133e0bad67 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -6462,7 +6462,7 @@ If FACE is not a valid face name, use default face." (replace-match (format "/Lines %d def\n/PageCount %d def" total-lines total-pages) t))))) ;; Set dummy page - (and ps-spool-duplex (= (mod ps-page-order 2) 1) + (and ps-spool-duplex (oddp ps-page-order) (let ((ps-n-up-printing 0)) (ps-header-sheet) (ps-output "/PrintHeader false def\n/ColumnIndex 0 def\n" diff --git a/lisp/ses.el b/lisp/ses.el index 88e83ae160b..d23cefc53f4 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -4105,7 +4105,7 @@ printer otherwise." value ; Too large for field, anyway. (setq half (make-string (/ width 2) fill)) (concat half value half - (if (> (% width 2) 0) (char-to-string fill)))))) + (if (oddp width) (char-to-string fill)))))) (defun ses-center-span (value &optional fill printer) "Print VALUE, centered within the span that starts in the current column diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index e83e7e95c0f..42b0d6850ef 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -552,7 +552,7 @@ an optional argument, then use it." ((and (integerp arg) (eq 0 (mod arg 2))) (setq patch-buf (ediff-prompt-for-patch-buffer))) ;; odd prefix arg: get patch from a file - ((and (integerp arg) (eq 1 (mod arg 2))) + ((and (integerp arg) (oddp arg)) (setq patch-buf (ediff-prompt-for-patch-file))) (t (setq patch-buf (if (y-or-n-p "Is the patch already in a buffer? ")