1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Avoid lexbind warnings in kkc.el

* lisp/international/kkc.el (kkc-lookup-key): Suppress warnings
about lexical-binding cookies.
(kkc-save-init-file): Write the lexical-binding cookie when saving
the KKC init file.  (Bug#79136)
This commit is contained in:
Eli Zaretskii 2025-08-02 17:59:36 +03:00
parent cd31c3cb42
commit 0d7b1c912c

View file

@ -64,7 +64,10 @@ This string is shown at mode line when users are in KKC mode.")
(not (eq kkc-init-file-flag t)))
(let ((coding-system-for-write 'iso-2022-7bit)
(print-length nil))
(write-region (format "(setq kkc-lookup-cache '%S)\n" kkc-lookup-cache)
(write-region
(format
";; -*- lexical-binding: t; -*-\n\n(setq kkc-lookup-cache '%S)\n"
kkc-lookup-cache)
nil
kkc-init-file-name))))
@ -178,7 +181,8 @@ area while indicating the current selection by `<N>'."
(add-hook 'kill-emacs-hook 'kkc-save-init-file)
(if (file-readable-p kkc-init-file-name)
(condition-case nil
(load-file kkc-init-file-name)
(let ((warning-inhibit-types '((files missing-lexbind-cookie))))
(load-file kkc-init-file-name))
(kkc-error "Invalid data in %s" kkc-init-file-name))))
(or (and (nested-alist-p kkc-lookup-cache)
(eq (car kkc-lookup-cache) kkc-lookup-cache-tag))