Skip to content
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

Sage 9.8.beta7 totally freezes emacs #69

Closed
EmmanuelCharpentier opened this issue Jan 20, 2023 · 8 comments
Closed

Sage 9.8.beta7 totally freezes emacs #69

EmmanuelCharpentier opened this issue Jan 20, 2023 · 8 comments

Comments

@EmmanuelCharpentier
Copy link
Collaborator

EmmanuelCharpentier commented Jan 20, 2023

After upgrading from 9.8.beta6 to 9.6.beta7, launching sage in emacs (M-x run-sage) makes emacs totally unresponsive. The only way to escape is to kill emacs (killall emacs in console).

This happens either from the sole frame of a "fresh" emacs or from a new frame of an otherwise running emacs, whose other frames are also totally frozen.

Extremely annoying, since it deprieves sage-shell-mode of all uses...

@EmmanuelCharpentier
Copy link
Collaborator Author

One more data point :

One can successfully open a new (temporary) buffer, put it in sage-mode and type some code, which is correctly formatted. However, when requesting its interpretation (via C-c C-C), a new window appears, where Sage start, one gets the message mentionning loading sage_shell_mode_temp.sage ... but nothing in printed, never retirns, and emacs is totally frozen.

Its process can be stopped or killed from Gnomes "system monitor", but noit by clicking the "Close window" button of the Emacs frame.

@EmmanuelCharpentier
Copy link
Collaborator Author

Following this suggestin, I tried to fully recompile Sage.

To no avail : M-x run-sage still freezes Emacs, with the same symptoms.

@EmmanuelCharpentier
Copy link
Collaborator Author

I checked that reverting to Sage 9.6.beta6 fixes the issue.

So the question seems to be "What has changed in the interface used by sage-shell-mode?".

@mkoeppe
Copy link
Member

mkoeppe commented Jan 22, 2023

Was your build of 9.6.beta7 using Python 3.11?

@EmmanuelCharpentier
Copy link
Collaborator Author

EmmanuelCharpentier commented Jan 22, 2023

Was your build of 9.6.beta7 using Python 3.11?

As far as I can remember, this build (no longer available, since disk space is tight on bmy current laptop) used the system's Python, which is currently at 3.10.6 in Debian testing (the inclusion of 3.11 in testing seems a bit problematic, due to unsolved dependencies downstream Python...)

I do not remember if there is a way to force Sage's make to use NO system software : that should be the only way to start from an healthy base.

@mantepse
Copy link
Collaborator

It is really strange: I have a 9.8.beta7 build and a 9.8.beta6 build. Apparently, if I first use the beta6 one for sage-shell-mode, I can then use beta7 in the same emacs session.

@mantepse
Copy link
Collaborator

see https://trac.sagemath.org/ticket/34935

interfaces = ['gap', 'gap3', 'giac', 'gp', 'mathematica', 'gnuplot',
              'kash', 'magma', 'macaulay2', 'maple', 'maxima',
              'mathematica', 'mwrank', 'octave', 'r', 'singular',
              'sage0', 'sage']

It is unclear to me, why we special case these words for the tab-completion:

def all_attributes(compl_dct):
    varname = compl_dct["var-base-name"]
    try:
        regexp = re.compile("^[ a-zA-Z0-9._\\[\\]]+$")
        if regexp.match(varname) is None:
            return []
        if varname in interfaces:
            ls = ip.ev('dir(%s)' % (varname,))
        else:
            ls = _completions_attributes(preparse(varname))
            ls.extend(ip.ev('dir(%s)' % (preparse(varname),)))
            ls = list(sorted(set(ls)))
        return ls
    except:
        return []

It is also unclear to me, why we would extend the list of completions obtained from ipython with the result of dir().

I think we should simplify this and let ipython handle it.

@EmmanuelCharpentier
Copy link
Collaborator Author

This issue has been fixed in 9.8.beta8 (IIRC). Forgot to close it.

Which I do now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants