emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tables recently stopped aligning
@ 2015-07-07  2:30 William Denton
  2015-07-07  4:56 ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: William Denton @ 2015-07-07  2:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 635 bytes --]

Last week I got caught up on a week or two of Emacs and Org development (I run 
both from development trees) and some tables stopped aligning.  I worked one 
down to five lines:

https://gist.github.com/wdenton/ab890c36090cd4048d49

With Org compiled from the dev tree in Git, when I load that file (align.org) 
and hit C-c C-c, it doesn't align.  emacs -Q loads Org 8.2.10 (from the Emacs 
source) and it does align.

Does it work for others?  I assume it does---surely if other people noticed this 
problem they'd have reported it already.

Bill
-- 
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tables recently stopped aligning
  2015-07-07  2:30 Tables recently stopped aligning William Denton
@ 2015-07-07  4:56 ` Nick Dokos
  2015-07-09  2:06   ` William Denton
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2015-07-07  4:56 UTC (permalink / raw)
  To: emacs-orgmode

William Denton <wtd@pobox.com> writes:

> Last week I got caught up on a week or two of Emacs and Org
> development (I run both from development trees) and some tables
> stopped aligning.  I worked one down to five lines:
>
> https://gist.github.com/wdenton/ab890c36090cd4048d49
>
> With Org compiled from the dev tree in Git, when I load that file
> (align.org) and hit C-c C-c, it doesn't align.  emacs -Q loads Org
> 8.2.10 (from the Emacs source) and it does align.
>
> Does it work for others?  I assume it does---surely if other people
> noticed this problem they'd have reported it already.
>

I can reproduce it with release_8.3beta-1274-gc76fef.
I bisected it to the following commit:

--8<---------------cut here---------------start------------->8---
6d60138260d54bf8403b9c87155682447808335e is the first bad commit
commit 6d60138260d54bf8403b9c87155682447808335e
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date:   Sun Jun 28 15:45:31 2015 +0200

    org-table: Do not modify buffer needlessly when aligning table
    
    * lisp/org-table.el (org-table-align): Compare new table with old one
      before replacing it.  Only replace modified lines.

:040000 040000 2ef4220238baf6508c5de7270b6ac37733ac0934 f7d7ff100f0fdaee2ddab08b3514908d6d7643a0 M	lisp
--8<---------------cut here---------------end--------------->8---

-- 
Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tables recently stopped aligning
  2015-07-07  4:56 ` Nick Dokos
@ 2015-07-09  2:06   ` William Denton
  2015-07-09  9:47     ` Rasmus
  2015-07-09 16:01     ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: William Denton @ 2015-07-09  2:06 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1759 bytes --]

Thanks for locating this.  I don't know enough about Org's workings to see what 
in the change introduced the bug, but something did go wrong, and column widths 
+ table alignments are broken.  I hope someone can fix it!

Bill

On 7 July 2015, Nick Dokos wrote:

> William Denton <wtd@pobox.com> writes:
>
>> Last week I got caught up on a week or two of Emacs and Org
>> development (I run both from development trees) and some tables
>> stopped aligning.  I worked one down to five lines:
>>
>> https://gist.github.com/wdenton/ab890c36090cd4048d49
>>
>> With Org compiled from the dev tree in Git, when I load that file
>> (align.org) and hit C-c C-c, it doesn't align.  emacs -Q loads Org
>> 8.2.10 (from the Emacs source) and it does align.
>>
>> Does it work for others?  I assume it does---surely if other people
>> noticed this problem they'd have reported it already.
>>
>
> I can reproduce it with release_8.3beta-1274-gc76fef.
> I bisected it to the following commit:
>
> --8<---------------cut here---------------start------------->8---
> 6d60138260d54bf8403b9c87155682447808335e is the first bad commit
> commit 6d60138260d54bf8403b9c87155682447808335e
> Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date:   Sun Jun 28 15:45:31 2015 +0200
>
>    org-table: Do not modify buffer needlessly when aligning table
>
>    * lisp/org-table.el (org-table-align): Compare new table with old one
>      before replacing it.  Only replace modified lines.
>
> :040000 040000 2ef4220238baf6508c5de7270b6ac37733ac0934 f7d7ff100f0fdaee2ddab08b3514908d6d7643a0 M	lisp
> --8<---------------cut here---------------end--------------->8---
>
>

-- 
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tables recently stopped aligning
  2015-07-09  2:06   ` William Denton
@ 2015-07-09  9:47     ` Rasmus
  2015-07-09 16:01     ` Nicolas Goaziou
  1 sibling, 0 replies; 6+ messages in thread
From: Rasmus @ 2015-07-09  9:47 UTC (permalink / raw)
  To: emacs-orgmode

William Denton <wtd@pobox.com> writes:

> Thanks for locating this.  I don't know enough about Org's workings to
> see what in the change introduced the bug, but something did go wrong,
> and column widths + table alignments are broken.  I hope someone can
> fix it!

The problem is that the highlighted condition is always true.  There are
two things causing this.  First, format doesn't truncate string unless you
do something like %40.40.  Second, buffer-substring also returns invisible
text.  In practice this imply that tables can only grow and not truncate
now.

    ;; Replace modified lines only.
    (dolist (l lines)
      (let ((line (if l (apply #'format rfmt (append (pop fields) emptystrings))
		    hfmt)))
	(if (equal (buffer-substring (point) (line-beginning-position 2)) line)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Rasmus

-- 
A page of history is worth a volume of logic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tables recently stopped aligning
  2015-07-09  2:06   ` William Denton
  2015-07-09  9:47     ` Rasmus
@ 2015-07-09 16:01     ` Nicolas Goaziou
  2015-07-10  0:07       ` Nick Dokos
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-07-09 16:01 UTC (permalink / raw)
  To: William Denton; +Cc: Nick Dokos, emacs-orgmode

Hello,

William Denton <wtd@pobox.com> writes:

> Thanks for locating this.  I don't know enough about Org's workings to
> see what in the change introduced the bug, but something did go wrong,
> and column widths + table alignments are broken.  I hope someone can
> fix it!

Fixed in 120dcd1. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Tables recently stopped aligning
  2015-07-09 16:01     ` Nicolas Goaziou
@ 2015-07-10  0:07       ` Nick Dokos
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2015-07-10  0:07 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> William Denton <wtd@pobox.com> writes:
>
>> Thanks for locating this.  I don't know enough about Org's workings to
>> see what in the change introduced the bug, but something did go wrong,
>> and column widths + table alignments are broken.  I hope someone can
>> fix it!
>
> Fixed in 120dcd1. Thank you.
>

Confirmed, thanks!

-- 
Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-10  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07  2:30 Tables recently stopped aligning William Denton
2015-07-07  4:56 ` Nick Dokos
2015-07-09  2:06   ` William Denton
2015-07-09  9:47     ` Rasmus
2015-07-09 16:01     ` Nicolas Goaziou
2015-07-10  0:07       ` Nick Dokos

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).