Closed agraef closed 4 years ago
Forgot to mention, the Csound version is Csound version 6.09.1 (double samples), if that makes any difference.
Also forgot to mention, I installed csound-mode from melpa, seems to be the latest version.
FWIW, here's the compile log I get from installing the package: Compile-Log.txt
The only real error message I see in the log is this:
Compiling file /home/ag/.emacs.d/elpa/csound-mode-20170923.807/csound-repl.el at Wed Oct 25 12:22:55 2017
csound-repl.el:35:1:Error: Cannot open load file: No such file or directory, gnuplot
Does that give any clue? Do I need to have gnuplot-mode installed??
Hi @agraef, I'm actually in the process actually of removeing the need for emacscsnd.so and use the UDP connection to csound instance instead, I always imagined this would become a problem.
So when you compile csoundAPI_emacsLisp, you'll find the emacscsnd.so located in the directory. But it's not on a search path, you'd need to copy it to /usr/lib64
I'm guessing, or anywhere on $PATH.
A very hacky version to get you started while I fix these, is to add these to your init.el file
(module-load "/path/to/emacscsnd.so")
(setq csound-shared-library-loaded-p t)
As for gnuplot (a seperate bug in your case), this is totally my fault of not checking if the binary exists before requireing it. So to fix that you just need to install it from pacman I guess in your case. This is only used to plot of the fn-tables into the repl buffer.
I plan to push a fix for the gnuplot problem later today. As for switching to UDP based repl may take a week or two.
Ok on closer look, gnuplot package is required but non of it's functions are called. I actually do a check if gnuplot existsts or not, so I only need to delete one line to fix this.
(not (eq 0 (shut-up
(shell-command "gnuplot --version"))))
(error "gnuplot was not found")
I fixed it now, if you're dowloading it from MELPA, it may take some hours before my push is available https://github.com/hlolli/csound-mode/commit/5680a266a32c62e8d7ebd987bf6e5fd40033bbeb
@hlolli Thanks for the quick reply and fix! I will give it another whirl later.
Well, it's getting close, but not quite there yet. :) Even with the suggested workaround I was still getting exactly the same errors, so I took a (very) brief look at the elisp code. The central issue is obviously with csound-mode--load-module
. I think you'll need something like this in the second module-load
call:
(ignore-errors (module-load (concat csound-mode--dir-path "/emacscsnd.so")))
With that little change I can now launch the REPL all right and I'm a happy camper. :)
Note the leading slash in /emacscsnd.so
-- concat
is just your ordinary string concatenation routine, it doesn't automagically add any path separators for your convenience. And csound-mode--dir-path
doesn't have a trailing slash to it, as revealed by describe-variable
:
csound-mode--dir-path is a variable defined in ‘csound-mode.el’.
Its value is "/home/ag/.emacs.d/elpa/csound-mode-20171025.401"
Documentation:
Not documented as a variable.
So you may want to modify your code to add the trailing slash to that variable instead; from my own elisp coding experience I'd say that this is the most idiomatic way of doing these things. Just make sure that all paths end in a slash and then you can just append the file names to them.
There also seems to be something wrong with the code in csound-api-compile
, because it still gives that annoying error in process sentinel
message even though make
runs just fine, so the code which invokes make
might need some tweaking. Maybe the return code of the make
command gets misinterpreted? Just a wild guess. Unfortunately I don't have the time to look into that right now, so I'm just running make
there manually for now. ;-)
Oh, and btw, I still have to give your mode a thorough test drive, but so far it's exactly the kind of no-frills csound mode I was looking for, so thanks a bunch for that! :)
Try what I might, I can't get the repl to work. System is Manjaro (Arch) Linux with GNU Emacs 25.3.1 with modules enabled. The mode itself works, and compiling the module works, too:
Here's what the compilation buffer shows, everything looking good:
But then I get this message:
That's it. If I repeat the
csound-repl-start
command, it just keeps asking me to compile the module again, even though it's been compiled already, and then gives the same error message again.This doesn't make any sense to me. I can see that the
~/.emacs.d/elpa/csound-mode-20170923.807/
directory is on the load path and the module is looking good, too; here's whatldd emacscsnd.so
gives:Any clues? I haven't looked at the elisp code yet, but for some reason emacs doesn't seem to be able to load the module, otherwise it wouldn't be asking to compile it over and over again, right?