emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Bug: org-table-clean-line may not return only | and space [9.4.4 (release_9.4.4 @ /home/tbb/code/emacs/emacs/lisp/org/)] [9.4.4 (release_9.4.4 @ /home/tbb/code/emacs/emacs/lisp/org/)]
Date: Sun, 23 May 2021 12:21:35 -0300	[thread overview]
Message-ID: <87a6olpjb4.fsf@tbb.theblackbeard.org> (raw)

Starting from emacs -Q:
1. C-x C-f test.org
2. Write something like the following:
Here is a table:
|Data1|Data2
3. Make sure to leave the last column without the "|"
4. C-o, with point at the table row.
5. I expected to get a clean row:
Here is a table:
|       |       |
| Data1 | Data2 |

but I got:
Here is a table:
|       | Data2 |
| Data1 | Data2 |

I realize this might be a corner-case, but I'm used to leave the last
column without "|", because TAB is smart enough to add it for me.  So
the "Data2" repetition becomes a little annoying.

If I put point at the row
| Data1 | Data2
the following:
(org-table-clean-line (buffer-substring (line-beginning-position) (line-end-position)))
evaluates to a string that has characters other than "|" and space, but
org-table-clean-line says it returns a string with only "|" and space.

I've tweaked the relevant regexp in org-table-clean-line to
"|\\([ \t]*?[^ \t\r\n|][^\r\n|]*\\)|?"
and that fixes it for me.

Best regards,
Mauro.


Emacs  : GNU Emacs 28.0.50 (build 5, i686-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.16.0)
 of 2021-05-19
Package: Org mode version 9.4.4 (release_9.4.4 @ /home/tbb/code/emacs/emacs/lisp/org/)


             reply	other threads:[~2021-05-23 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 15:21 Mauro Aranda [this message]
2021-05-30  6:07 ` Bug: org-table-clean-line may not return only | and space [9.4.4 (release_9.4.4 @ /home/tbb/code/emacs/emacs/lisp/org/)] [9.4.4 (release_9.4.4 @ /home/tbb/code/emacs/emacs/lisp/org/)] Ihor Radchenko
2022-10-06  8:27   ` Ihor Radchenko
2022-10-06 10:53     ` Mauro Aranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6olpjb4.fsf@tbb.theblackbeard.org \
    --to=maurooaranda@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).