-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Julia layer separate from ESS #10444
Conversation
1f44c7b
to
31517ea
Compare
when the |
I just asked how to disable julia in ESS: emacs-ess/ESS#501 |
8943b74
to
dde0cfd
Compare
layers/+lang/ess/packages.el
Outdated
@@ -36,7 +36,6 @@ | |||
("\\.do\\'" . STA-mode) | |||
("\\.ado\\'" . STA-mode) | |||
("\\.[Ss][Aa][Ss]\\'" . SAS-mode) | |||
("\\.jl\\'" . ess-julia-mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now you are simply disabling julia for ess, so no one will be able to use ess with julia. Not sure what would be the best solution, but probably a flag like
(defvar ess-use-julia t)
and then disable stuff conditionally
then I can simply specify in my .spacemacs
(setq-default
dotspacemacs-configuration-layers
(ess :variables
ess-use-julia nil))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I get back to this, the plan is to move all of the julia-related ESS stuff into the julia layer. This change was why I marked this PR as WIP since using my branch could very easily break workflows until I finish that migration. So .jl
files will still open in ess-julia-mode
(for those who customize this layer to do so), but you'll have to install the julia layer for that rather than the ESS layer. Basically just what you said above, but the flag would be on the julia-layer side rather than the ESS side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, where you are going with this. Please don't break my ESS julia setup. ESS has quite decent Julia support out of the box for now (which does not mean it cannot be improved) and this should be unchanged if only the ess
layer is installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want it to be, your experience will be identical; you'll just have to add the julia layer in addition to the ESS layer. If ESS provides functionality that's only applicable to julia (it does), then it makes no sense to keep it in the generic ESS layer instead of moving it to a layer specifically for julia.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing with ESS
(as in the emacs package to use R/STATA/Julia/S/..., in contrast to ess
, the layer for spacemacs) is its age, on the one hand it has a lot of features and on the other it has a lot of ancient code no one has touched for ages. The current maintainers are all R users (this is my personal impression), so there is still quite a bit of ongoing development for R. Julia support was somewhat put on top of that, integration is far from perfect and would probably require a bit of work and dealing with the ESS
codebase. So I am not sure if it would be better to start fresh, or to stick to ESS
.
By your logic there should be an r
layer instead of an ess
layer, so I think that the ess
layer should keep its ability to be used with julia out of the box.
Questions:
- Which parts of
ess
are julia only? - you are going to use
julia-repl
, how is this going to give an identical experience?
I finally had time to play around with this a little bit and it looks really good.
I would propose to make the ess-layer in such a way that julia support can be disabled there ( EDIT: lsp-mode even works in terminal, but it gets messy, when both terminal and gui frames are open :-) |
@gdkrmr You should be able to toggle whether On lsp-mode in the REPL, that's interesting; I haven't even tried it there. What steps did you take to get it working? Just invoking |
That sounds good, I was not aware of this, I was trying to conditionally remove all the julia specific stuff from the
What I did was copying your files to the private layers directory, removing (julia :variables
julia-mode-enable-lsp t
julia-mode-enable-ess nil) If I run |
Setting I added some keybindings to the ess layer some time ago and there was some discussion about spacemacs conventions, you may want to take a look at that (#9787). I personally have the following in my muscle memory:
|
Great work. Are you still planning to update it further. Is it OK to directly try to merge your changes into my Spacemacs repo and see if it works? I don't want to have to use Atom (Juno) whenever I work on Julia projects... |
@x-ji yep. Still some work to do to get this to the point where I'm happy with it. Should work fine to just merge this branch though if you're already following develop. |
I'm happy with this PR now. Let me know how it's looking in general, and I'll squash commits and rebase on current develop. |
I am using it for everyday julia programming and really like it, great work!
|
Here is another improvement, but I am not sure where this best belongs, |
To be honest, I haven't even tried 0.7 yet. @tpapp, any idea what's going on above? Is that a bug with julia-repl for 0.7? Or just new hooks for integrating into the |
@non-Jedi: thanks for the heads up, opened an issue, will fix it soon |
FYI, the keybindings I setup weren't actually working in |
@syl20bnr this has been sitting for a while because it was WIP for a while, but it's ready now. I don't really know what the structure is around here; is there someone I should tag to get this reviewed so we can start moving it towards a merge? |
here is a feature you could add, so (add-hook 'julia-mode-hook
(lambda ()
(push '(?b . ("begin" . "end")) evil-surround-pairs-alist)
(push '(?q . ("quote" . "end")) evil-surround-pairs-alist)
(push `(?l . ("let" . "end")) evil-surround-pairs-alist)
(push '(?: . (":(" . ")")) evil-surround-pairs-alist))) EDIT: added |
I'll go ahead and merge this layer once it's rebased with latest develop and all commits are squashed into one. |
please add my suggestions before merging, I want them out of my |
@gdkrmr 👍 but if they are not added here I will accept a PR with them afterwards. They seem straightforward and will be merged fast. |
@sdwolfz Thanks! I've squashed the commits down into three logical commits; let me know if you'd prefer just one. Otherwise things should be good. @gdkrmr I'm not entirely sure how to make your addition dependent on presence of |
Thank you ❤️! |
great, thanks for merging this!!! |
This PR builds a layer for Julia that is separate from ESS using julia-repl and
LSP. This is necessary because the REPL included with ESS doesn't allow proper
usage of the Julia debugger Gallium.jl. I've got a bit of cleaning up to do
here, but I was hoping somebody with more knowledge could help me out with the
below problems:
spacemacs-jump-handlers-julia-mode
isn't getting propagated tospacemacs-jump-handlers
, sospacemacs/jump-to-definition
doesn't workin julia-mode buffers. (FIXED by not starting REPL automatically)
nice controlled buffer as shown in the lsp-ui docs. (
This is caused byProbably just a locallsp-ui-doc behaves weird emacs-lsp/lsp-ui#87 . Proposed solution is to
disable lsp-ui-doc until emacs 26 becomes stable.
problem from weirdly configured fonts...)
, f f
, the buffer with the file contents isnever focused. You have to manually switch to the new buffer. (FIXED by
not starting REPL automatically)
layer play nice for people who want to use ESS for R but this layer for
Julia? Do I need to set the ESS stuff up as a backend similar to the
Python layer?
lsp-ui isn't necessary for this layer to be useful, so those could just be
turned off for now. The others probably need to be fixed before merging.