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

Silent buffer modifications interefere with org-element-cache #30

Open
yantar92 opened this issue May 21, 2022 · 6 comments
Open

Silent buffer modifications interefere with org-element-cache #30

yantar92 opened this issue May 21, 2022 · 6 comments

Comments

@yantar92
Copy link

Hi,

(with-silent-modifications ... (insert ...) ...) in valign--table-2 prevents org-mode from tracking buffer changes thus breaking parser AST cache. See https://list.orgmode.org/CAGVe720Zom3zfCJODvDrb+WEgEoQ-9nddEWjJ67_Db-VSr=-9g@mail.gmail.com/T/#u

Can you please not use with-silent-modifications when actually modifying the buffer text?

(insert (valign-box-char 'h ucharset))

@casouri
Copy link
Owner

casouri commented Jun 12, 2022

Sorry for the delay. It would be equally annoying if prettifying a table changes the buffer's modification status, and it would be confusing, too. I might be able to not insert that character with a new function introduce in Emacs 28. Let me experiment with that and get back to you. let me know if you have some other ideas, thanks.

@yantar92
Copy link
Author

You may use display properties. Built-in Org formatter should aways leave spaces around table cells to apply the display properties to.

@casouri
Copy link
Owner

casouri commented Jun 12, 2022

It's not that. I need to know the pixel width of that character in the current buffer and window. Believe it or not, the only way to measure that is to insert the character, measure it, and remove the character. I remember seeing a new function that allow me to measure that without inserting the character, hopefully that function spares me of this ugly hack :-)

@yantar92
Copy link
Author

I see. Take a look at org-string-width

@yantar92
Copy link
Author

yantar92 commented Jul 9, 2022

After discussion with emacs-devs, we have changed the Org relevant code. The issue should no longer be triggerred by valign.

@yantar92 yantar92 closed this as completed Jul 9, 2022
@casouri
Copy link
Owner

casouri commented Aug 24, 2022

Thanks, I'll keep this open to remind me of improving valign.

@casouri casouri reopened this Aug 24, 2022
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