extemporelang / extempore-emacs-mode

The extempore mode for the Emacs text editor.
14 stars 5 forks source link

'Error running timer' when starting Extempore without prompting for dir #5

Closed adql closed 4 years ago

adql commented 4 years ago

After commit 9f370d I can only start Extempore with C-u C-c C-z (which works as did before without the prefix argument). Trying to run with C-c C-z results in an error:

Error running timer ‘auto-revert-buffers’: (wrong-type-argument stringp nil)

which is then raised repeatedly forcing restart.

I've just switched to Spacemacs recently so my install is pretty clean (but the same error occurs in my old configuration as well).

Full debug:

Debugger entered--Lisp error: (wrong-type-argument stringp nil) find-file-name-handler(nil file-remote-p) file-remote-p(nil) comint-mode() make-comint-in-buffer("extempore" nil "extempore" nil) apply(make-comint-in-buffer "extempore" nil "extempore" nil nil) make-comint("extempore" "extempore" nil) apply(make-comint "extempore" "extempore" nil nil) extempore-run("" nil) funcall-interactively(extempore-run "" nil) call-interactively(extempore-run) extempore-interactively-start-process() switch-to-extempore() funcall-interactively(switch-to-extempore) call-interactively(switch-to-extempore nil nil) command-execute(switch-to-extempore)

benswift commented 4 years ago

Hey there,

Have you set your extempore-path variable to point to the directory where you've installed Extempore? If not, that was a bug that I just fixed (in d098ff9c86985b68d189ff9d7617d9cbc0881359).

In addition, I do have a spacemacs layer (see it here) in my own personal config, although I haven't got it upstreamed (haven't had the time, and I've never had a spacemacs layer upstreamed before so I'm not 100% sure if I'm following all the filename conventions properly).

It should be available next time MELPA rebuilds.

adql commented 4 years ago

Yes, it's now solved.

I wasn't aware of extempore-path though, and I'm not sure I understand it's meaning. I thought that Extempore's source path is baked into the extempore executable. I have it installed in my ~/.local/bin/ and it's perfectly aware of the library .xtm files somewhere else in the directory tree (e.g. when evaluating (sys:load "libs/core/instruments.xtm")). I thought that when asked for path at C-c C-z what is meant is the desired working directory (so I just hit enter and everything works).

So should extempore-path just point at the executable?

adql commented 4 years ago

By the way, I actually already use your layer, but haven't really checked what it does yet. I'm fairly new to Spacemacs so things are still confusing there.

benswift commented 4 years ago

extempore-path is just a synonym for "sharedir"---it's the path to the top-level Extempore folder. I renamed it because the "sharedir" naming thing was just too unix-y (Windows folks don't know what /usr/local/share is) and so it's better to have a name which is clear on all platforms. I've updated the README to be clearer about this now, anyway.

To be honest, I'm thinking of moving away from the whole "bake the path into the binary" thing. It only works if (a) you build Extempore from source yourself, (b) you're not on Windows and (c) you don't move your Extempore folder. So it's just too brittle and not-cross-platform for general use. (a) is becoming more of a problem now that we're encouraging folks to download a pre-compiled binary (which is much easier for use e.g. in Schools).

I think shortly we'll just move to using environment variables for supporting running in a directory other than your Extempore directory.