emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: source code editing using C-c ' (org-edit-special) eats characters
@ 2012-10-23 18:03 Hsiu-Khuern Tang
  2012-10-23 20:07 ` Myles English
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Hsiu-Khuern Tang @ 2012-10-23 18:03 UTC (permalink / raw)
  To: orgmode

Hi,

Sorry if this has been reported -- a brief search didn't turn up anything.

Start with this 3-line org file:

--------------------------------------------------
#+begin_example

#+end_example
--------------------------------------------------

Do these steps:
- go to the 2nd line
- type C-c ' to edit the source example
- type some text in the new buffer, such as "test"
- type C-c ' to exit

What I get is this:
--------------------------------------------------
#+begin_example  test#+end_example
--------------------------------------------------

Anyone else able to reproduce this?

-- 
Thanks,
Hsiu-Khuern.

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-23 18:03 Bug: source code editing using C-c ' (org-edit-special) eats characters Hsiu-Khuern Tang
@ 2012-10-23 20:07 ` Myles English
  2012-10-23 20:31 ` Nick Dokos
  2012-10-25  8:53 ` Bastien
  2 siblings, 0 replies; 13+ messages in thread
From: Myles English @ 2012-10-23 20:07 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: orgmode


Hi Hsiu,

Hsiu-Khuern Tang writes:
> What I get is this:
> --------------------------------------------------
> #+begin_example  test#+end_example
> --------------------------------------------------
>
> Anyone else able to reproduce this?

I can't, I get:

#+begin_example
  test
#+end_example

with org 7.9.2.

Myles

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-23 18:03 Bug: source code editing using C-c ' (org-edit-special) eats characters Hsiu-Khuern Tang
  2012-10-23 20:07 ` Myles English
@ 2012-10-23 20:31 ` Nick Dokos
  2012-10-23 21:04   ` myles english
  2012-10-23 21:16   ` Hsiu-Khuern Tang
  2012-10-25  8:53 ` Bastien
  2 siblings, 2 replies; 13+ messages in thread
From: Nick Dokos @ 2012-10-23 20:31 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: orgmode

Hsiu-Khuern Tang <tangoh@gmail.com> wrote:

> Hi,
> 
> Sorry if this has been reported -- a brief search didn't turn up anything.
> 
> Start with this 3-line org file:
> 
> --------------------------------------------------
> #+begin_example
> 
> #+end_example
> --------------------------------------------------
> 
> Do these steps:
> - go to the 2nd line
> - type C-c ' to edit the source example
> - type some text in the new buffer, such as "test"
> - type C-c ' to exit
> 
> What I get is this:
> --------------------------------------------------
> #+begin_example  test#+end_example
> --------------------------------------------------
> 
> Anyone else able to reproduce this?
> 

Yes, although I cannot reproduce Myles's results with Org-mode version
7.9.2 (release_7.9.2-459-g6f7e92 @ /home/nick/elisp/org-mode/lisp).

It depends on what you type exactly: typing "test" with no extra
newlines produces the result above for me. If I add newlines, I get
"funny-looking" results with the #+END_EXAMPLE indented some.

Since it does not know a language, the buffer is in fundamental mode
and you get (modulo funny indentation perhaps) whatever you type.

Nick

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-23 20:31 ` Nick Dokos
@ 2012-10-23 21:04   ` myles english
  2012-10-23 21:16   ` Hsiu-Khuern Tang
  1 sibling, 0 replies; 13+ messages in thread
From: myles english @ 2012-10-23 21:04 UTC (permalink / raw)
  To: nicholas.dokos, Hsiu-Khuern Tang; +Cc: orgmode


Nick Dokos writes:

> Hsiu-Khuern Tang <tangoh@gmail.com> wrote:
>
>> Hi,
>> 
>> Sorry if this has been reported -- a brief search didn't turn up anything.
>> 
>> Start with this 3-line org file:
>> 
>> --------------------------------------------------
>> #+begin_example
>> 
>> #+end_example
>> --------------------------------------------------
>> 
>> Do these steps:
>> - go to the 2nd line
>> - type C-c ' to edit the source example
>> - type some text in the new buffer, such as "test"
>> - type C-c ' to exit
>> 
>> What I get is this:
>> --------------------------------------------------
>> #+begin_example  test#+end_example
>> --------------------------------------------------
>> 
>> Anyone else able to reproduce this?
>> 
>
> Yes, although I cannot reproduce Myles's results with Org-mode version
> 7.9.2 (release_7.9.2-459-g6f7e92 @ /home/nick/elisp/org-mode/lisp).

Sorry I gave the wrong version.

- 7.8.11 can't reproduce it
- 7.9.2 can reproduce it (release_7.9.2-463-g468d86 @ /home/myles/.emacs.d/plugins/org-mode/lisp/)

Myles

>
>
> It depends on what you type exactly: typing "test" with no extra
> newlines produces the result above for me. If I add newlines, I get
> "funny-looking" results with the #+END_EXAMPLE indented some.
>
> Since it does not know a language, the buffer is in fundamental mode
> and you get (modulo funny indentation perhaps) whatever you type.
>
> Nick

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-23 20:31 ` Nick Dokos
  2012-10-23 21:04   ` myles english
@ 2012-10-23 21:16   ` Hsiu-Khuern Tang
  1 sibling, 0 replies; 13+ messages in thread
From: Hsiu-Khuern Tang @ 2012-10-23 21:16 UTC (permalink / raw)
  To: Nick Dokos; +Cc: orgmode

* On Tue 04:31PM, 23 Oct 2012, Nick Dokos (nicholas.dokos@hp.com) wrote:
> Hsiu-Khuern Tang <tangoh@gmail.com> wrote:
> 
> > Hi,
> > 
> > Sorry if this has been reported -- a brief search didn't turn up anything.
> > 
> > Start with this 3-line org file:
> > 
> > --------------------------------------------------
> > #+begin_example
> > 
> > #+end_example
> > --------------------------------------------------
> > 
> > Do these steps:
> > - go to the 2nd line
> > - type C-c ' to edit the source example
> > - type some text in the new buffer, such as "test"
> > - type C-c ' to exit
> > 
> > What I get is this:
> > --------------------------------------------------
> > #+begin_example  test#+end_example
> > --------------------------------------------------
> > 
> > Anyone else able to reproduce this?
> > 
> 
> ...
> It depends on what you type exactly: typing "test" with no extra
> newlines produces the result above for me. If I add newlines, I get
> "funny-looking" results with the #+END_EXAMPLE indented some.
> 
> Since it does not know a language, the buffer is in fundamental mode
> and you get (modulo funny indentation perhaps) whatever you type.
> 
> Nick

Thanks for checking.  The problem also shows up if I replace begin_example by begin_src r (say), so it's not just because Org doesn't know the language.

Also, if I start with

--------------------------------------------------
#+begin_example
#+end_example
--------------------------------------------------

and repeat the above steps (but typing C-c ' on the /first/ line), the output becomes

--------------------------------------------------
#+begin_exampl  test
  +end_example
--------------------------------------------------

Note that the last "e" of "begin_example" got dropped!

-- 
Best,
Hsiu-Khuern.

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-23 18:03 Bug: source code editing using C-c ' (org-edit-special) eats characters Hsiu-Khuern Tang
  2012-10-23 20:07 ` Myles English
  2012-10-23 20:31 ` Nick Dokos
@ 2012-10-25  8:53 ` Bastien
  2012-10-30 17:20   ` Hsiu-Khuern Tang
  2012-11-07 13:38   ` Andy Moreton
  2 siblings, 2 replies; 13+ messages in thread
From: Bastien @ 2012-10-25  8:53 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: orgmode

Hi Hsiu-Khuern,

Hsiu-Khuern Tang <tangoh@gmail.com> writes:

> Sorry if this has been reported -- a brief search didn't turn up
> anything.

this is now fixed -- thanks for reporting this!

Best,

-- 
 Bastien

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-25  8:53 ` Bastien
@ 2012-10-30 17:20   ` Hsiu-Khuern Tang
  2012-11-07 13:38   ` Andy Moreton
  1 sibling, 0 replies; 13+ messages in thread
From: Hsiu-Khuern Tang @ 2012-10-30 17:20 UTC (permalink / raw)
  To: Bastien; +Cc: orgmode

Hi Bastien,

* On Thu 10:53AM, 25 Oct 2012, Bastien (bzg@altern.org) wrote:
> Hsiu-Khuern Tang <tangoh@gmail.com> writes:
> 
> > Sorry if this has been reported -- a brief search didn't turn up
> > anything.
> 
> this is now fixed -- thanks for reporting this!

Thanks for working on this.  It's better than before, but there's still a problem, e.g., when I start with the three lines


#+begin_example

#+end_example


and do C-c ' on the empty line, type "test", and C-c ' again, I get

#+begin_example
  test#+end_example

If I type "test" + newline, I get

#+begin_example
  test
  #+end_example


BTW, is C-c ' on the #+begin_example or #+end_example lines supposed to work?  If I start with the two lines

#+begin_example
#+end_example

and do C-c ' on either line, type "test" (without a newline), and C-c ' again, I get

#+begin_example
  test
  +end_example

(The "#" of #+end_example gets dropped.)


-- 
Best,
Hsiu-Khuern.

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-10-25  8:53 ` Bastien
  2012-10-30 17:20   ` Hsiu-Khuern Tang
@ 2012-11-07 13:38   ` Andy Moreton
  2012-11-07 23:02     ` Eric S Fraga
  1 sibling, 1 reply; 13+ messages in thread
From: Andy Moreton @ 2012-11-07 13:38 UTC (permalink / raw)
  To: emacs-orgmode

On Thu 25 Oct 2012, Bastien wrote:

> Hi Hsiu-Khuern,
>
> Hsiu-Khuern Tang <tangoh@gmail.com> writes:
>
>> Sorry if this has been reported -- a brief search didn't turn up
>> anything.
>
> this is now fixed -- thanks for reporting this!
>
> Best,

Has this been pushed to org in emacs trunk ?

I'm seeing a similar problem in emacs trunk (r110821) where "C-c '" in
the *Org Src* buffer closes the source edit window and discards the
entire contents of the source block.

Should I raise an emacs bug for this ?

    AndyM

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-11-07 13:38   ` Andy Moreton
@ 2012-11-07 23:02     ` Eric S Fraga
  2012-11-08  3:20       ` Eric S Fraga
  2012-11-08 13:04       ` Andy Moreton
  0 siblings, 2 replies; 13+ messages in thread
From: Eric S Fraga @ 2012-11-07 23:02 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-orgmode

Andy Moreton <andrewjmoreton@gmail.com> writes:
> I'm seeing a similar problem in emacs trunk (r110821) where "C-c '" in
> the *Org Src* buffer closes the source edit window and discards the
> entire contents of the source block.
>
> Should I raise an emacs bug for this ?
>
>     AndyM

I've seen this happen recently as well, specifically where I have added
comment lines to the source, e.g. lines starting with # in sh src code
blocks.  I was in a rush to get something done so didn't stop to try to
figure out what was happening or to generate a minimal example.  I also
don't know if it's still happening -- this happened to me late last
week, IRC.  I also don't know if the problem was dependent on the
version of Emacs as I use three systems daily (long story).

I will try to repeat this and develop a repeatable test case.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-568-gc2ebee

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-11-07 23:02     ` Eric S Fraga
@ 2012-11-08  3:20       ` Eric S Fraga
  2012-11-08 13:04       ` Andy Moreton
  1 sibling, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2012-11-08  3:20 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> I will try to repeat this and develop a repeatable test case.

I have been unable to have this problem (disappearing src code blocks)
appear again.

Thanks,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-570-gc149e04a

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-11-07 23:02     ` Eric S Fraga
  2012-11-08  3:20       ` Eric S Fraga
@ 2012-11-08 13:04       ` Andy Moreton
  2012-11-08 17:27         ` Eric Schulte
  1 sibling, 1 reply; 13+ messages in thread
From: Andy Moreton @ 2012-11-08 13:04 UTC (permalink / raw)
  To: emacs-orgmode

On 07/11/2012 23:02, Eric S Fraga wrote:
> Andy Moreton <andrewjmoreton@gmail.com> writes:
>> I'm seeing a similar problem in emacs trunk (r110821) where "C-c '" in
>> the *Org Src* buffer closes the source edit window and discards the
>> entire contents of the source block.
>>
>> Should I raise an emacs bug for this ?
>>
>>     AndyM
>
> I've seen this happen recently as well, specifically where I have added
> comment lines to the source, e.g. lines starting with # in sh src code
> blocks.  I was in a rush to get something done so didn't stop to try to
> figure out what was happening or to generate a minimal example.  I also
> don't know if it's still happening -- this happened to me late last
> week, IRC.  I also don't know if the problem was dependent on the
> version of Emacs as I use three systems daily (long story).

This problem does seem difficult to reproduce consistently.
Editing this to add new source discarded all edits:

#+begin_src c
#+end_src

Changing it to use "C" made it keep the edits:

#+begin_src C
#+end_src

However after changing the source block back to using "c", the problem did not 
return.

I've seen problems more consistently with shell script blocks:

#+begin_src shell-script
#+end_src

I'll try to produce a recipe that can consistently show this problem.

     AndyM

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-11-08 13:04       ` Andy Moreton
@ 2012-11-08 17:27         ` Eric Schulte
  2012-11-09  3:19           ` Eric Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Schulte @ 2012-11-08 17:27 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-orgmode

Andy Moreton <andrewjmoreton@gmail.com> writes:

> On 07/11/2012 23:02, Eric S Fraga wrote:
>> Andy Moreton <andrewjmoreton@gmail.com> writes:
>>> I'm seeing a similar problem in emacs trunk (r110821) where "C-c '" in
>>> the *Org Src* buffer closes the source edit window and discards the
>>> entire contents of the source block.
>>>
>>> Should I raise an emacs bug for this ?
>>>
>>>     AndyM
>>
>> I've seen this happen recently as well, specifically where I have added
>> comment lines to the source, e.g. lines starting with # in sh src code
>> blocks.  I was in a rush to get something done so didn't stop to try to
>> figure out what was happening or to generate a minimal example.  I also
>> don't know if it's still happening -- this happened to me late last
>> week, IRC.  I also don't know if the problem was dependent on the
>> version of Emacs as I use three systems daily (long story).
>
> This problem does seem difficult to reproduce consistently.
> Editing this to add new source discarded all edits:
>
> #+begin_src c
> #+end_src
>
> Changing it to use "C" made it keep the edits:
>
> #+begin_src C
> #+end_src
>
> However after changing the source block back to using "c", the problem did not 
> return.
>
> I've seen problems more consistently with shell script blocks:
>
> #+begin_src shell-script
> #+end_src
>
> I'll try to produce a recipe that can consistently show this problem.
>

I have a similar and possibly related problem which I can consistently
reproduce.

In any Org-mode buffer create and enter an empty code block, I like to
do this with "<s TAB sh DOWNARROW" resulting in the following with the
cursor at C

#+begin_src sh
C
#+end_src

Then "C-'" into edit mode type "foo bar" do *not* type enter, and then
do a "C-'" again to go back to the Org-mode buffer.  You are left with
the following in the Org-mode buffer, which is not valid Org.

#+begin_src sh
  foo bar#+end_src

This is a relatively new problem which I only begun to notice in the
last month or so.

Best,

>
>      AndyM
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: Bug: source code editing using C-c ' (org-edit-special) eats characters
  2012-11-08 17:27         ` Eric Schulte
@ 2012-11-09  3:19           ` Eric Fraga
  0 siblings, 0 replies; 13+ messages in thread
From: Eric Fraga @ 2012-11-09  3:19 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode, Andy Moreton

Eric Schulte <schulte.eric@gmail.com> writes:

[...]

> In any Org-mode buffer create and enter an empty code block, I like to
> do this with "<s TAB sh DOWNARROW" resulting in the following with the
> cursor at C
>
> #+begin_src sh
> C
> #+end_src
>
> Then "C-'" into edit mode type "foo bar" do *not* type enter, and then
> do a "C-'" again to go back to the Org-mode buffer.  You are left with
> the following in the Org-mode buffer, which is not valid Org.
>
> #+begin_src sh
>   foo bar#+end_src
>
> This is a relatively new problem which I only begun to notice in the
> last month or so.

I was hit by this the other day.  Not a serious issue but it hadn't
happened to me before.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-561-g6e31cf

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

end of thread, other threads:[~2012-11-09  3:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-23 18:03 Bug: source code editing using C-c ' (org-edit-special) eats characters Hsiu-Khuern Tang
2012-10-23 20:07 ` Myles English
2012-10-23 20:31 ` Nick Dokos
2012-10-23 21:04   ` myles english
2012-10-23 21:16   ` Hsiu-Khuern Tang
2012-10-25  8:53 ` Bastien
2012-10-30 17:20   ` Hsiu-Khuern Tang
2012-11-07 13:38   ` Andy Moreton
2012-11-07 23:02     ` Eric S Fraga
2012-11-08  3:20       ` Eric S Fraga
2012-11-08 13:04       ` Andy Moreton
2012-11-08 17:27         ` Eric Schulte
2012-11-09  3:19           ` Eric Fraga

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