rougier / nano-modeline

GNU Emacs / N Λ N O Modeline
GNU General Public License v3.0
170 stars 29 forks source link

Wrong Number of Arguments #30

Closed chookity-pokk closed 2 years ago

chookity-pokk commented 2 years ago

I just installed via Elpa and ran nano-modeline-mode and I get wrong number of arguments: (3 . 4), 2

rougier commented 2 years ago

Woudl you have a more detail output? It's hard to debug with only the information you posted. Also, do you have any personal modeline configuration that might interfere with the new modeline?

chookity-pokk commented 2 years ago

How would I get a more detailed output? This was installed on a nearly fresh install of Emacs. All I had installed before was ivy and the nano theme.

rougier commented 2 years ago

Sorry for delay. You can try toggle-debug-on-error before starting the mode.

chookity-pokk commented 2 years ago

Got this as the output. The last bit talks about smex which I don't think is involved but I left it in because I don't know enough to know what I can and can't cut out.

Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
  make-obsolete-variable(nil "Add to `nano-modeline-mode-formats' instead")
  byte-code("\302\303\304\305\306\307%\210\302\310\304\311\306\303%\210\302\312\304\313\306\310%\210\302\314\304\315\306\310%\210\316\317\320\321\322DD\323\324\325\306\310&\7\210\316\326\320..." [nano-modeline-user-mode nano-modeline-user-mode-p custom-declare-group nano nil "N Λ N O" :group convenience nano-modeline "N Λ N O Modeline" nano-modeline-active "Active modeline faces.\n\nModeline is composed as:\n[..." nano-modeline-inactive "Inactive modeline faces\n\nModeline is composed as:\n..." custom-declare-variable nano-modeline-position funcall function #f(compiled-function () #<bytecode 0x1dc00010d6154>) "Default position (top or bottom)" :type (choice (const :tag "Top" top) (const :tag "Bottom" bottom)) nano-modeline-space-top #f(compiled-function () #<bytecode 0x1d81dc00016ff49f>) "Space adjustment for top of modeline\nPossitive is ..." float nano-modeline-space-bottom #f(compiled-function () #<bytecode -0xcfe23fffe9016d3>) "Space adjustment for bottom of modeline\nNegative i..." custom-declare-face ((t (:inherit mode-line))) "Modeline face for active modeline" nano-modeline-active-name ((t (:inherit (mode-line bold)))) "Modeline face for active name element" nano-modeline-active-primary ((t (:inherit mode-line))) "Modeline face for active primary element" nano-modeline-active-secondary ((t (:inherit mode-line))) "Modeline face for active secondary element" nano-modeline-active-status-RO ((t (:inherit mode-line))) "Modeline face for active READ-ONLY element" nano-modeline-active-status-RW ((t (:inherit mode-line))) "Modeline face for active READ-WRITE element" nano-modeline-active-status-** ((t (:inherit mode-line))) "Modeline face for active MODIFIED element" ...] 10)
  autoload-do-load((autoload "nano-modeline" "Toggle nano-modeline minor mode\n\nThis is a minor m..." t nil) nano-modeline-mode)
  command-execute(nano-modeline-mode record)
  execute-extended-command(nil "nano-modeline-mode")
  smex-read-and-run(("toggle-debug-on-error" "nano-modeline-mode" "cd" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "calc" "diff" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "mu4e" "ping" "pong" "smex" "talk" "term" "undo" "yank" "zone" "align" "chmod" "debug" "diary" "dired" "ediff" "edirs" "eldoc" "hanoi" ...))
  smex()
  funcall-interactively(smex)
  call-interactively(smex nil nil)
  command-execute(smex)
rougier commented 2 years ago

Oh, do you have some byte compiled files around (.elc)?

chookity-pokk commented 2 years ago

I have one for nano-modeline.elc in the ~/.emacs.d/elpa/nano-modeline-0.5/ directory.

rougier commented 2 years ago

Can you try to delete it and check if it solves the problem.

chookity-pokk commented 2 years ago

It certainly changed the error. I should note, that I am running this on the gtk version of emacs 29.05, if that changes anything?

Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
  make-obsolete-variable(nil "Add to `nano-modeline-mode-formats' instead")
  eval-buffer(#<buffer  *load*> nil "/home/alarm/.emacs.d/elpa/nano-modeline-0.5/nano-m..." nil t)  ; Reading at buffer position 11967
  load-with-code-conversion("/home/alarm/.emacs.d/elpa/nano-modeline-0.5/nano-m..." "/home/alarm/.emacs.d/elpa/nano-modeline-0.5/nano-m..." nil t)
  autoload-do-load((autoload "nano-modeline" "Toggle nano-modeline minor mode\n\nThis is a minor m..." t nil) nano-modeline-mode)
  command-execute(nano-modeline-mode record)
  execute-extended-command(nil "nano-modeline-mode")
  smex-read-and-run(("toggle-debug-on-error" "nano-modeline-mode" "package-delete" "cd" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "calc" "diff" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "mu4e" "ping" "pong" "smex" "talk" "term" "undo" "yank" "zone" "align" "chmod" "debug" "diary" "dired" "ediff" "edirs" ...))
  smex()
  funcall-interactively(smex)
  call-interactively(smex nil nil)
  command-execute(smex)
rougier commented 2 years ago

What is your version of emacs ? I guess the make-obsolete-variable function might be the culprit.

chookity-pokk commented 2 years ago

My Emacs version is 29.05, I compiled it from source.

rougier commented 2 years ago

Can you check the documentation of make-obsolete-variable (using C-h f)

chookity-pokk commented 2 years ago
make-obsolete-variable is a compiled Lisp function in ‘byte-run.el’.

(make-obsolete-variable OBSOLETE-NAME CURRENT-NAME WHEN &optional
ACCESS-TYPE)

Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
The warning will say that CURRENT-NAME should be used instead.
If CURRENT-NAME is a string, that is the ‘use instead’ message.
WHEN should be a string indicating when the variable
was first made obsolete, for example a date or a release number.
ACCESS-TYPE if non-nil should specify the kind of access that will trigger
  obsolescence warnings; it can be either ‘get’ or ‘set’.

  Probably introduced at or before Emacs version 22.1.
aaronjensen commented 2 years ago

I believe the 2 argument version is deprecated in 27 and removed in 28 (or deprecated in 28 and removed in 29, I don't remember). In any case, adding a "when" will fix this and there have been a necessary rash of these changes in emacs libraries in the last several months.

rougier commented 2 years ago

@aaronjensen Thanks for the explanation. nano-modeline is using the 3 argument version and I don't wuite understand the warning. @ragreenburg Do use use latest nano-modeline version?

aaronjensen commented 2 years ago

Op said they installed via elpa. Does the elpa version use the 3 arg version?

rougier commented 2 years ago

Good catch! It's missing the third argument... I'll push a new release on ELPA then.

rougier commented 2 years ago

Done!

chookity-pokk commented 2 years ago

Thanks! It doesn't seem to be live on Elpa yet so I will check back after the work day and see if it works! Edit: The updated version still isn't live on Elpa, so I haven't forgotten about this, just waiting!

chookity-pokk commented 2 years ago

Sorry, don't want to be a pest here but it seems like when you pushed an update to Elpa it didn't go through? At least it's been almost 3 weeks since then and it still isn't live on Elpa. Did it fail or does it usually take this long?

rougier commented 2 years ago

Oh sorry, it did not went through ELPA for some reason. Give me a few hours and spam me again here if it's not done (no problem at all).

rougier commented 2 years ago

Found the reason, forgot to push...

chookity-pokk commented 2 years ago

Fixed! Thank you!