Function: jinx--save-personal

jinx--save-personal is a natively compiled function defined in jinx.el.

Signature

(jinx--save-personal ACTION KEY WORD)

Documentation

Add or remove WORD from personal dictionary, or format word with KEY.

ACTION can be add, remove, has, format.

Source Code

;; Defined in /nix/store/b5jnxgwmlp7hh60wfrx7amhrmrpfcqqi-emacs-packages-deps/share/emacs/site-lisp/elpa/jinx-20260926.912/jinx.el
;;;; Save functions

(defun jinx--save-personal (action key word)
  "Add or remove WORD from personal dictionary, or format word with KEY.
ACTION can be add, remove, has, format."
  (let* ((idx (seq-position word key (lambda (x y) (not (equal x y)))))
         (dict (or (nth idx jinx--dicts) (user-error "Invalid dictionary")))
         (word (substring word idx)))
    (pcase-exhaustive action
      ('add (jinx--mod-add dict word))
      ('remove (jinx--mod-remove dict word))
      ('has (jinx--mod-has dict word))
      ('format
       (cl-loop
        for dict in jinx--dicts for idx from 1 collect
        (list (make-string idx key) word
              (format "Personal:%s" (car (jinx--mod-describe dict)))))))))