emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: table header line mode causes next-line to reach beginning of line
@ 2021-04-17 16:45 Oorja Sandhu
  2021-04-17 19:13 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Oorja Sandhu @ 2021-04-17 16:45 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1396 bytes --]

Hi,
   This is about the new org-table-header-line-mode, which is very useful to me, thanks.

Attached is the smallest file I could create to reproduce this issue. Steps :

1. emacs -Q
Latest Emacs cloned and built from master today.

2. Open the attached file

3. M-x org-table-header-line-mode

4. Resize emacs window very small such that horizontal as well as vertical scrolling is required to see it fully.
Otherwise, add rows and columns in the org table in the file such that it exceeds window size both vertically and horizontally. This is not a useless example because the header line mode is most useful when you have a big table and heading scrolls off your visible window.

5. Go to end of line in a row in the table when the header line overlay is active.

6. Press C-n  (or down arrow) twice

Observation : cursor is at the beginning-of-line

Expected : cursor should remain at the same column as earlier

=========
My unsuccessful code analysis, if anyone is interested :
There is a post command hook to update the overlay of table header. This includes the function "beginning-of-line". In more recent versions of org, it is (move-beginning-of-line 2).

But all instances of "beginning-of-line" or "move-beginning-of-line" are wrapped in "save-excursion".. In fact if I invoke (org-table-header-set-header) instead of C-n, the cursor does not go to beginning of line.

thanks
Oorja

[-- Attachment #1.2: Type: text/html, Size: 1982 bytes --]

[-- Attachment #2: orgheaderline.org --]
[-- Type: application/vnd.lotus-organizer, Size: 391 bytes --]

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

* Re: Bug: table header line mode causes next-line to reach beginning of line
  2021-04-17 16:45 Bug: table header line mode causes next-line to reach beginning of line Oorja Sandhu
@ 2021-04-17 19:13 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-04-17 19:13 UTC (permalink / raw)
  To: Oorja Sandhu; +Cc: emacs-orgmode

Oorja Sandhu writes:

[...]
> 3. M-x org-table-header-line-mode
>
> 4. Resize emacs window very small such that horizontal as well as
> vertical scrolling is required to see it fully.
> 
> Otherwise, add rows and columns in the org table in the file such that
> it exceeds window size both vertically and horizontally. This is not a
> useless example because the header line mode is most useful when you
> have a big table and heading scrolls off your visible window.
>
> 5. Go to end of line in a row in the table when the header line
> overlay is active.
>
> 6. Press C-n  (or down arrow) twice
>
> Observation : cursor is at the beginning-of-line
>
> Expected : cursor should remain at the same column as earlier

Thanks for the report and the clear steps to reproduce the issue.

> =========
> My unsuccessful code analysis, if anyone is interested :
> There is a post command hook to update the overlay of table
> header. This includes the function "beginning-of-line". In more recent
> versions of org, it is (move-beginning-of-line 2).
>
> But all instances of "beginning-of-line" or "move-beginning-of-line"
> are wrapped in "save-excursion".. In fact if I invoke
> (org-table-header-set-header) instead of C-n, the cursor does not go
> to beginning of line.

Yes, it looks like the issue is that the movement in
org-table-header-set-header resets temporary-goal-column to 0, messing
with the logic in line-move-1.  This should be fixed by f12ca1a56.


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

end of thread, other threads:[~2021-04-17 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-17 16:45 Bug: table header line mode causes next-line to reach beginning of line Oorja Sandhu
2021-04-17 19:13 ` Kyle Meyer

Code repositories for project(s) associated with this 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).