Closed compleathorseplayer closed 4 years ago
I don't think that C-c
works in term-mode.
Not sure this is a good approach, but what I did is to bind a key of my choice to term-interrupt-subjob
to kill the running job.
(add-hook 'term-mode-hook (lambda ()
(define-key term-raw-map (kbd "<key>") 'term-interrupt-subjob)))
It's working great for me (note in case it matters: I am on Linux).
Thanks Prosoitos - I think there is a misunderstanding here... I don't need an interrupt, I just would like to use the given commands like ('ctrl-c ctrl-c' to send the current line to the REPL as listed here) but can't get that to work.
If you add the hook from the docs it should load julia-repl-mode in any julia mode, and work.
Thanks so much. I got it to work by explicitly choosing julia-repl-mode for each buffer. For some reason the same configuration file that worked for Linux did not work on the Mac. Could anyone please clarify the line I should add to the .emacs file and (crucially, not always clear in the docs) where it should go? Thanks again!
[my main problem is solved, just the configuration in the .emacs file doesn't seem to enable julia-repl-mode automatically]
You can link a mode with a file extension :
(add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-repl-mode))
This should open julia-repl-mode in any julia file. Alternatively, this in your .emacs
(require 'julia-repl)
(add-hook 'julia-mode-hook 'julia-repl-mode) ;; always use minor mode
should open the repl anytime julia-mode
starts.
Hi Thanks. I already had the second 'hook' section in my .emacs file. I tried adding the first suggestion (then restarting) and it didn't work either - I still have to start julia-repl-mode manually. It could have to do with the way emacs automatically changes the ' and " marks which change their meaning in the .emacs file.
At least I got it working now (just a little less conveniently).
That's strange, I'm not using the first line of code I wrote above and yet it still works for me.
When you open a julia file and type
M-:
then major-mode
what does it say?
julia-mode
Alright, what about when you try C-h m
? What modes are detected? Do this before you use the repl and do not try in a buffer where the repl is already active.
Hi Nathan, I got it fixed - when I had copied lines from a forum to add to the .emacs file, the quotes had changed font (and meaning). I fixed this and now it works.
Thanks to you, I knew where to look.
Thanks!
Glad it's sorted, have fun!
Sorry I missed the point @compleathorseplayer :slightly_smiling_face:
Hi P, You had (helpfully, I might add) answered a question I wasn't asking - which I think was how to send a control-c to interrupt something running in the REPL. I just wanted to be able to send commands by typing control-c twice, etc. What I didn't understand (but was later helped with) was that julia-repl-mode had not started properly in my editing window (the REPL was there, but I couldn't send commands). You ended up giving me a useful bit of info which I have since used, though!
Thanks!
When reporting an issue, please provide
M-x emacs-version [RET]
, will also appear in the buffer*Messages*
), 26.3VERSION
) 1.4.1julia-repl
(something like “latest master” is fine). latest masterAll looks fine until I try to do something like ctrl-enter to execute code or any 'ctrl c' Is this a Mac thing, or just me getting lucky? Is there a fix? [like a line for .emacs (if so where in the .emacs file to put it?)]
Thanks for any hints.