emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Support for 'using namespace *' in ob-C.el
@ 2017-07-17  5:31 Jay Kamat
  2017-07-23 14:44 ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Jay Kamat @ 2017-07-17  5:31 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi!

A problem that I came across recently was the difficulty of writing
C++ tutorials for beginners to programming in org mode. In such
tutorials, it would be ideal to keep as much boilerplate away from the
examples so they don't ask questions (until we get to those topics).

The shortest ob-C++ example available is:

#+begin_src C++ :includes <iostream>
  std::cout<<"Hello World!\n";
#+end_src

However, it would be nice to add a "using namespace std" to this
source code block, so it can become:

#+BEGIN_SRC C++ :includes <iostream> :namespaces std
  cout << "Hello world\n";
#+END_SRC

Which makes it cleaner and easier to read, especially for very short
code snippets, using a bunch of std tools.

Attached are patches for adding a :namespaces export option to C++
blocks, and a patch to documentation on worg that documents this
change.

One concern that I have is that "using namespace *;" is only available
in C++ and not C, but there isn't an easy way I could find to limit
it's usage to only C++ blocks without a bunch of restructuring, so
this will fail if you attempt to set a namespace on a plain C block.
Since it's clear that namespaces aren't part of plain C, I don't think
this is too big of a deal.

Please give this a more thorough review than usual, I'm very new to all of this!

Thanks again for creating/maintaining org mode, it's the greatest!

Also, this contribution puts me very close to the 15 line limit before
I need to get FSF papers signed. I intend to sign papers soon, but I'm
a little busy right now, and I'll get around to submitting the request
later on.

Thanks,
-Jay

PS:

I'm getting an error when I try to run:
#+BEGIN_SRC C :exports output :includes stdio.h
printf("hello world\n");
#+END_SRC
because 'stdio.h' is not surrounded by quotes. I can do <stdio.h> and
have it work fine, but how can I include quotes in the header line?
They seem to be stripped by org, and backslash ecaping them does not
work.

[-- Attachment #2: 0001-ob-C.el-Add-support-for-specifying-namespaces-in-C-C.patch --]
[-- Type: text/x-patch, Size: 1579 bytes --]

From 1e5fff1741dc853214962b7ea90b0832b4ae3e69 Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sun, 16 Jul 2017 21:55:24 -0700
Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++

* lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option
  to C++ org babel blocks. Namespaces specified here will be added to
  the file in the format 'using namespace %s;'. Multiple namespaces
  can be specified, separated by spaces.

TINYCHANGE
---
 lisp/ob-C.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 2bdda68d5..ba10833d0 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -202,9 +202,15 @@ its header arguments."
 	(defines (org-babel-read
 		  (or (cdr (assq :defines params))
 		      (org-entry-get nil "defines" t))
-		  nil)))
+		   nil))
+	(namespaces (org-babel-read
+		  (or (cdr (assq :namespaces params))
+		      (org-entry-get nil "namespaces" t))
+		   nil)))
     (when (stringp includes)
       (setq includes (split-string includes)))
+    (when (stringp namespaces)
+      (setq namespaces (split-string namespaces)))
     (when (stringp defines)
       (let ((y nil)
 	    (result (list t)))
@@ -224,6 +230,10 @@ its header arguments."
 		(mapconcat
 		 (lambda (inc) (format "#define %s" inc))
 		 (if (listp defines) defines (list defines)) "\n")
+		;; namespaces
+		(mapconcat
+		 (lambda (inc) (format "using namespace %s;" inc))
+		 namespaces "\n")
 		;; variables
 		(mapconcat 'org-babel-C-var-to-C vars "\n")
 		;; table sizes
-- 
2.11.0


[-- Attachment #3: 0001-Add-documentation-for-ob-C-namespaces.patch --]
[-- Type: text/x-patch, Size: 1153 bytes --]

From 3267aeac0b90c76f5091104e13389ce6050dd580 Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sun, 16 Jul 2017 22:09:06 -0700
Subject: [PATCH] Add documentation for ob-C :namespaces

---
 org-contrib/babel/languages/ob-doc-C.org | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-contrib/babel/languages/ob-doc-C.org b/org-contrib/babel/languages/ob-doc-C.org
index b1aac99b..faf2b77f 100644
--- a/org-contrib/babel/languages/ob-doc-C.org
+++ b/org-contrib/babel/languages/ob-doc-C.org
@@ -66,7 +66,7 @@ the results of evaluation inserted into the buffer.
 :   int b=1;
 :   printf("%d\n", a+b);
 : #+end_src
-: 
+:
 : #+results:
 : : 2
 
@@ -154,6 +154,11 @@ It features:
      (C & C++ only) just like =:includes= but for =#defines= lines at the
      top of the code.
 
+- =:namespaces= ::
+     (C++ only)
+     accepts either a single name, or a list of names of namespaces to use.
+     The final format will look like this: =using namespace name;=
+
 - =:libs= ::
      (C & C++ only) useful for linking with a library, may be given
      =-L/path/to/lib= and =-llibrary= instructions.
-- 
2.11.0


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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-07-17  5:31 [PATCH] Support for 'using namespace *' in ob-C.el Jay Kamat
@ 2017-07-23 14:44 ` Nicolas Goaziou
  2017-07-31  8:03   ` Jay Kamat
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2017-07-23 14:44 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode

Hello,

Jay Kamat <jaygkamat@gmail.com> writes:

> However, it would be nice to add a "using namespace std" to this
> source code block, so it can become:
>
> #+BEGIN_SRC C++ :includes <iostream> :namespaces std
>   cout << "Hello world\n";
> #+END_SRC
>
>
> Which makes it cleaner and easier to read, especially for very short
> code snippets, using a bunch of std tools.

Good idea.

> One concern that I have is that "using namespace *;" is only available
> in C++ and not C, but there isn't an easy way I could find to limit
> it's usage to only C++ blocks without a bunch of restructuring, so
> this will fail if you attempt to set a namespace on a plain C block.

I suggest to add the following to "ob-C.el" so that `org-lint' can issue
a warning whenever :namespaces is used in a C block.

  (defconst org-babel-header-args:C '((includes . :any))
    "C-specific header arguments.")

  (defconst org-babel-header-args:C++
    `(,(append '((namespaces . :any))
  	     org-babel-header-args:C))
    "C++-specific header arguments.")

> Also, this contribution puts me very close to the 15 line limit before
> I need to get FSF papers signed. I intend to sign papers soon, but I'm
> a little busy right now, and I'll get around to submitting the request
> later on.

Thank you. FYI, in many cases, the whole process is very quick and not
time-consuming.

> Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++
>
> * lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option
>   to C++ org babel blocks. Namespaces specified here will be added to
>   the file in the format 'using namespace %s;'. Multiple namespaces
>   can be specified, separated by spaces.

Some comments follow.

> +	(namespaces (org-babel-read
> +		  (or (cdr (assq :namespaces params))
> +		      (org-entry-get nil "namespaces" t))
> +		   nil)))

Using `org-entry-get' is no longer supported. You can replace the `or'
with

  (cdr (assq :namespaces params))

> +		;; namespaces
> +		(mapconcat
> +		 (lambda (inc) (format "using namespace %s;" inc))
> +		 namespaces "\n")

Nitpick: I would put the "\n" on another line.

Could you also provide an ORG-NEWS entry for the feature?

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-07-23 14:44 ` Nicolas Goaziou
@ 2017-07-31  8:03   ` Jay Kamat
  2017-07-31 15:34     ` Charles C. Berry
  2017-08-01  8:22     ` Nicolas Goaziou
  0 siblings, 2 replies; 10+ messages in thread
From: Jay Kamat @ 2017-07-31  8:03 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

Hello!

Sorry for the late reply, I was pretty busy last week. An updated
patch is attached!

> I suggest to add the following to "ob-C.el" so that `org-lint' can issue
> a warning whenever :namespaces is used in a C block.

Done. I needed to tweak the code a bit though to get it to work and to
prevent flagging valid C headers as errors with org lint.

> Using `org-entry-get' is no longer supported. You can replace the `or'
> with
>
>   (cdr (assq :namespaces params))

Done, I also replaced the other uses of 'org-entry-get' around the one
I modified

> Nitpick: I would put the "\n" on another line.

I agree, and done :)

> Could you also provide an ORG-NEWS entry for the feature?

Done. I'm not sure if it went in the right place and if it's formatted
correctly though, so can you give that a look over to make sure it
looks good?

Thanks again for taking the time to review this for me :D

Let me know if you spot anything fishy or wrong.

Also, RE: Copyright, this is the form I need to send, correct?
http://orgmode.org/request-assign-future.txt

-Jay


On Sun, Jul 23, 2017 at 7:44 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Jay Kamat <jaygkamat@gmail.com> writes:
>
>> However, it would be nice to add a "using namespace std" to this
>> source code block, so it can become:
>>
>> #+BEGIN_SRC C++ :includes <iostream> :namespaces std
>>   cout << "Hello world\n";
>> #+END_SRC
>>
>>
>> Which makes it cleaner and easier to read, especially for very short
>> code snippets, using a bunch of std tools.
>
> Good idea.
>
>> One concern that I have is that "using namespace *;" is only available
>> in C++ and not C, but there isn't an easy way I could find to limit
>> it's usage to only C++ blocks without a bunch of restructuring, so
>> this will fail if you attempt to set a namespace on a plain C block.
>
> I suggest to add the following to "ob-C.el" so that `org-lint' can issue
> a warning whenever :namespaces is used in a C block.
>
>   (defconst org-babel-header-args:C '((includes . :any))
>     "C-specific header arguments.")
>
>   (defconst org-babel-header-args:C++
>     `(,(append '((namespaces . :any))
>              org-babel-header-args:C))
>     "C++-specific header arguments.")
>
>> Also, this contribution puts me very close to the 15 line limit before
>> I need to get FSF papers signed. I intend to sign papers soon, but I'm
>> a little busy right now, and I'll get around to submitting the request
>> later on.
>
> Thank you. FYI, in many cases, the whole process is very quick and not
> time-consuming.
>
>> Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++
>>
>> * lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option
>>   to C++ org babel blocks. Namespaces specified here will be added to
>>   the file in the format 'using namespace %s;'. Multiple namespaces
>>   can be specified, separated by spaces.
>
> Some comments follow.
>
>> +     (namespaces (org-babel-read
>> +               (or (cdr (assq :namespaces params))
>> +                   (org-entry-get nil "namespaces" t))
>> +                nil)))
>
> Using `org-entry-get' is no longer supported. You can replace the `or'
> with
>
>   (cdr (assq :namespaces params))
>
>> +             ;; namespaces
>> +             (mapconcat
>> +              (lambda (inc) (format "using namespace %s;" inc))
>> +              namespaces "\n")
>
> Nitpick: I would put the "\n" on another line.
>
> Could you also provide an ORG-NEWS entry for the feature?
>
> Regards,
>
> --
> Nicolas Goaziou

[-- Attachment #2: 0001-ob-C.el-Add-support-for-specifying-namespaces-in-C-C.patch --]
[-- Type: text/x-patch, Size: 3492 bytes --]

From bf08fb4f89024428a95615bdfede86e3c883d87c Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sun, 16 Jul 2017 21:55:24 -0700
Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++

* lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option
  to C++ org babel blocks. Namespaces specified here will be added to
  the file in the format 'using namespace %s;'. Multiple namespaces
  can be specified, separated by spaces.

TINYCHANGE
---
 etc/ORG-NEWS | 14 ++++++++++++++
 lisp/ob-C.el | 34 ++++++++++++++++++++++++++++------
 2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 936ecc36b2..1d08f9ba9d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -200,6 +200,20 @@ To use =vertica= in an sql =SRC_BLK= set the =:engine= like this:
   SELECT * FROM nodes;
   ,#+END_SRC
 #+END_EXAMPLE
+**** C++: New header ~:namespaces~
+
+The new ~:namespaces~ export option can be used to specify namespaces
+to be used within a C++ org source block.  Its usage is similar to
+~:includes~, in that it can accept multiple, space-separated
+namespaces to use.  This header is equivalent to adding ~using
+namespace <name>;~ in the source block. Here is a "Hello World" in C++
+using ~:namespaces~:
+
+#+begin_example
+  ,#+BEGIN_SRC C++ :results output :namespaces std :includes <iostream>
+    cout << "Hello World" << endl;
+  ,#+END_SRC
+#+end_example
 
 *** New ~function~ scope argument for the Clock Table
 Added a nullary function that returns a list of files as a possible
diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 2bdda68d58..ccd150eac9 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -46,6 +46,20 @@
 
 (defvar org-babel-default-header-args:C '())
 
+;; org lint header arguments for C and C++
+(defconst org-babel-header-args:C '((includes . :any)
+				     (defines . :any)
+				     (main    . :any)
+				     (flags   . :any)
+				     (cmdline . :any)
+				     (libs    . :any))
+  "C/C++-specific header arguments.")
+
+(defconst org-babel-header-args:C++
+  (append '((namespaces . :any))
+    org-babel-header-args:C)
+  "C++-specific header arguments.")
+
 (defcustom org-babel-C-compiler "gcc"
   "Command used to compile a C source code file into an executable.
 May be either a command in the path, like gcc
@@ -196,15 +210,18 @@ its header arguments."
 	(colnames (cdr (assq :colname-names params)))
 	(main-p (not (string= (cdr (assq :main params)) "no")))
 	(includes (org-babel-read
-		   (or (cdr (assq :includes params))
-		       (org-entry-get nil "includes" t))
-		   nil))
+		    (cdr (assq :includes params))
+		    nil))
 	(defines (org-babel-read
-		  (or (cdr (assq :defines params))
-		      (org-entry-get nil "defines" t))
-		  nil)))
+		   (cdr (assq :defines params))
+		   nil))
+	(namespaces (org-babel-read
+		      (cdr (assq :namespaces params))
+		      nil)))
     (when (stringp includes)
       (setq includes (split-string includes)))
+    (when (stringp namespaces)
+      (setq namespaces (split-string namespaces)))
     (when (stringp defines)
       (let ((y nil)
 	    (result (list t)))
@@ -224,6 +241,11 @@ its header arguments."
 		(mapconcat
 		 (lambda (inc) (format "#define %s" inc))
 		 (if (listp defines) defines (list defines)) "\n")
+		;; namespaces
+		(mapconcat
+		 (lambda (inc) (format "using namespace %s;" inc))
+		 namespaces
+		 "\n")
 		;; variables
 		(mapconcat 'org-babel-C-var-to-C vars "\n")
 		;; table sizes
-- 
2.11.0


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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-07-31  8:03   ` Jay Kamat
@ 2017-07-31 15:34     ` Charles C. Berry
  2017-08-01  5:54       ` Jay Kamat
  2017-08-01  8:22     ` Nicolas Goaziou
  1 sibling, 1 reply; 10+ messages in thread
From: Charles C. Berry @ 2017-07-31 15:34 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode, Nicolas Goaziou

On Mon, 31 Jul 2017, Jay Kamat wrote:

> Hello!
>
> Sorry for the late reply, I was pretty busy last week. An updated
> patch is attached!
>

[snip]

>
>> Using `org-entry-get' is no longer supported. You can replace the `or'
>> with
>>
>>   (cdr (assq :namespaces params))
>
> Done, I also replaced the other uses of 'org-entry-get' around the one
> I modified
>

I don't think Nicolas meant that `org-entry-get' is no longer supported 
literally. I think he was referring to using it to enable using Babel 
header arguments as property names (as it did in your code). See:

 	http://orgmode.org/Changes.html#org343de47


HTH,

Chuck

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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-07-31 15:34     ` Charles C. Berry
@ 2017-08-01  5:54       ` Jay Kamat
  2017-08-01 16:48         ` Nicolas Goaziou
  2017-08-01 16:48         ` Nicolas Goaziou
  0 siblings, 2 replies; 10+ messages in thread
From: Jay Kamat @ 2017-08-01  5:54 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs-orgmode, Nicolas Goaziou

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

Hi Chuck,

Thanks for pointing that out, this all makes a lot more sense now.
Prior to this patch ':includes' and ':defines' seem to work in the
property list (as described in the old version of the org manual), so
(I think) the updated version of this patch also removes those usages
(for :defines, :includes), so you must use the new format described in
the manual.

Speaking of the manual, that entry managed to get me very confused at
first, as it didn't seem to work for me, but then I realized that
there is actually a typo in the NEWS entry, the second line should be:

:header-args+: :var a=1 b=2

I'm not sure what the policy is on changing old NEWS entries, but I've
attached a small patch to fix the typo.

Let me know if  you have any other feedback! :)

-Jay


On Mon, Jul 31, 2017 at 8:34 AM, Charles C. Berry <ccberry@ucsd.edu> wrote:
> On Mon, 31 Jul 2017, Jay Kamat wrote:
>
>> Hello!
>>
>> Sorry for the late reply, I was pretty busy last week. An updated
>> patch is attached!
>>
>
> [snip]
>
>>
>>> Using `org-entry-get' is no longer supported. You can replace the `or'
>>> with
>>>
>>>   (cdr (assq :namespaces params))
>>
>>
>> Done, I also replaced the other uses of 'org-entry-get' around the one
>> I modified
>>
>
> I don't think Nicolas meant that `org-entry-get' is no longer supported
> literally. I think he was referring to using it to enable using Babel header
> arguments as property names (as it did in your code). See:
>
>         http://orgmode.org/Changes.html#org343de47
>
>
> HTH,
>
> Chuck

[-- Attachment #2: 0001-ORG-NEWS-Fix-a-small-typo-in-new-org-babel-header-ex.patch --]
[-- Type: text/x-patch, Size: 709 bytes --]

From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Mon, 31 Jul 2017 22:47:33 -0700
Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example

* etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion

TINYCHANGE
---
 etc/ORG-NEWS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index d7bd3e2ce7..5acaf7ee52 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -582,7 +582,7 @@ should be written instead
 ,* Headline
 :PROPERTIES:
 :header-args: :exports code
-:header-args: :var a=1 b=2
+:header-args+: :var a=1 b=2
 :header-args+: :var c=3
 :END:
 #+END_EXAMPLE
-- 
2.11.0


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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-07-31  8:03   ` Jay Kamat
  2017-07-31 15:34     ` Charles C. Berry
@ 2017-08-01  8:22     ` Nicolas Goaziou
  1 sibling, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2017-08-01  8:22 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode

Hello,

Jay Kamat <jaygkamat@gmail.com> writes:

> Let me know if you spot anything fishy or wrong.

It's good, thank you. I applied your patch.
>
> Also, RE: Copyright, this is the form I need to send, correct?
> http://orgmode.org/request-assign-future.txt

It is. Please let me know when the process is done.

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-08-01  5:54       ` Jay Kamat
@ 2017-08-01 16:48         ` Nicolas Goaziou
  2017-08-01 16:48         ` Nicolas Goaziou
  1 sibling, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2017-08-01 16:48 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode, Charles C. Berry

Jay Kamat <jaygkamat@gmail.com> writes:

> Hi Chuck,
>
> Thanks for pointing that out, this all makes a lot more sense now.
> Prior to this patch ':includes' and ':defines' seem to work in the
> property list (as described in the old version of the org manual), so
> (I think) the updated version of this patch also removes those usages
> (for :defines, :includes), so you must use the new format described in
> the manual.
>
> Speaking of the manual, that entry managed to get me very confused at
> first, as it didn't seem to work for me, but then I realized that
> there is actually a typo in the NEWS entry, the second line should be:
>
> :header-args+: :var a=1 b=2
>
> I'm not sure what the policy is on changing old NEWS entries, but I've
> attached a small patch to fix the typo.
>
> Let me know if  you have any other feedback! :)
>
> -Jay
>
>
> On Mon, Jul 31, 2017 at 8:34 AM, Charles C. Berry <ccberry@ucsd.edu> wrote:
>> On Mon, 31 Jul 2017, Jay Kamat wrote:
>>
>>> Hello!
>>>
>>> Sorry for the late reply, I was pretty busy last week. An updated
>>> patch is attached!
>>>
>>
>> [snip]
>>
>>>
>>>> Using `org-entry-get' is no longer supported. You can replace the `or'
>>>> with
>>>>
>>>>   (cdr (assq :namespaces params))
>>>
>>>
>>> Done, I also replaced the other uses of 'org-entry-get' around the one
>>> I modified
>>>
>>
>> I don't think Nicolas meant that `org-entry-get' is no longer supported
>> literally. I think he was referring to using it to enable using Babel header
>> arguments as property names (as it did in your code). See:
>>
>>         http://orgmode.org/Changes.html#org343de47
>>
>>
>> HTH,
>>
>> Chuck
>
>

-- 
Nicolas Goaziou

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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-08-01  5:54       ` Jay Kamat
  2017-08-01 16:48         ` Nicolas Goaziou
@ 2017-08-01 16:48         ` Nicolas Goaziou
  2017-08-02  1:40           ` Jay Kamat
  1 sibling, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2017-08-01 16:48 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode, Charles C. Berry

Hello,

Jay Kamat <jaygkamat@gmail.com> writes:

> From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001
> From: Jay Kamat <jaygkamat@gmail.com>
> Date: Mon, 31 Jul 2017 22:47:33 -0700
> Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example
>
> * etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion
>
> TINYCHANGE

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou

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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-08-01 16:48         ` Nicolas Goaziou
@ 2017-08-02  1:40           ` Jay Kamat
  2017-08-02  6:49             ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Jay Kamat @ 2017-08-02  1:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

Hi Nicolas,

Sorry for bumping this, but could you apply the patch I made to update
worg for documentation as well (or provide feedback)? I'd like that to
stay updated as well if possible.

If there's another mailing list for worg let me know and I'll post it there.

The patch is re-attached for convenience.

-Jay

On Tue, Aug 1, 2017 at 9:48 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Jay Kamat <jaygkamat@gmail.com> writes:
>
>> From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001
>> From: Jay Kamat <jaygkamat@gmail.com>
>> Date: Mon, 31 Jul 2017 22:47:33 -0700
>> Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example
>>
>> * etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion
>>
>> TINYCHANGE
>
> Applied. Thank you.
>
> Regards,
> --
> Nicolas Goaziou

[-- Attachment #2: 0001-Add-documentation-for-ob-C-namespaces.patch --]
[-- Type: application/octet-stream, Size: 1153 bytes --]

From 3267aeac0b90c76f5091104e13389ce6050dd580 Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sun, 16 Jul 2017 22:09:06 -0700
Subject: [PATCH] Add documentation for ob-C :namespaces

---
 org-contrib/babel/languages/ob-doc-C.org | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-contrib/babel/languages/ob-doc-C.org b/org-contrib/babel/languages/ob-doc-C.org
index b1aac99b..faf2b77f 100644
--- a/org-contrib/babel/languages/ob-doc-C.org
+++ b/org-contrib/babel/languages/ob-doc-C.org
@@ -66,7 +66,7 @@ the results of evaluation inserted into the buffer.
 :   int b=1;
 :   printf("%d\n", a+b);
 : #+end_src
-: 
+:
 : #+results:
 : : 2
 
@@ -154,6 +154,11 @@ It features:
      (C & C++ only) just like =:includes= but for =#defines= lines at the
      top of the code.
 
+- =:namespaces= ::
+     (C++ only)
+     accepts either a single name, or a list of names of namespaces to use.
+     The final format will look like this: =using namespace name;=
+
 - =:libs= ::
      (C & C++ only) useful for linking with a library, may be given
      =-L/path/to/lib= and =-llibrary= instructions.
-- 
2.11.0


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

* Re: [PATCH] Support for 'using namespace *' in ob-C.el
  2017-08-02  1:40           ` Jay Kamat
@ 2017-08-02  6:49             ` Nicolas Goaziou
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2017-08-02  6:49 UTC (permalink / raw)
  To: Jay Kamat; +Cc: emacs-orgmode

Hello,

Jay Kamat <jaygkamat@gmail.com> writes:

> Sorry for bumping this, but could you apply the patch I made to update
> worg for documentation as well (or provide feedback)? I'd like that to
> stay updated as well if possible.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-08-02  6:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17  5:31 [PATCH] Support for 'using namespace *' in ob-C.el Jay Kamat
2017-07-23 14:44 ` Nicolas Goaziou
2017-07-31  8:03   ` Jay Kamat
2017-07-31 15:34     ` Charles C. Berry
2017-08-01  5:54       ` Jay Kamat
2017-08-01 16:48         ` Nicolas Goaziou
2017-08-01 16:48         ` Nicolas Goaziou
2017-08-02  1:40           ` Jay Kamat
2017-08-02  6:49             ` Nicolas Goaziou
2017-08-01  8:22     ` Nicolas Goaziou

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