emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] small patch (inline src blocks cannot start at bol)
@ 2011-08-29 21:21 Nicolas Goaziou
  2011-08-29 22:17 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Goaziou @ 2011-08-29 21:21 UTC (permalink / raw)
  To: Org Mode List

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

Hello,

For now inline src blocks cannot start at bol. In the following example,
only the first inline block is recognized.

This src_emacs-lisp{(1+ 1)} is ok.

src_emacs-lisp{"This"} isn't.

The small following patch should fix that.

Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ob-allow-inline-src-blocks-to-start-at-bol.patch --]
[-- Type: text/x-patch, Size: 845 bytes --]

From 98ec0a9d86f1b4f35be0530e2d8afb97861a91c0 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Mon, 29 Aug 2011 23:13:40 +0200
Subject: [PATCH] ob: allow inline src blocks to start at bol

* lisp/ob.el (org-babel-inline-src-block-regexp): Allow regexp to
  start at bol.
---
 lisp/ob.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 5d91ac3..9d80056 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -143,7 +143,7 @@ remove code block execution from the C-c C-c keybinding."
 (defvar org-babel-inline-src-block-regexp
   (concat
    ;; (1) replacement target (2) lang
-   "[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)"
+   "\\(?:^\\|[^-[:alnum:]]\\)\\(src_\\([^ \f\t\n\r\v]+\\)"
    ;; (3,4) (unused, headers)
    "\\(\\|\\[\\(.*?\\)\\]\\)"
    ;; (5) body
-- 
1.7.6.1


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

* Re: [babel] small patch (inline src blocks cannot start at bol)
  2011-08-29 21:21 [babel] small patch (inline src blocks cannot start at bol) Nicolas Goaziou
@ 2011-08-29 22:17 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-08-29 22:17 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> For now inline src blocks cannot start at bol. In the following example,
> only the first inline block is recognized.
>
> This src_emacs-lisp{(1+ 1)} is ok.
>
> src_emacs-lisp{"This"} isn't.
>
> The small following patch should fix that.
>

I've just applied this along with a test case which should ensure that
this functionality is maintained.

Thanks! -- Eric

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

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

end of thread, other threads:[~2011-08-29 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29 21:21 [babel] small patch (inline src blocks cannot start at bol) Nicolas Goaziou
2011-08-29 22:17 ` Eric Schulte

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