abo-abo / ace-window

Quickly switch windows in Emacs
977 stars 87 forks source link

Error when running ace-window (melpa): wrong-type-argument number-or-marker-p #138

Closed mihaildu closed 6 years ago

mihaildu commented 6 years ago

Hello,

I installed ace-window from melpa and I get the following error when I run it (e.g. M-x ace-window)

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (+ -1))
  aw-window<(#<window 3 on *Backtrace*> #<window 14 on *scratch*>)
  sort((#<window 14 on *scratch*>) aw-window<)
  aw-window-list()
  aw-select(" Ace - Window" aw-switch-to-window)
  ace-select-window()
  ace-window(1)
  call-interactively(ace-window nil nil)
  command-execute(ace-window)

I would look into this myself but Lisp just looks weird to me :)

Now I uninstalled the one from melpa and reinstalled it from gnu repo, and it works just fine.

Anyway, more details about what I was using when I got the error

ace-window 20180607.1223 from melpa
GNU Emacs 24.5.1
Debian GNU/Linux 9.4 (stretch)
abo-abo commented 6 years ago

Is there a recipe to reproduce with make plain?

mihaildu commented 6 years ago

I'm not sure what make plain does, it seems to use .elpa/emacs-version/elpa for packages, and I don't know how this works. Already mentioned my emacs version if that helps.

abo-abo commented 6 years ago

What make plain does is it isolates the user's config while still installing dependencies. I assume make plain ran fine for you.

So I suggest you remove ace-window package, restart Emacs and install it again.

roger-ma commented 6 years ago

Hello, I got the similar error in Emacs 24, but not in Emacs 25. And I find that a strange thing happens in Emacs 24: if you put the Emacs frame enough far away from the left margin of the screen, ace-window works, otherwise the error occurs. I also saw the difference of last two commits, and now I may point out why it happens.

put the Emacs frame on the very left on the screen, and then evaluate the lisp code below:

(frame-parameter nil 'left)

now it outputs a result like (+ -8), not -8. The former causes compare in aw-windows< the wrong type argument.

abo-abo commented 6 years ago

Thanks, please test.

roger-ma commented 6 years ago

Now it works well, Thanks for fix.