Re: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)]
Spectira Chiando writes: > Patch is working great, have been using it heavily for the past month. Thanks > very much! Applied. I took a freedom to push the patch to main. Best, Ihor
Re: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)]
I've had this happen in an earlier version of org and found if I get on the last record in a table at the beginning of the line and tab the number of columns in the table plus 1 I get a blank new record added to the table and the extra unintended column does not appear. In the earlier version of orgmode I use if I go down to the last record then tab once to get into the first column of the table and then start entering data and finish the data entry in that record or add more records, then the extra unintended column does appear. I only mention this behavior as confirmation of this behavior. On Tue, 9 Nov 2021, Spectira Chiando wrote: > Ihor, > > Patch is working great, have been using it heavily for the past month. Thanks > very much! > > Spectria > > Sent: Saturday, October 02, 2021 at 1:54 AM > From: "Ihor Radchenko" > To: spect...@mail.com > Cc: emacs-orgmode@gnu.org > Subject: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a > @ /home/user/.emacs.d/elpa/org-9.4.6/)] > Ihor Radchenko writes: > > > spect...@mail.com writes: > > > >> In a preexisting org table, hitting can add a new, unintended column > >> > >> Bug: After the 2nd iteration, org adds a unintended new column. Further > >> iteration adds more columns. > > > > Confirmed > > > > The problem appears somewhere inside org-table-justify-field-maybe > > And here is the fix. > > I am not familiar with org-table codebase, so feedback would be > appreciated. > > Best, > Ihor > > >
Re: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)]
Ihor, Patch is working great, have been using it heavily for the past month. Thanks very much! Spectria Sent: Saturday, October 02, 2021 at 1:54 AM From: "Ihor Radchenko" To: spect...@mail.com Cc: emacs-orgmode@gnu.org Subject: [PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)] Ihor Radchenko writes: > spect...@mail.com writes: > >> In a preexisting org table, hitting can add a new, unintended column >> >> Bug: After the 2nd iteration, org adds a unintended new column. Further iteration adds more columns. > > Confirmed > > The problem appears somewhere inside org-table-justify-field-maybe And here is the fix. I am not familiar with org-table codebase, so feedback would be appreciated. Best, Ihor
[PATCH] Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)]
Ihor Radchenko writes: > spect...@mail.com writes: > >> In a preexisting org table, hitting can add a new, unintended column >> >> Bug: After the 2nd iteration, org adds a unintended new column. Further >> iteration adds more columns. > > Confirmed > > The problem appears somewhere inside org-table-justify-field-maybe And here is the fix. I am not familiar with org-table codebase, so feedback would be appreciated. Best, Ihor >From 36485b234d607be16cc06912dc85b9984a0142af Mon Sep 17 00:00:00 2001 Message-Id: <36485b234d607be16cc06912dc85b9984a0142af.1633157571.git.yanta...@gmail.com> From: Ihor Radchenko Date: Sat, 2 Oct 2021 14:44:30 +0800 Subject: [PATCH] org-table.el: Do not create new field when at EOL after table line * lisp/org-table.el (org-table-justify-field-maybe): Do not treat "|$" as unclosed table field. Fixes https://orgmode.org/list/trinity-2561db57-1561-470b-982f-0d91ddf4f145-1629900012884@3c-app-mailcom-lxa06 --- lisp/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 89c57fb06..e34872fb4 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4436,7 +4436,7 @@ (defun org-table-justify-field-maybe ( new) (col (org-table-current-column))) (when (> col 0) (skip-chars-backward "^|") - (if (not (looking-at " *\\([^|\n]*?\\) *\\(|\\|$\\)")) + (if (not (looking-at " *\\(?:\\([^|\n]*?\\) *\\(|\\)\\|\\([^|\n]+?\\) *\\($\\)\\)")) (setq org-table-may-need-update t) (let* ((align (nth (1- col) org-table-last-alignment)) (width (nth (1- col) org-table-last-column-widths)) -- 2.32.0