diff options
| -rw-r--r-- | jinx.el | 22 |
1 files changed, 7 insertions, 15 deletions
@@ -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))))) |
