* lisp/arc-mode.el (archive-zip-summarize):
* lisp/cus-edit.el (setopt):
* lisp/isearch.el (isearch-backslash):
* lisp/simple.el (blink-paren-post-self-insert-function):
* lisp/subr.el (setq-local, buffer-local-set-state):
* lisp/term.el (term-within-quotes):
* test/src/data-tests.el (test-bool-vector-bv-from-hex-string): Use
oddp/evenp instead of open-coding them.
Reported by Pip Cet <pipcet@protonmail.com>.
(cherry picked from commit
515542b653c438014eda844eacc96cf23cfaaa2d)
((memq creator '(0 5 6 7 10 11 15)) ; Dos etc.
(logior ?\444
(if isdir (logior 16384 ?\111) 0)
- (if (zerop
- (logand 1 (get-byte (+ p 38))))
+ (if (evenp (get-byte (+ p 38)))
?\222 0)))
(t nil)))
(fiddle (and archive-zip-case-fiddle
\(fn [VARIABLE VALUE]...)"
(declare (debug setq))
- (unless (zerop (mod (length pairs) 2))
+ (unless (evenp (length pairs))
(error "PAIRS must have an even number of variable/value members"))
(let ((expr nil))
(while pairs
(defun isearch-backslash (str)
"Return t if STR ends in an odd number of backslashes."
- (= (mod (- (length str) (string-match "\\\\*\\'" str)) 2) 1))
+ (oddp (- (length str) (string-match "\\\\*\\'" str))))
(defun isearch-fallback (want-backslash &optional allow-invalid to-barrier)
"Return point to previous successful match to allow regexp liberalization.
;; Verify an even number of quoting characters precede the close.
;; FIXME: Also check if this parenthesis closes a comment as
;; can happen in Pascal and SML.
- (= 1 (logand 1 (- (point)
- (save-excursion
- (forward-char -1)
- (skip-syntax-backward "/\\")
- (point))))))
+ (oddp (- (point)
+ (save-excursion
+ (forward-char -1)
+ (skip-syntax-backward "/\\")
+ (point)))))
(funcall blink-paren-function)))
(put 'blink-paren-post-self-insert-function 'priority 100)
\(fn [VARIABLE VALUE]...)"
(declare (debug setq))
- (unless (zerop (mod (length pairs) 2))
+ (unless (evenp (length pairs))
(error "PAIRS must have an even number of variable/value members"))
(let ((expr nil))
(while pairs
\(fn [VARIABLE VALUE]...)"
(declare (debug setq))
- (unless (zerop (mod (length pairs) 2))
+ (unless (evenp (length pairs))
(error "PAIRS must have an even number of variable/value members"))
`(prog1
(buffer-local-set-state--get ',pairs)
Quotes are single and double."
(let ((countsq (term-how-many-region "\\(^\\|[^\\]\\)'" beg end))
(countdq (term-how-many-region "\\(^\\|[^\\]\\)\"" beg end)))
- (or (= (mod countsq 2) 1) (= (mod countdq 2) 1))))
+ (or (oddp countsq) (oddp countdq))))
(defun term-how-many-region (regexp beg end)
"Return number of matches for REGEXP from BEG to END."
(let ((i 0))
(dolist (n (nreverse nibbles))
(dotimes (_ 4)
- (aset bv i (> (logand 1 n) 0))
+ (aset bv i (oddp n))
(cl-incf i)
(setf n (ash n -1)))))
bv))