all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bizarre C-c ' error
@ 2015-10-21 15:25 Lawrence Bottorff
  2015-10-22  1:06 ` John Kitchin
  0 siblings, 1 reply; 2+ messages in thread
From: Lawrence Bottorff @ 2015-10-21 15:25 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]

I found this bizarre thing while doing some babel coding. I start by
putting this template together

#+name: leibniz_3
#+begin_src lisp :session :exports code :results silent

#+end_src

Then from this page
<ftp://ftp.cs.washington.edu/homes/tanimoto/ai/LEIBNIZ.CL> I copy this code
(some 40 lines down)

. . .
  (push (make-rule :goal (first r)
                   :pattern (second r)
                   :action (third r)
                   :name (fourth r))
        *rules*) )

into a C-c ' buffer. But when I return to my org buffer (with an additional
C-c '), it has done this:

#+name: leibtest
#+begin_src lisp :session :exports code :results silent
  (push (make-rule :goal (first r)
                   :pattern (second r)
                   :action (third r)
                   :name (fourth r))
        ,*rules*) )
#+end_src

Can you spot the difference? Subtle bug as it is, the code now has a comma
thrown in on the last line. At first I thought this was some copying crud
-- for example, if I simply highlight my code directly off this email (in
Chrome/gmail) and try to XWinows-paste (middle wheel mouse click) it in, it
throws in weird white-space crud -- but no, this comma add thing is only
from doing a C-c ' round trip! And no, it's not an issue of how I put in
the code: copy or type -- into the original org buffer or into the C-c '
buffer. Again, just a C-c ' round trip throws in this comma. Odd
coincidence, but this might have been legitimate CL code, except the list
needs a backquote too. This has been a hair-pulling, all-time-top-ten bug,
to be sure. And diff shows only this problem on the whole LEIBNIZ.CL file.
Any ideas what's causing this?

Lb

[-- Attachment #2: Type: text/html, Size: 2227 bytes --]

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

* Re: Bizarre C-c ' error
  2015-10-21 15:25 Bizarre C-c ' error Lawrence Bottorff
@ 2015-10-22  1:06 ` John Kitchin
  0 siblings, 0 replies; 2+ messages in thread
From: John Kitchin @ 2015-10-22  1:06 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist

I think that is normal. The comma is some way that org escapes the * so
it cannot be mistaken for a headline. The comma should have no effect on
running the code with C-c C-c, and it should go away when you run C-c ' in the
src-block, and reappear when you exit that. If you get rid of the
leading *, the comma will disappear.

Is there an actual problem running the code?

Lawrence Bottorff writes:

> I found this bizarre thing while doing some babel coding. I start by
> putting this template together
>
> #+name: leibniz_3
> #+begin_src lisp :session :exports code :results silent
>
> #+end_src
>
> Then from this page
> <ftp://ftp.cs.washington.edu/homes/tanimoto/ai/LEIBNIZ.CL> I copy this code
> (some 40 lines down)
>
> . . .
>   (push (make-rule :goal (first r)
>                    :pattern (second r)
>                    :action (third r)
>                    :name (fourth r))
>         *rules*) )
>
> into a C-c ' buffer. But when I return to my org buffer (with an additional
> C-c '), it has done this:
>
> #+name: leibtest
> #+begin_src lisp :session :exports code :results silent
>   (push (make-rule :goal (first r)
>                    :pattern (second r)
>                    :action (third r)
>                    :name (fourth r))
>         ,*rules*) )
> #+end_src
>
> Can you spot the difference? Subtle bug as it is, the code now has a comma
> thrown in on the last line. At first I thought this was some copying crud
> -- for example, if I simply highlight my code directly off this email (in
> Chrome/gmail) and try to XWinows-paste (middle wheel mouse click) it in, it
> throws in weird white-space crud -- but no, this comma add thing is only
> from doing a C-c ' round trip! And no, it's not an issue of how I put in
> the code: copy or type -- into the original org buffer or into the C-c '
> buffer. Again, just a C-c ' round trip throws in this comma. Odd
> coincidence, but this might have been legitimate CL code, except the list
> needs a backquote too. This has been a hair-pulling, all-time-top-ten bug,
> to be sure. And diff shows only this problem on the whole LEIBNIZ.CL file.
> Any ideas what's causing this?
>
> Lb

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

end of thread, other threads:[~2015-10-22  1:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 15:25 Bizarre C-c ' error Lawrence Bottorff
2015-10-22  1:06 ` John Kitchin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.