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

Fixed table characters for some cases #3

Merged
merged 2 commits into from
Mar 29, 2020

Conversation

codecoll
Copy link
Contributor

Org moves the cursor when going to the previous line, so it has to be positioned explicitly above the investigated character, instead of just using previous-line.

Also, the table can have parameter lines before or after it starting with a # character, so these cases are also considered as empty lines.

Org moves the cursor when going to the previous line, so it has to be positioned explicitly above the investigated character.

Also, the table can have parameter lines before o after it starting with a # character, so these cases are also considered as empty lines.
@Fuco1
Copy link
Owner

Fuco1 commented Mar 22, 2020

Can you provide some minimal example where we can test the "Org moves the cursor when going to the previous line".

Maybe you have installed some other package which does this moving?

@codecoll
Copy link
Contributor Author

Interesting, I cannot reproduce the previous-line problem with a clean Emacs, so I don't know what's going on. previous-line in org tables also move the cursor horizontally for me for some reason, though it is simply bound to "up". It's the same problem that this issue mentions with the + characters not converted: #2

I wanted to fix that, it didn't even occur to me a clean emacs does not reproduce it.

You could try in your emacs with a table like this:

|-------------+---------+------|
|        Date |  Amount | Bank |
|-------------+X--------+------|
| 2020.01.22. |  603716 |         |

If the cursor is where the X is then invoking previous-line moves the cursor to the m character of Amount for me. I don't know why, but this prevents the original code from converting the +.

I'm curious if it happens to you too if you try it.

@codecoll
Copy link
Contributor Author

I may have found the reason. Org has a built in option to indent the org buffer by org heading level. If it's on then the cursor also moves right with the indent level when going up.

If you don't use it then you can try turning it on with M-x org-indent-mode and then moving up in the table.

@Fuco1
Copy link
Owner

Fuco1 commented Mar 22, 2020

For me it looks like this:

So I think there's something else broken in my setup :D

If your fix works with both cases I see no reason of not including it.

@codecoll
Copy link
Contributor Author

You can find the changed version here, if you want to test if it fixes your issue:

https://github.com/codecoll/org-pretty-table/blob/codecoll-character-fixes/org-pretty-table.el

@Fuco1 Fuco1 merged commit 88380f8 into Fuco1:master Mar 29, 2020
@codecoll codecoll deleted the codecoll-character-fixes branch March 29, 2020 18:28
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.

None yet

2 participants