emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-open-line inconsistent treatment of marking characters '#' and '*'
@ 2019-01-10 16:37 Tony E. Bennett
  2019-01-12 10:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Tony E. Bennett @ 2019-01-10 16:37 UTC (permalink / raw)
  To: emacs-orgmode

Hello

org-open-line replicates the table marking character '#' (if present) into
the new table line but does not do the same for '*'.

Since the semantics of '#' and '*' are so similar I expect them to be
treated identically when opening a new table line.

Within defun org-table-insert-row, changing this line:

         ;; Fix the first field if necessary
         (when (string-match "^[ \t]*| *[#$] *|" line)

to:

         ;; Fix the first field if necessary
         (when (string-match "^[ \t]*| *[#*$] *|" line)

gives the expected behavior.

Can this be fixed?

thanks


-- 

--tony

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

* Re: org-open-line inconsistent treatment of marking characters '#' and '*'
  2019-01-10 16:37 org-open-line inconsistent treatment of marking characters '#' and '*' Tony E. Bennett
@ 2019-01-12 10:42 ` Nicolas Goaziou
  2019-01-13  1:48   ` Tony E. Bennett
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2019-01-12 10:42 UTC (permalink / raw)
  To: Tony E. Bennett; +Cc: emacs-orgmode

Hello,

Tony E. Bennett <tony.e.bennett@gmail.com> writes:

> org-open-line replicates the table marking character '#' (if present) into
> the new table line but does not do the same for '*'.
>
> Since the semantics of '#' and '*' are so similar I expect them to be
> treated identically when opening a new table line.
>
> Within defun org-table-insert-row, changing this line:
>
>          ;; Fix the first field if necessary
>          (when (string-match "^[ \t]*| *[#$] *|" line)
>
> to:
>
>          ;; Fix the first field if necessary
>          (when (string-match "^[ \t]*| *[#*$] *|" line)
>
> gives the expected behavior.
>
> Can this be fixed?

OK, I applied the change in maint. However, I tend to think we should
not copy any special marker at all, since we don't check if we're in
a special column anyway.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-open-line inconsistent treatment of marking characters '#' and '*'
  2019-01-12 10:42 ` Nicolas Goaziou
@ 2019-01-13  1:48   ` Tony E. Bennett
  2019-01-13 11:11     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Tony E. Bennett @ 2019-01-13  1:48 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Tony E. Bennett <tony.e.bennett@gmail.com> writes:
>
>> org-open-line replicates the table marking character '#' (if present) into
>> the new table line but does not do the same for '*'.


> OK, I applied the change in maint. However, I tend to think we should
> not copy any special marker at all, since we don't check if we're in
> a special column anyway.

Thank you Nicolas for adding the '*' treatment.

How would org verify column 1 is a special column beyond just checking for
[#*$] which it does already ?

-- 
--tony

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

* Re: org-open-line inconsistent treatment of marking characters '#' and '*'
  2019-01-13  1:48   ` Tony E. Bennett
@ 2019-01-13 11:11     ` Nicolas Goaziou
  2019-01-13 15:12       ` Tony E. Bennett
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2019-01-13 11:11 UTC (permalink / raw)
  To: Tony E. Bennett; +Cc: emacs-orgmode

Hello,

Tony E. Bennett <tony.e.bennett@gmail.com> writes:

> How would org verify column 1 is a special column beyond just checking for
> [#*$] which it does already ?

It would require to check every row. For example, there is no special
column in the following table

  | * | cell |
  | 1 | cell |

However, that would be too long, so maybe not copying anything over the
next row would be the way to go.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-open-line inconsistent treatment of marking characters '#' and '*'
  2019-01-13 11:11     ` Nicolas Goaziou
@ 2019-01-13 15:12       ` Tony E. Bennett
  0 siblings, 0 replies; 5+ messages in thread
From: Tony E. Bennett @ 2019-01-13 15:12 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Tony E. Bennett <tony.e.bennett@gmail.com> writes:
>
>> How would org verify column 1 is a special column beyond just checking for
>> [#*$] which it does already ?
>
> It would require to check every row. For example, there is no special
> column in the following table
>
>   | * | cell |
>   | 1 | cell |

Is 'special first _column_' really an org concept?  Recalc seems to only
look at each row individually.  This table:

  | * | 7 | 11 |   |
  | 1 | 8 | 11 |   |
  | * | 9 | 11 |   |
  #+TBLFM: $4=$2*$3

Then 'C-u C-c *' gives:

  | * | 7 | 11 | 77 |
  | 1 | 8 | 11 |    |
  | * | 9 | 11 | 99 |
  #+TBLFM: $4=$2*$3

The '1' in @2 did not interfere at all with special recalc of @1 & 3.

> However, that would be too long, so maybe not copying anything over the
> next row would be the way to go.

I hope not as the current behavior is very convenient and with little
risk of unintended or unwanted behavior.

thanks

-- 

--tony

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

end of thread, other threads:[~2019-01-13 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-10 16:37 org-open-line inconsistent treatment of marking characters '#' and '*' Tony E. Bennett
2019-01-12 10:42 ` Nicolas Goaziou
2019-01-13  1:48   ` Tony E. Bennett
2019-01-13 11:11     ` Nicolas Goaziou
2019-01-13 15:12       ` Tony E. Bennett

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