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

A few comments #2

Closed
tecosaur opened this issue Feb 9, 2020 · 6 comments
Closed

A few comments #2

tecosaur opened this issue Feb 9, 2020 · 6 comments

Comments

@tecosaur
Copy link

tecosaur commented Feb 9, 2020

This may be abandoned, but I've just found it, and I like it ... a lot.

Two deficiencies I have come across:

  • It changes hyphens - for the entire buffer, not just tables
  • + symbols remain unchanged, perhaps could be handy?

I see you weren't that interested in upstreaming it five years ago, but it would now fit in very nicely with org pretty entities.

Is there any chance you may work on this some more in the future?

@Fuco1
Copy link
Owner

Fuco1 commented Feb 9, 2020

The code for the + is already there, probably just doesn't work anymore :D Although I don't think org table syntax changed at all. Weird.

         ((equal "+" match)
          (cond
           ((and (eq (following-char) ?-)
                 (save-excursion
                   (backward-char 1)
                   (eq (preceding-char) ?-))
                 (save-excursion
                   (backward-char 1)
                   (previous-line)
                   (eq (following-char) ?|))
                 (save-excursion
                   (backward-char 1)
                   (next-line)
                   (eq (following-char) ?|)))
            (put-text-property (match-beginning 0) (match-end 0) 'display "")
            t)

The hyphen fix should be quite simple, we need to find the table, then get its limits (org-table-begin and org-table-end) and then use narrow-to-region to limit the scope of replacement.

I don't think I'll work on this in the future, I think I did it basically as a demo for someone who was interested in text properties and stuff.

But who knows, I'm doing a lot of presentations with https://github.com/takaxp/org-tree-slide lately so pretty tables might come handy some day. But no promises.

@tecosaur
Copy link
Author

tecosaur commented Feb 9, 2020

Thanks for getting back to me, and outlining the fix :)
I'll be overjoyed if I see this in the future.
Unfortunately, I'm lisp-illiterate — so I'll just hope for now.

@Yevgnen
Copy link

Yevgnen commented Nov 24, 2020

The + does not work with GNU Emacs 27.1 (build 1, x86_64-apple-darwin20.1.0, Carbon Version 164 AppKit 2022.1) of 2020-11-15 and org 9.4/9.5-dev.

Screen Shot 2020-11-24 at 8 40 04 AM

@daemianmack
Copy link

I'm intermittently experiencing the same issue with the + character.

For what it's worth, disabling the mode and re-enabling org-pretty-table mode seems to fix the issue.

(GNU Emacs 28.0.50, stock org-mode.)

@Fuco1
Copy link
Owner

Fuco1 commented Mar 5, 2023

I've pushed some code to fix the + and other issues. If this resurfaces please let me know 🙏

@Fuco1 Fuco1 closed this as completed Mar 5, 2023
@Fuco1
Copy link
Owner

Fuco1 commented Mar 5, 2023

It changes hyphens - for the entire buffer, not just tables

I also fixed this

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

4 participants