I'm customizing spacemacs for my workflow. I'm new to elisp and can't figure out how to do this after looking at other functions in .el files and other posts.
Basically, I wrote an elisp function that executes a shell script on the currently open file(the shell script compiles a special kind of LaTeX file that includes something called Lilypond code which is used for music typesetting). The code for the function I wrote looks like this:
(defun lytex-to-pdf ()
(shell-command-to-string (format "bash ~/lytex-to-pdf.sh %s" buffer-file-name)))
(evil-leader/set-key "cb" 'lytex-to-pdf)
It works fine, but I'd like it to pop up a buffer with a terminal showing the std-out of the shell script. That way I can debug in case it fails to compile. How can I do this? Is shell-command-to-string the right emacs command I should be executing?
As an aside, how do I change my custom keybinding to only show up in the LaTeX major mode?