all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: inline code block problem; first attempt
       [not found] <f70128ed2c794b438fd330d1ca7b0369@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-06-08 18:36 ` Eric S Fraga
  2016-06-08 19:47   ` Charles Millar
  2016-06-08 19:56   ` Charles C. Berry
  0 siblings, 2 replies; 8+ messages in thread
From: Eric S Fraga @ 2016-06-08 18:36 UTC (permalink / raw)
  To: Charles Millar; +Cc: emacs-orgmode@gnu.org

Can you please post a complete example so that others can try it?  Also,
what version of org etc.?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421

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

* Re: inline code block problem; first attempt
  2016-06-08 18:36 ` inline code block problem; first attempt Eric S Fraga
@ 2016-06-08 19:47   ` Charles Millar
  2016-06-08 19:56   ` Charles C. Berry
  1 sibling, 0 replies; 8+ messages in thread
From: Charles Millar @ 2016-06-08 19:47 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

I am getting careless.


On 06/08/2016 02:36 PM, Eric S Fraga wrote:
> Can you please post a complete example so that others can try it?  Also,
> what version of org etc.?
>
sample.org file

* TOTALCOM                               :ignoreheading:

#+NAME: TOTALCOM
#+ATTR_LATEX: :mode table :environment longtable :align p{415pt}N{8}{2}
| {{{cmhfill}}} Total commissions due | 99990.00 |


#+begin_src emacs-lisp :var totalcommissions=TOTALCOM[-1,-1]
totalcommissions
#+end_src

#+RESULTS:
: 99990.0

Inline version src_emacs-lisp[:var 
totalcommissions=TOTALCOM[-1,-1]]{totalcommissions}

GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 
2015-03-07 on trouble, modified by Debian

Org-mode version 8.3.4 (release_8.3.4-894-gf94df5 @ 
/usr/local/share/emacs/site-lisp/org-mode/lisp/)

Charlie

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

* Re: inline code block problem; first attempt
  2016-06-08 18:36 ` inline code block problem; first attempt Eric S Fraga
  2016-06-08 19:47   ` Charles Millar
@ 2016-06-08 19:56   ` Charles C. Berry
  2016-06-09  2:43     ` [PATCH} " Charles C. Berry
  1 sibling, 1 reply; 8+ messages in thread
From: Charles C. Berry @ 2016-06-08 19:56 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode@gnu.org, Charles Millar

On Wed, 8 Jun 2016, Eric S Fraga wrote:

> Can you please post a complete example so that others can try it?  Also,
> what version of org etc.?

A bug in `org-element-inline-src-block-parser', I think.

Here is an ECM:

src_emacs-lisp[:var totalcommissions=TOTALCOM]{totalcommissions}
src_emacs-lisp[:var totalcommissions=TOTALCOM[-1,-1]]{totalcommissions}
#+BEGIN_SRC emacs-lisp
     (save-excursion
       (org-babel-goto-src-block-head)
       (forward-line -1)
       (list (org-element-type (org-element-inline-src-block-parser))
 	    (progn (forward-line -1)
 		       (org-element-type
                          (org-element-inline-src-block-parser)))))

#+END_SRC

#+RESULTS:
| nil | inline-src-block |


Chuck

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

* [PATCH} Re: inline code block problem; first attempt
  2016-06-08 19:56   ` Charles C. Berry
@ 2016-06-09  2:43     ` Charles C. Berry
  2016-06-09 11:41       ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Charles C. Berry @ 2016-06-09  2:43 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode@gnu.org, Charles Millar

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



Patch atteched.

Replaced ']' with '{' in the regex `header' group.

Comments?

Chuck

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1102 bytes --]

From 2a060d4ca51dabbc6931a1483ae6c0ac29e0586c Mon Sep 17 00:00:00 2001
From: Charles Berry <ccberry@ucsd.edu>
Date: Wed, 8 Jun 2016 19:36:30 -0700
Subject: [PATCH] org-element-inline-src-block-parser fix regexp

* org-element.el (org-element-inline-src-block-parser): Header may
  include `[' and `]', but not `{'. This allows tables to be indexed
  in :var arguments.

Reported by: Charles Millar
http://article.gmane.org/gmane.emacs.orgmode/107624
---
 lisp/org-element.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 8745ef3..d47f6f0 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2916,7 +2916,7 @@ Assume point is at the beginning of the inline src block."
     (catch :no-object
       (when (let ((case-fold-search nil))
 	      (looking-at "\\<src_\\([^ \t\n[{]+\\)\
-\\(?:\\[[ \t]*\\([^]]*?\\)[ \t]*\\]\\)?{"))
+\\(?:\\[[ \t]*\\([^{]*?\\)[ \t]*\\]\\)?{"))
 	(let ((begin (point))
 	      (language (match-string-no-properties 1))
 	      (parameters
-- 
2.6.4 (Apple Git-63)


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

* Re: [PATCH} Re: inline code block problem; first attempt
  2016-06-09  2:43     ` [PATCH} " Charles C. Berry
@ 2016-06-09 11:41       ` Nicolas Goaziou
  2016-06-09 16:04         ` Charles C. Berry
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2016-06-09 11:41 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: Charles Millar, emacs-orgmode@gnu.org

Hello,

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> Patch atteched.
>
> Replaced ']' with '{' in the regex `header' group.
>
> Comments?

Thank you for the patch. This is better than what we have now. However,
I don't think this is the way to go.

Forbidding "{" is already a minor annoyance, but porting the same logic
to `org-element-inline-babel-call-parser', which suffers from the same
bug, means forbidding "(" ; this is a major one.

I'd rather do the same as the body part and allow "[" (and "{"
obviously), as long as they are paired. This is less restrictive, IMO,
even acceptable in the case of "(".

I also started a fix along those lines yesterday but didn't get time to
finish it yet.

WDYT?

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH} Re: inline code block problem; first attempt
  2016-06-09 11:41       ` Nicolas Goaziou
@ 2016-06-09 16:04         ` Charles C. Berry
  2016-06-10 21:49           ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Charles C. Berry @ 2016-06-09 16:04 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Charles Millar, emacs-orgmode@gnu.org

On Thu, 9 Jun 2016, Nicolas Goaziou wrote:

> Hello,
>
> "Charles C. Berry" <ccberry@ucsd.edu> writes:
>
>> Patch atteched.
>>
>> Replaced ']' with '{' in the regex `header' group.
>>
>> Comments?
>
> Thank you for the patch. This is better than what we have now. However,
> I don't think this is the way to go.
>
> Forbidding "{" is already a minor annoyance, but porting the same logic
> to `org-element-inline-babel-call-parser', which suffers from the same
> bug, means forbidding "(" ; this is a major one.
>
> I'd rather do the same as the body part and allow "[" (and "{"
> obviously), as long as they are paired. This is less restrictive, IMO,
> even acceptable in the case of "(".
>

Agreed.

> I also started a fix along those lines yesterday but didn't get time to
> finish it yet.
>
> WDYT?

Sounds good.

Chuck

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

* Re: [PATCH} Re: inline code block problem; first attempt
  2016-06-09 16:04         ` Charles C. Berry
@ 2016-06-10 21:49           ` Nicolas Goaziou
  2016-06-11 11:54             ` Charles Millar
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2016-06-10 21:49 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs-orgmode@gnu.org, Charles Millar

Hello,

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> Sounds good.

Done. Thank you for the feedback.

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH} Re: inline code block problem; first attempt
  2016-06-10 21:49           ` Nicolas Goaziou
@ 2016-06-11 11:54             ` Charles Millar
  0 siblings, 0 replies; 8+ messages in thread
From: Charles Millar @ 2016-06-11 11:54 UTC (permalink / raw)
  To: emacs-orgmode

Good morning,


On 06/10/2016 05:49 PM, Nicolas Goaziou wrote:
> Hello,
>
> "Charles C. Berry" <ccberry@ucsd.edu> writes:
>
>> Sounds good.
> Done. Thank you for the feedback.
>
Thank you Nicolas and Chuck.
Works for me, now.

Charlie Millar

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

end of thread, other threads:[~2016-06-11 11:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <f70128ed2c794b438fd330d1ca7b0369@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-06-08 18:36 ` inline code block problem; first attempt Eric S Fraga
2016-06-08 19:47   ` Charles Millar
2016-06-08 19:56   ` Charles C. Berry
2016-06-09  2:43     ` [PATCH} " Charles C. Berry
2016-06-09 11:41       ` Nicolas Goaziou
2016-06-09 16:04         ` Charles C. Berry
2016-06-10 21:49           ` Nicolas Goaziou
2016-06-11 11:54             ` Charles Millar

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.