Skip to content

Fix typeset output #74

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

Merged

Conversation

EmmanuelCharpentier
Copy link
Collaborator

@EmmanuelCharpentier EmmanuelCharpentier commented Jun 10, 2023

  • Reintegrate Alessandro Presta's @apresta fix to typesetting, somehow dropped.
  • [ Cosmetic ] Reformatted docstring >80 characters wide.

Please review this before I merge it.

This patch adapts sage-shell-mode to recent pmodification of Sages' rich output
generation, and filters spurious math delimiters.
[ Cosmetic ] Reformatted docstring >80 characters wide.
@hivert
Copy link

hivert commented Jun 11, 2023

I tried to use this one instead of the elpa one. I got the following error message:

error in process filter: sage-shell-view-latex-str: Symbol’s value as variable is void: sage-shell-view-latex-math-environment
error in process filter: Symbol’s value as variable is void: sage-shell-view-latex-math-environment

But perhaps this is due to some customization on my side...

@EmmanuelCharpentier
Copy link
Collaborator Author

EmmanuelCharpentier commented Jun 11, 2023 via email

@dimpase
Copy link
Member

dimpase commented Jun 12, 2023

@apresta

@EmmanuelCharpentier
Copy link
Collaborator Author

WorksForMe(TM)...

I tried to use this one instead of the elpa one. I got the following error message:

How did you proceed ?

But perhaps this is due to some customization on my side...

Could you check this again ?

@EmmanuelCharpentier
Copy link
Collaborator Author

BTW : C-h v sage-shell-view-latex-math-environment gives me :

sage-shell-view-latex-math-environment is a variable defined in ‘sage-shell-view.el’.

Its value is "math"

Math environment for LaTeX.

  You can customize this variable.

Could you look up this variable in your sage-shell-view.el ?

In the proposed version (visible in Github in the "Reintegrate..." patcc) , I see :

(defcustom sage-shell-view-latex-math-environment "math"
  "Math environment for LaTeX."
  :group 'sage-shell-view
  :type 'string)

at lines 174-177 of sage-shell-view.el. If you don't see it, you may have a botched merge.

Keep me posted.

@hivert
Copy link

hivert commented Jun 12, 2023

I don't understand which branch I need to checkout. I did:

git clone [email protected]:EmmanuelCharpentier/sage-shell-mode.git
git checkout fix-typeset-output

and I don't get those line. It seens that they where removed by commit

c3ea00d8ba8e4dac326066793b4ee4f97a7cdcb9
Merge pull request #71 from apresta/fix-latex

Should I just clone the previous commit ? that is

f394754ebca227d1959f991069ab86a613350b6d
Reintegrate Alessandro Presta's fix to typesetting, somehow dropped.

Here is the 3 last log message

commit ef5296b1a71f5f20d4a66c7feffa3c7b09efb029 (HEAD -> fix-typeset-output, origin/fix-typeset-output)
Merge: f394754 c3ea00d
Author: EmmanuelCharpentier <[email protected]>
Date:   Sat Jun 10 10:38:54 2023 +0200

    Merge branch 'master' into fix-typeset-output

commit f394754ebca227d1959f991069ab86a613350b6d
Author: Emmanuel Charpentier <[email protected]>
Date:   Sat Jun 10 10:27:15 2023 +0200

    Reintegrate Alessandro Presta's fix to typesetting, somehow dropped.
    
    [ Cosmetic ] Reformatted docstring >80 characters wide.

commit c3ea00d8ba8e4dac326066793b4ee4f97a7cdcb9 (origin/master, origin/HEAD, master)
Merge: 80fbb4e 2140de1
Author: EmmanuelCharpentier <[email protected]>
Date:   Fri Jun 9 19:25:03 2023 +0200

    Merge pull request #71 from apresta/fix-latex
    
    Fix latex rendering in sage-shell-view

@hivert
Copy link

hivert commented Jun 12, 2023

Cloning
f394754ebca227d1959f991069ab86a613350b6d
works ! It seems that your last merge went wrong.

@dimpase
Copy link
Member

dimpase commented Jun 12, 2023

the standard way to fetch the branch of a PR number 42 in a repo foo would be to

git fetch foo pulls/42/head

No need to get stuff from the repo of the creator of the PR.

@hivert
Copy link

hivert commented Jun 12, 2023

Thanks for the tip ! Though it is 'pull/42/head' with no s.

@EmmanuelCharpentier
Copy link
Collaborator Author

I do not understand the origin of the third commit : I do not remember doing it. Top of my log :

charpent@zen-book-flip:~/Dev/sage-shell-mode$ git log | head n=20
head: impossible d'ouvrir 'n=20' en lecture: Aucun fichier ou dossier de ce type
charpent@zen-book-flip:~/Dev/sage-shell-mode$ git log | head 
commit f394754ebca227d1959f991069ab86a613350b6d
Author: Emmanuel Charpentier <[email protected]>
Date:   Sat Jun 10 10:27:15 2023 +0200

    Reintegrate Alessandro Presta's fix to typesetting, somehow dropped.
    
    [ Cosmetic ] Reformatted docstring >80 characters wide.

commit 237aae32a944f31ff2d1cf712a26136c18794c68
Author: Emmanuel Charpentier <[email protected]>
charpent@zen-book-flip:~/Dev/sage-shell-mode$ man head
charpent@zen-book-flip:~/Dev/sage-shell-mode$ git log | head -n 20
commit f394754ebca227d1959f991069ab86a613350b6d
Author: Emmanuel Charpentier <[email protected]>
Date:   Sat Jun 10 10:27:15 2023 +0200

    Reintegrate Alessandro Presta's fix to typesetting, somehow dropped.
    
    [ Cosmetic ] Reformatted docstring >80 characters wide.

commit 237aae32a944f31ff2d1cf712a26136c18794c68
Author: Emmanuel Charpentier <[email protected]>
Date:   Sun Apr 9 20:34:09 2023 +0200

    Re-enable typeset output in Emacs' *Sage* buffer.
    
    This patch adapts sage-shell-mode to recent pmodification of Sages' rich output
    generation, and filters spurious math delimiters.

commit 80fbb4ee9ed8507d22214ed7a4ffd135c9e8c7c8
Author: Frédéric Chapoton <[email protected]>
Date:   Thu Oct 20 12:12:51 2022 +0200

Worse : I do not know how to get rid of this "commit from Mars'. Time to crack Github's documentation... tomorrow !

@dimpase
Copy link
Member

dimpase commented Jun 12, 2023

it's just git: on your machine do

git revert <commit>
git push -f

@EmmanuelCharpentier
Copy link
Collaborator Author

it's just git: on your machine do

git revert <commit>

That wasn't necessary, since the "commit from Mars" doesn't exist on my machine.

git push -f

That did it. Thank you, Dima !
Florent (and others ?) : a final check before I merge ?

@EmmanuelCharpentier EmmanuelCharpentier merged commit d803d38 into sagemath:master Jun 14, 2023
@EmmanuelCharpentier
Copy link
Collaborator Author

Re-checked, merged, tested.

Done...

@slel
Copy link
Member

slel commented Jun 14, 2023

The change to the function supported_output
in the file emacs_sage_shell_view.py
from commit 658dced
looks wrong.

658dced

@EmmanuelCharpentier
Copy link
Collaborator Author

EmmanuelCharpentier commented Jun 14, 2023

The change to the function supported_output in the file emacs_sage_shell_view.py from commit 658dced looks wrong.

What is wrong ?

Would you mind open another issue and explain what seems wrong and why ?

Sincerely,

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

Successfully merging this pull request may close these issues.

4 participants