sage-shell-mode icon indicating copy to clipboard operation
sage-shell-mode copied to clipboard

Spacemacs integration

Open alejandroerickson opened this issue 9 years ago • 8 comments

I've started to integrate the sage stuff into spacemacs. If you are familiar I invite you to comment on my configuration, found in packages.el here: https://github.com/alejandroerickson/spacemacs/tree/myconfig/layers/%2Blang/sagemath

alejandroerickson avatar Jun 23 '16 11:06 alejandroerickson

Thank you for trying to write a layer for SageMath. I think it is a very good attempt. I don't know spacemacs very well, but the following are some thoughts.

  1. You don't have to install both of sage-mode and sage-shell-mode. You can use these two packages simultaneously. But there exist some conflicts of key-bindings between them.
  2. The initial state for sage-shell-mode (a major mode for Sage repl) should be the insert state or the emacs state. You can set the initial state of evil for a mode by evil-set-initial-state.
  3. I wrote some extensions for sage-shell-mode (e.g. auto-complete-sage, helm-sage, ob-sagemath). It would be nice if these packages could be available in the layer.

stakemori avatar Jun 24 '16 00:06 stakemori

Great! Yeah, I saw that sage-mode is more or less subsumed by sage-shell-mode. I chose helm-sage over auto-complete-sage because I think it is used more broadly, being an integral part of Spacemacs. Does it offer anything that you can't get from helm-sage?

I have not explored ob-sagemath yet, but I will include it.

alejandroerickson avatar Jun 24 '16 15:06 alejandroerickson

Hmm. I wouldn't say that sage-mode is necessarily subsumed by sage-shell-mode. AFAIK, there are still (important) things that sage-mode does that sage-shell-mode doesn't: https://wiki.sagemath.org/SageModeComparison

Though it may be that things have changed since I wrote that page--I haven't been too active lately since I don't use Sage much anymore.

gvol avatar Jun 24 '16 17:06 gvol

Does it offer anything that you can't get from helm-sage?

  1. auto-complete-sage shows popup help when a completion candidate is selected (screenshot). But this feature is turned off by default because it is slow.

  2. By default helm-sage does not show completion candidates which start with the underscore _, i.e. it does not show internal or special methods such as __add__, __eq__. By setting helm-sage-candidate-regexp as below, it will show all completion candidates.

    (setq helm-sage-candidate-regexp (rx (1+ (or alnum "_"))))
    

For what it's worth, I wrote a company-backend for Sage, though it is not available from MELPA.

@gvol, one important thing sage-shell-mode doesn't have is inline display of graphs and LaTeX images (#5). Unfortunately, I don't have enough time to implement it these days (But I use Sage and sage-shell-mode almost everyday).

stakemori avatar Jun 25 '16 06:06 stakemori

@alejandroerickson are you still working on it?

iromise avatar Feb 08 '18 14:02 iromise

Hi all,

I have on my end, taken @alejandroerickson layer proposal in my private directory, and just made a few modifications: https://github.com/btljuice/dotfiles/blob/master/.emacs.d/private/sagemath/packages.el

I have taken out the sage-mode package and changed a few keybindings here and there. It works pretty well out-of-the-box, but certainly needs some polish.

If there is still some interest into bringing this layer integrated into spacemacs, I'm willing to put some effort to improve it to a suitable state for a proper pull request. But I'd need a bit of help. I'm a fairly good programmer, but I'm far from an elisp + emacs + spacemacs expert.

First of here's a todo checklist of what is probably left to be done:

  • Verify necessary package to install and their mandatory dependencies
  • Add suitable package configuration/setup that integrates properly with spacemacs (e.g. company back-end integration, good defaults, etc.)
  • Verify major-mode keybindings abide to spacemacs common conventions.
  • Complete layer documentation

If there's any point I might be missing or some pointers that could help me out, let me know.

btljuice avatar Mar 20 '18 14:03 btljuice

@alejandroerickson @btljuice How is it with your private layers? Are either of you using it and does it work well? What about submitting a PR for spacemacs repo?

vv111y avatar Dec 10 '18 21:12 vv111y

Not using or maintaining them anymore because I no longer use sagemath or emms. Sorry!

On Mon, 10 Dec 2018 at 13:06, vv111y [email protected] wrote:

@alejandroerickson https://github.com/alejandroerickson @btljuice https://github.com/btljuice How is it with your private layers? Are either of you using it and does it work well? What about submitting a PR for spacemacs repo?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sagemath/sage-shell-mode/issues/6#issuecomment-445972910, or mute the thread https://github.com/notifications/unsubscribe-auth/AF1zUGrjmI1ibE8i895L-5Xa7SLSWFHbks5u3szVgaJpZM4I8sWW .

-- Software Developer at Copperleaf, Vancouver, Canada phone: +1 778 840-0267 http://alejandroerickson.com

alejandroerickson avatar Dec 10 '18 22:12 alejandroerickson