* lisp/align.el (align-match-tex-pattern):
* lisp/calc/calc-funcs.el (math-bernoulli-number):
* lisp/cedet/semantic/bovine/el.el (semantic-ctxt-current-assignment):
* lisp/comint.el (comint-within-quotes):
* lisp/emacs-lisp/chart.el (chart-axis-draw):
* lisp/emacs-lisp/cl-extra.el (cl-round):
* lisp/emacs-lisp/eieio.el (defclass):
* lisp/emacs-lisp/elint.el (elint-check-setq-form):
* lisp/emulation/cua-rect.el (cua--rectangle-right-side):
* lisp/progmodes/gud.el (gud-gdb-completions-1):
* lisp/ps-print.el (ps-end-job):
* lisp/ses.el (ses-center):
* lisp/vc/ediff-ptch.el (ediff-get-patch-buffer): Prefer '(oddp A)' to
'(= 1 (% A 2))' and variations thereof.
(cherry picked from commit
e373a6e0d30c28045a0f33e662933c2c2660a220)
(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))
(nreverse coefs)))
(defun math-bernoulli-number (n)
- (if (= (% n 2) 1)
+ (if (oddp n)
(if (= n 1)
'(frac -1 2)
0)
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."
(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))
(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))))
(/= 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))
(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)
;; 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)
(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)
(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"
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
((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? ")