idris-hackers / idris-mode

Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.
GNU General Public License v3.0
269 stars 71 forks source link

Use the same buffer information throughout file loading #483

Closed jsoo1 closed 5 years ago

jsoo1 commented 6 years ago

If popwin opens some buffer aside from the idris source buffer when the file has not finished loading, then the result of (buffer-file-name) will be wrong or nil when the callback for idris-load-file is reached.

Closes #423

jsoo1 commented 6 years ago

The tests breaking seem to be because *idris-events* is no longer created. Any idea why that might happen because of these changes?

jsoo1 commented 6 years ago

Ah, I think it was due to #445.

jsoo1 commented 6 years ago

Moved the travis fixes and test fixes to their own separate PRs.

david-christiansen commented 6 years ago

I have pretty low brain bandwidth right now. Can you say a few words on what the underlying issue is and how this fixes it?

jsoo1 commented 6 years ago

Totally understood. The issue is with interactions with other modes that change the current buffer when using load-file. Spacemacs uses popwin, for instance, that changes the current buffer to the holes buffer when load file is first called. So during the async parts of load file, (buffer-file-name) returns nil when checking (idris-filename-to-load). I think I explained it better in #423 in this comment. Does that make sense?

jsoo1 commented 5 years ago

Gonna cherry pick this onto a fresh branch.