* lisp/erc/erc.el (erc-format-message):
* lisp/obsolete/thumbs.el (thumbs-emboss-image):
* lisp/org/org-capture.el (org-capture-escaped-%):
* lisp/org/org-element-ast.el (org-element-create):
* lisp/org/org-macro.el (org-macro-extract-arguments):
* lisp/org/org-persist.el (org-persist--get-collection):
* lisp/org/ox-odt.el (org-odt-get-table-cell-styles):
* lisp/org/ox.el (org-export--dispatch-ui):
* lisp/progmodes/cperl-mode.el (cperl-forward-re)
(cperl-find-pods-heres): Prefer 'cl-evenp/'cl-oddp' to free-coding them
in some files that already depend on cl-lib in run-time.
(cherry picked from commit
9efd11e5fd4324fb1686b802c15ae36046b0939a)
(defun thumbs-emboss-image (emboss)
"Emboss the image with value EMBOSS."
(interactive "nEmboss value: ")
- (if (or (< emboss 3) (> emboss 31) (zerop (% emboss 2)))
+ (if (or (< emboss 3) (> emboss 31) (cl-evenp emboss))
(error "Arg must be an odd number between 3 and 31"))
(thumbs-modify-image "emboss" (number-to-string emboss)))
(goto-char (match-beginning 0))
(let ((n (abs (skip-chars-backward "\\\\"))))
(delete-char (/ (1+ n) 2))
- (= (% n 2) 1))))
+ (cl-oddp n))))
(defun org-capture-expand-embedded-elisp (&optional mark)
"Evaluate embedded elisp %(sexp) and replace with the result.
(cl-assert
;; FIXME: Just use `plistp' from Emacs 29 when available.
(let ((len (proper-list-p props)))
- (and len (zerop (% len 2)))))
+ (and len (cl-evenp len))))
;; Assign parray.
(when (and props (not (stringp type)) (not (eq type 'plain-text)))
(let ((node (list 'dummy props)))
(lambda (str)
(let ((len (length (match-string 1 str))))
(concat (make-string (/ len 2) ?\\)
- (if (zerop (mod len 2)) "\000" ","))))
+ (if (cl-evenp len) "\000" ","))))
s nil t)
"\000"))
(unless (and (listp container) (listp (car container)))
(setq container (list container)))
(setq associated (org-persist--normalize-associated associated))
- (when (and misc (or (not (listp misc)) (= 1 (% (length misc) 2))))
+ (when (and misc (or (not (listp misc)) (cl-oddp (length misc))))
(error "org-persist: Not a plist: %S" misc))
(or (org-persist--find-index
`( :container ,(org-persist--normalize-container container)
(= (1+ r) (car table-dimensions)))
"LastRow")
((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
- (= (% r 2) 1)) "EvenRow")
+ (cl-oddp r)) "EvenRow")
((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
- (= (% r 2) 0)) "OddRow")
+ (cl-evenp r)) "OddRow")
((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
- (= (% c 2) 1)) "EvenColumn")
+ (cl-oddp c)) "EvenColumn")
((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
- (= (% c 2) 0)) "OddColumn")
+ (cl-evenp c)) "OddColumn")
(t ""))))
(concat template-name cell-type)))))
(lambda (sub-entry)
(cl-incf index)
(format
- (if (zerop (mod index 2)) " [%s] %-26s"
+ (if (cl-evenp index) " [%s] %-26s"
"[%s] %s\n")
(funcall fontify-key
(char-to-string (car sub-entry))
top-key)
(nth 1 sub-entry)))
sub-menu "")
- (when (zerop (mod index 2)) "\n"))))))))
+ (when (cl-evenp index) "\n"))))))))
entries ""))
;; Publishing menu is hard-coded.
(format "\n[%s] Publish
(char-after (- (point) 2)))
(save-excursion
(forward-char -2)
- (= 0 (% (skip-chars-backward "\\\\") 2)))
+ (cl-evenp (skip-chars-backward "\\\\")))
(forward-char -1)))
;; Now we are after the first part.
(and is-2arg ; Have trailing part
(or ; Should work with delim = \
(not (eq (preceding-char) ?\\ ))
;; XXXX Double \\ is needed with 19.33
- (= (% (skip-chars-backward "\\\\") 2) 0))
+ (cl-evenp (skip-chars-backward "\\\\")))
(looking-at
(cond
((eq (char-after b) ?\] )