meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.07k stars 128 forks source link

Unknown keyword :interactive #527

Closed Dorovich closed 5 months ago

Dorovich commented 5 months ago

I am not able use meow due to an error when loading its configuration: Error (use-package): meow/:catch: Unknown keyword :interactive.

ventana_1701635867

This occurs when i load this in my config:

(defun meow-setup ()
  (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
  (meow-motion-overwrite-define-key
   '("j" . meow-next)
   '("k" . meow-prev)
   '("<escape>" . ignore))
  (meow-leader-define-key
   ;; SPC j/k will run the original command in MOTION state.
   '("j" . "H-j")
   '("k" . "H-k")
   ;; Use SPC (0-9) for digit arguments.
   '("1" . meow-digit-argument)
   '("2" . meow-digit-argument)
   '("3" . meow-digit-argument)
   '("4" . meow-digit-argument)
   '("5" . meow-digit-argument)
   '("6" . meow-digit-argument)
   '("7" . meow-digit-argument)
   '("8" . meow-digit-argument)
   '("9" . meow-digit-argument)
   '("0" . meow-digit-argument)
   '("/" . meow-keypad-describe-key)
   '("?" . meow-cheatsheet))
  (meow-normal-define-key
   '("0" . meow-expand-0)
   '("9" . meow-expand-9)
   '("8" . meow-expand-8)
   '("7" . meow-expand-7)
   '("6" . meow-expand-6)
   '("5" . meow-expand-5)
   '("4" . meow-expand-4)
   '("3" . meow-expand-3)
   '("2" . meow-expand-2)
   '("1" . meow-expand-1)
   '("-" . negative-argument)
   '(";" . meow-reverse)
   '("," . meow-inner-of-thing)
   '("." . meow-bounds-of-thing)
   '("[" . meow-beginning-of-thing)
   '("]" . meow-end-of-thing)
   '("a" . meow-append)
   '("A" . meow-open-below)
   '("b" . meow-back-word)
   '("B" . meow-back-symbol)
   '("c" . meow-change)
   '("d" . meow-delete)
   '("D" . meow-backward-delete)
   '("e" . meow-next-word)
   '("E" . meow-next-symbol)
   '("f" . meow-find)
   '("g" . meow-cancel-selection)
   '("G" . meow-grab)
   '("h" . meow-left)
   '("H" . meow-left-expand)
   '("i" . meow-insert)
   '("I" . meow-open-above)
   '("j" . meow-next)
   '("J" . meow-next-expand)
   '("k" . meow-prev)
   '("K" . meow-prev-expand)
   '("l" . meow-right)
   '("L" . meow-right-expand)
   '("m" . meow-join)
   '("n" . meow-search)
   '("o" . meow-block)
   '("O" . meow-to-block)
   '("p" . meow-yank)
   '("q" . meow-quit)
   '("Q" . meow-goto-line)
   '("r" . meow-replace)
   '("R" . meow-swap-grab)
   '("s" . meow-kill)
   '("t" . meow-till)
   '("u" . meow-undo)
   '("U" . meow-undo-in-selection)
   '("v" . meow-visit)
   '("w" . meow-mark-word)
   '("W" . meow-mark-symbol)
   '("x" . meow-line)
   '("X" . meow-goto-line)
   '("y" . meow-save)
   '("Y" . meow-sync-grab)
   '("z" . meow-pop-selection)
   '("'" . repeat)
   '("<escape>" . ignore)))

(use-package meow
  :ensure t
  :config
  (meow-setup)
  (meow-global-mode 1))

As you can see, i use use-package to install and configure the package, and i load a file with only this code at the end of my init.el.

After searching through the package's files, i see that the :interactive keyword is used in the define-minor-mode function (meow-core.el, line 101 and meow-esc.el, line 32), which does not exist on emacs 27.1.

DogLooksGood commented 5 months ago

Sorry, I don't have an environment to test emacs 27.1 for now. How about upgrade to 27.2 or higher?

Dorovich commented 5 months ago

Sorry, I don't have an environment to test emacs 27.1 for now. How about upgrade to 27.2 or higher?

There isn't a newer emacs package for the distribution i'm using. I just tried compiling the latest emacs (29.1) and it works now. However, the get started section should be updated to show that the required emacs version is not ">= 27.1".

eshrh commented 5 months ago

i knew about this; it's why the ci on the latest commit is failing. Isn't the non-interactivity kind of just for aesthetics? In my mind being compatible with emacs 27 (this is the only syntax error i think) is more valuable than preventing the user from accidentally calling (meow-mode).

Edit, I just blamed and the CI failing was just my fault. I was the one who turned meow-esc into a minor mode in the first place, and i happened to add :interactive then. CI is passing again. However, the :interactive on meow-mode has been there for years. Why doesn't this cause an error on 27.1?

eshrh commented 5 months ago

Whatever the reason be, i just tested it on 27.1 and it works.

Dorovich commented 5 months ago

Whatever the reason be, i just tested it on 27.1 and it works.

It worked for me when commenting out the lines with the :interactive keyword in the package source, but otherwise it would't load the package correctly (i don't know much about the way Emacs handles packages) and wouldn't work.

eshrh commented 5 months ago

Right, but actually the only one that needs to be commented out is in meow-esc.el, or at least on my machine.