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

Indentation broken with latest 9.7.x/9.8 org mode #552

Open
danielpopescu opened this issue Aug 2, 2024 · 6 comments
Open

Indentation broken with latest 9.7.x/9.8 org mode #552

danielpopescu opened this issue Aug 2, 2024 · 6 comments

Comments

@danielpopescu
Copy link

danielpopescu commented Aug 2, 2024

When using python code.

Using both emacs 30.1 and 29.1 on macos or linux.

Makes writing even small pieces of code frustrating now in python...

If revert to ob-python, all works well....

Ty.

@danielpopescu
Copy link
Author

No one else has this issue? Or if yes, what's the workaround if any? Ty

@danielpopescu danielpopescu changed the title Auto-indentation broken with latest 9.7.x/9.8 org mode Indentation broken with latest 9.7.x/9.8 org mode Sep 13, 2024
@garid3000
Copy link

garid3000 commented Jan 15, 2025

Have you figured it out?
I'm having similar issue on emacs-29.4, org-9.7.19 on linux. Haven't tried other versions yet.

....

UPDATE: I think I found the which causes the issue in my case.
I have following line in my init.el. Removing it fixes my issue of indentation. I'm still not sure why exactly.

(setq major-mode-remap-alist
      '((bash-mode   . bash-ts-mode)
        (python-mode . python-ts-mode)))

@danielpopescu
Copy link
Author

Have you figured it out? I'm having similar issue on emacs-29.4, org-9.7.19 on linux. Haven't tried other versions yet.

....

UPDATE: I think I found the which causes the issue in my case. I have following line in my init.el. Removing it fixes my issue of indentation. I'm still not sure why exactly.

(setq major-mode-remap-alist
      '((bash-mode   . bash-ts-mode)
        (python-mode . python-ts-mode)))

Unfortunately no. I use both emacs 29.4 and 30.1 (work and home, Linux and Mac), native compilation + treesit, with either org 9.7.x or org 9.8.x and it doesnt work in any combination. For now, I mostly stopped using jupyter (just use ob-python) and If I do use it, I am not writing any complex code inside it (just mostly few lines, no indentation).

When did it start happening for you? Was after an update? A new package install?

It's too bad because it used to work great for a while....

@garid3000
Copy link

When did it start happening for you? Was after an update? A new package install?

No, This is my first time experimenting with this package.
Also I found out that following works:
(It seems my issue was something like org-babel was confusing between python, python-ts)

(setq major-mode-remap-alist
      '((bash-mode   . bash-ts-mode)
        (python-mode . python-ts-mode)))

(setf (alist-get "python" org-src-lang-modes nil nil #'equal) 'python-ts) ;; <-- check this line

@danielpopescu
Copy link
Author

When did it start happening for you? Was after an update? A new package install?

No, This is my first time experimenting with this package. Also I found out that following works: (It seems my issue was something like org-babel was confusing between python, python-ts)

(setq major-mode-remap-alist
      '((bash-mode   . bash-ts-mode)
        (python-mode . python-ts-mode)))

(setf (alist-get "python" org-src-lang-modes nil nil #'equal) 'python-ts) ;; <-- check this line

Interesting! I already have that but it did not fix it for me. Where do u have

(setf (alist-get "python" org-src-lang-modes nil nil #'equal) 'python-ts) ;; <-- check this line

?
I had it before and after loading jupyter and it did not do anything for me... It may be some ordering issue...

@danielpopescu
Copy link
Author

I also think this may be a jupyter issue rather than org. ob-python works with python-ts-mode... My guess is that jupyter has to be updated to work with either mode. A lot of people are switching to ts-modes, I am surprised this is not a more common issue...

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

2 participants