doomemacs / doomemacs/core

Bug in +org-yas-expand-maybe-h

Open
#6,337 0 comments 0 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### What did you expect to happen?

I was using org-mode and creating a source block(java) and I tried using a snippet wherein the usual case, I should be able to use the snippet without any trouble,

### What actually happened?

So when I used a snippet, the snippet got added whitespace (tab) at the pointer that I set while creating a snippet.

### Describe your attempts to resolve the issue

After reporting this to the org-babel team, they responded that the issue is with doom configurations, and they responded as follows:

For my reply, they first responded so:
```
> but I also noticed that if i open a major mode for the source code
> using C-c ' , and use snippet in that buffer i m not facing such issues, so
> this is only present when I code directly into the source block.

This is to be expected. The problem you are seeing is triggered by some
third-party code that it modifying the Org buffer and bypassing Org
mode's edit control.

So, you should never see this particular warning inside non-org code
buffers.
```

Finally the concluded so:
```
Thanks! I was able to debug the problem down to +org-yas-expand-maybe-h,
which is defined by doom. That function is let-binding major-mode while
expanding the snippet, which I see as a dangerous practice. In your
case, it breaks Org's change tracking functionality.

Can you report this issue to Doom issue tracker?
```

### Steps to reproduce

I am linking to a video where I explain the issue as well as I have explained the steps:
[Bug in org-mode source block](https://youtu.be/eayDOommpOk)

### System Information

https://pastebin.com/HfX1AtMW

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.