emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automagically send all org table
@ 2013-01-14 10:25 Xavier Garrido
  2013-01-14 12:24 ` Suvayu Ali
  2013-01-14 12:56 ` Carsten Dominik
  0 siblings, 2 replies; 8+ messages in thread
From: Xavier Garrido @ 2013-01-14 10:25 UTC (permalink / raw)
  To: emacs-orgmode

Hi orgmoders,

I am looking for a simple way to SEND all org tables in a given document 
to their RECEIVER counterparts. Of course, I can go through the whole 
document and do `org-table-send` one-by-one but I would like to do it 
without opening the document and for all tables at the same time. Is 
there a way ?

Thanks for your help and advices,
Xavier

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

* Re: Automagically send all org table
  2013-01-14 10:25 Automagically send all org table Xavier Garrido
@ 2013-01-14 12:24 ` Suvayu Ali
  2013-01-14 13:03   ` Jambunathan K
  2013-01-14 12:56 ` Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2013-01-14 12:24 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Jan 14, 2013 at 11:25:27AM +0100, Xavier Garrido wrote:
> Hi orgmoders,
> 
> I am looking for a simple way to SEND all org tables in a given document to
> their RECEIVER counterparts. Of course, I can go through the whole document
> and do `org-table-send` one-by-one but I would like to do it without opening
> the document and for all tables at the same time. Is there a way ?
> 
> Thanks for your help and advices,

I do not see any other way but writing some elisp code of your own.  It
should be simple to do, I think.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Automagically send all org table
  2013-01-14 10:25 Automagically send all org table Xavier Garrido
  2013-01-14 12:24 ` Suvayu Ali
@ 2013-01-14 12:56 ` Carsten Dominik
  2013-01-14 13:03   ` Garrido Xavier
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2013-01-14 12:56 UTC (permalink / raw)
  To: Xavier Garrido; +Cc: emacs-orgmode


On 14 jan. 2013, at 11:25, Xavier Garrido <xavier.garrido@gmail.com> wrote:

> Hi orgmoders,
> 
> I am looking for a simple way to SEND all org tables in a given document to their RECEIVER counterparts. Of course, I can go through the whole document and do `org-table-send` one-by-one but I would like to do it without opening the document and for all tables at the same time. Is there a way ?
> 
> Thanks for your help and advices,
> Xavier

Hi Xavier,

this should do the trick (untested):

(defun my-org-send-all-tables ()
   (interactive)
   (org-table-map-tables
      (lambda () (orgtbl-send-table 'maybe))))

HTH

- Carsten

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

* Re: Automagically send all org table
  2013-01-14 12:56 ` Carsten Dominik
@ 2013-01-14 13:03   ` Garrido Xavier
  0 siblings, 0 replies; 8+ messages in thread
From: Garrido Xavier @ 2013-01-14 13:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Xavier Garrido, emacs-orgmode

It works perfectly ! Thanks a lot.

Le lun. 14 janv. 2013 13:56:50 CET, Carsten Dominik a écrit :
>
> On 14 jan. 2013, at 11:25, Xavier Garrido <xavier.garrido@gmail.com> wrote:
>
>> Hi orgmoders,
>>
>> I am looking for a simple way to SEND all org tables in a given document to their RECEIVER counterparts. Of course, I can go through the whole document and do `org-table-send` one-by-one but I would like to do it without opening the document and for all tables at the same time. Is there a way ?
>>
>> Thanks for your help and advices,
>> Xavier
>
> Hi Xavier,
>
> this should do the trick (untested):
>
> (defun my-org-send-all-tables ()
>     (interactive)
>     (org-table-map-tables
>        (lambda () (orgtbl-send-table 'maybe))))
>
> HTH
>
> - Carsten

--

  |
  |__     GARRIDO Xavier       Laboratoire de l'Accélérateur Linéaire
   /\     NEMO                 Université Paris-Sud 11
  /--\    garrido@lal.in2p3.fr UMR 8607
  |       garrido@in2p3.fr     Batiment 200
  |__     +33 1.64.46.84.28    91898 Orsay Cedex, France

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

* Re: Automagically send all org table
  2013-01-14 12:24 ` Suvayu Ali
@ 2013-01-14 13:03   ` Jambunathan K
  2013-01-14 13:09     ` Suvayu Ali
  2013-01-14 13:58     ` Jambunathan K
  0 siblings, 2 replies; 8+ messages in thread
From: Jambunathan K @ 2013-01-14 13:03 UTC (permalink / raw)
  To: Xavier Garrido; +Cc: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Mon, Jan 14, 2013 at 11:25:27AM +0100, Xavier Garrido wrote:
>> Hi orgmoders,
>> 
>> I am looking for a simple way to SEND all org tables in a given document to
>> their RECEIVER counterparts. Of course, I can go through the whole document
>> and do `org-table-send` one-by-one but I would like to do it without opening
>> the document and for all tables at the same time. Is there a way ?
>> 
>> Thanks for your help and advices,
>
> I do not see any other way 

There is a way

> but writing some elisp code of your own.  

Why not have Emacs write it for you?  You dictate and Emacs will type
out the elisp code.

> It should be simple to do, I think.

Not simpler than resorting to macros.

Here is how.  Just hints.  OP should help himself.

----------------------------------------------------------------------

Begin macro, do stuff, end macro,

        C-x (, do stuff, C-x )

Execute macro 
        C-x e

Or provide a local, on-the-move binding and execute it.
        C-x C-k b

Name the macro and store it as a command in your .emacs.
        C-x C-k n, M-x insert-kbd-macro

Run the stored macro from batch script  (Hint: C-h v org-export-as-html-batch)
       emacs --batch --load=~/MyInitStuff.el --visit=MyFile --funcall MyNamedMacro"

----------------------------------------------------------------------

For help with jumping to relevant Info portions, do

        C-h K C-x (
        C-h K C-x C-k n

(Note the CAPITAL `K' above)
        
----------------------------------------------------------------------
-- 

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

* Re: Automagically send all org table
  2013-01-14 13:03   ` Jambunathan K
@ 2013-01-14 13:09     ` Suvayu Ali
  2013-01-14 13:58     ` Jambunathan K
  1 sibling, 0 replies; 8+ messages in thread
From: Suvayu Ali @ 2013-01-14 13:09 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode, Xavier Garrido

On Mon, Jan 14, 2013 at 06:33:48PM +0530, Jambunathan K wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> Not simpler than resorting to macros.

Indeed, macros are indeed more appropriate in this case.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Automagically send all org table
  2013-01-14 13:03   ` Jambunathan K
  2013-01-14 13:09     ` Suvayu Ali
@ 2013-01-14 13:58     ` Jambunathan K
  2013-01-14 14:07       ` Garrido Xavier
  1 sibling, 1 reply; 8+ messages in thread
From: Jambunathan K @ 2013-01-14 13:58 UTC (permalink / raw)
  To: Xavier Garrido; +Cc: emacs-orgmode

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

Jambunathan K <kjambunathan@gmail.com> writes:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>
>> On Mon, Jan 14, 2013 at 11:25:27AM +0100, Xavier Garrido wrote:
>>> Hi orgmoders,
>>> 
>>> I am looking for a simple way to SEND all org tables in a given document to
>>> their RECEIVER counterparts. Of course, I can go through the whole document
>>> and do `org-table-send` one-by-one but I would like to do it without opening
>>> the document and for all tables at the same time. Is there a way ?
>>> 
>>> Thanks for your help and advices,
>>
>> I do not see any other way 
>
> There is a way
>
>> but writing some elisp code of your own.  
>
> Why not have Emacs write it for you?  You dictate and Emacs will type
> out the elisp code.
>
>> It should be simple to do, I think.
>
> Not simpler than resorting to macros.
>
> Here is how.  Just hints.  OP should help himself.

Here is what I (or rather Emacs) came up with.  The Elisp snippet has
control characters, so see the attachment.


[-- Attachment #2: send-table.el --]
[-- Type: application/emacs-lisp, Size: 158 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1021 bytes --]


Put that in to your .emacs or C-x C-e it.

Then, if you know that your file has no more than N (say 100) tables, do

C-x C-f myfile.html
C-u 100 M-x send-table RET

You are done.

>
> ----------------------------------------------------------------------
>
> Begin macro, do stuff, end macro,
>
>         C-x (, do stuff, C-x )
>
> Execute macro 
>         C-x e
>
> Or provide a local, on-the-move binding and execute it.
>         C-x C-k b
>
> Name the macro and store it as a command in your .emacs.
>         C-x C-k n, M-x insert-kbd-macro
>
> Run the stored macro from batch script  (Hint: C-h v org-export-as-html-batch)
>        emacs --batch --load=~/MyInitStuff.el --visit=MyFile --funcall MyNamedMacro"
>
> ----------------------------------------------------------------------
>
> For help with jumping to relevant Info portions, do
>
>         C-h K C-x (
>         C-h K C-x C-k n
>
> (Note the CAPITAL `K' above)
>         
> ----------------------------------------------------------------------



-- 

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

* Re: Automagically send all org table
  2013-01-14 13:58     ` Jambunathan K
@ 2013-01-14 14:07       ` Garrido Xavier
  0 siblings, 0 replies; 8+ messages in thread
From: Garrido Xavier @ 2013-01-14 14:07 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Xavier Garrido, emacs-orgmode

Thank you all,
Xavier

Le lun. 14 janv. 2013 14:58:32 CET, Jambunathan K a écrit :
> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>>
>>> On Mon, Jan 14, 2013 at 11:25:27AM +0100, Xavier Garrido wrote:
>>>> Hi orgmoders,
>>>>
>>>> I am looking for a simple way to SEND all org tables in a given document to
>>>> their RECEIVER counterparts. Of course, I can go through the whole document
>>>> and do `org-table-send` one-by-one but I would like to do it without opening
>>>> the document and for all tables at the same time. Is there a way ?
>>>>
>>>> Thanks for your help and advices,
>>>
>>> I do not see any other way
>>
>> There is a way
>>
>>> but writing some elisp code of your own.
>>
>> Why not have Emacs write it for you?  You dictate and Emacs will type
>> out the elisp code.
>>
>>> It should be simple to do, I think.
>>
>> Not simpler than resorting to macros.
>>
>> Here is how.  Just hints.  OP should help himself.
>
> Here is what I (or rather Emacs) came up with.  The Elisp snippet has
> control characters, so see the attachment.
>
>
>
>
> Put that in to your .emacs or C-x C-e it.
>
> Then, if you know that your file has no more than N (say 100) tables, do
>
> C-x C-f myfile.html
> C-u 100 M-x send-table RET
>
> You are done.
>
>>
>> ----------------------------------------------------------------------
>>
>> Begin macro, do stuff, end macro,
>>
>>          C-x (, do stuff, C-x )
>>
>> Execute macro
>>          C-x e
>>
>> Or provide a local, on-the-move binding and execute it.
>>          C-x C-k b
>>
>> Name the macro and store it as a command in your .emacs.
>>          C-x C-k n, M-x insert-kbd-macro
>>
>> Run the stored macro from batch script  (Hint: C-h v org-export-as-html-batch)
>>         emacs --batch --load=~/MyInitStuff.el --visit=MyFile --funcall MyNamedMacro"
>>
>> ----------------------------------------------------------------------
>>
>> For help with jumping to relevant Info portions, do
>>
>>          C-h K C-x (
>>          C-h K C-x C-k n
>>
>> (Note the CAPITAL `K' above)
>>
>> ----------------------------------------------------------------------
>
>
>

--

  |
  |__     GARRIDO Xavier       Laboratoire de l'Accélérateur Linéaire
   /\     NEMO                 Université Paris-Sud 11
  /--\    garrido@lal.in2p3.fr UMR 8607
  |       garrido@in2p3.fr     Batiment 200
  |__     +33 1.64.46.84.28    91898 Orsay Cedex, France

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

end of thread, other threads:[~2013-01-14 15:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 10:25 Automagically send all org table Xavier Garrido
2013-01-14 12:24 ` Suvayu Ali
2013-01-14 13:03   ` Jambunathan K
2013-01-14 13:09     ` Suvayu Ali
2013-01-14 13:58     ` Jambunathan K
2013-01-14 14:07       ` Garrido Xavier
2013-01-14 12:56 ` Carsten Dominik
2013-01-14 13:03   ` Garrido Xavier

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