summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:51:14 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2026-05-02 11:51:14 +0200
commitee590b2278f26ac6cbbb80ab687628a704ddd2b2 (patch)
tree234dc62323e56244e54d1e3756a685ee01f42251
parent5aed0911971b866d75e326a9258a20a66df0cff2 (diff)
Require Compat 31externals/jinx
-rw-r--r--jinx.el22
1 files changed, 7 insertions, 15 deletions
diff --git a/jinx.el b/jinx.el
index b9c81a4..aa54f2d 100644
--- a/jinx.el
+++ b/jinx.el
@@ -6,7 +6,7 @@
;; Maintainer: Daniel Mendler <mail@daniel-mendler.de>
;; Created: 2023
;; Version: 2.7
-;; Package-Requires: ((emacs "29.1") (compat "30"))
+;; Package-Requires: ((emacs "29.1") (compat "31"))
;; URL: https://github.com/minad/jinx
;; Keywords: convenience, text
@@ -502,11 +502,11 @@ position."
(while (and (< word-start word-end)
(let ((c (char-after word-start)))
(or (= c ?') (= c ?’))))
- (cl-incf word-start))
+ (incf word-start))
(while (and (< word-start word-end)
(let ((c (char-before word-end)))
(or (= c ?') (= c ?’))))
- (cl-decf word-end))
+ (decf word-end))
(while (< word-start word-end)
(let ((subword-end word-end))
(when jinx--camel
@@ -792,14 +792,6 @@ optionally added."
word
(get-text-property 0 'jinx--group word)))
-;; TODO: Use `completion-table-with-metadata'
-(defun jinx--table-with-metadata (table metadata)
- "Return new completion TABLE with METADATA."
- (lambda (string pred action)
- (if (eq action 'metadata)
- `(metadata . ,metadata)
- (complete-with-action action table string pred))))
-
(cl-defun jinx--correct-overlay (overlay &key info initial)
"Correct word at OVERLAY.
Optionally show prompt INFO and insert INITIAL input."
@@ -815,7 +807,7 @@ Optionally show prompt INFO and insert INITIAL input."
#'jinx--correct-setup
(or (completing-read
(format "Correct ā€˜%s’%s: " word (or info ""))
- (jinx--table-with-metadata
+ (completion-table-with-metadata
(jinx--correct-suggestions word)
`((category . jinx)
(eager-display . t)
@@ -1022,7 +1014,7 @@ misspelled words, but do not open the correction UI."
(if-let* (((overlay-buffer ov))
(skip (jinx--correct-overlay ov :info (format " (%d of %d)" (1+ idx) count))))
(setq idx (mod (+ idx skip) count))
- (cl-incf idx)))))))
+ (incf idx)))))))
;;;###autoload
(defun jinx-correct-nearest ()
@@ -1038,7 +1030,7 @@ misspelled words, but do not open the correction UI."
(if (overlay-buffer ov)
(when-let* ((skip (jinx--correct-overlay ov)))
(setq idx (mod (+ idx skip) count)))
- (cl-incf idx)))))))) ;; Skip deleted overlay
+ (incf idx)))))))) ;; Skip deleted overlay
;;;###autoload
(defun jinx-correct-word (&optional start end initial)
@@ -1101,7 +1093,7 @@ This command dispatches to the following commands:
(throw 'jinx--goto n)
(let ((ov (jinx--force-overlays (point-min) (point-max))))
(unless (or (> n 0) (<= (overlay-start (car ov)) (point) (overlay-end (car ov))))
- (cl-incf n))
+ (incf n))
(goto-char (overlay-end (nth (mod n (length ov)) ov)))
(jinx--invisible-open-permanently)))))