elisp: turn current paragraph into html table
  Home FAQ Contact Sign in
comp.emacs only
 
Advanced search
POPULAR GROUPS

more...

comp.emacs Profile…
 Up
elisp: turn current paragraph into html table         


Author: xahlee
Date: Apr 28, 2008 20:42

Elisp Lesson: Writing make-html-table

Xah Lee, 2008-04-28

This page shows a example of writing a emacs lisp function that turns
the current block of text into a HTML table.

The Problem

I want to write a function, such that, when called, the current block
of text the cursor is on, becomes a HTML table. Suppose the block of
text is this:

a b c
1 2 3
this and that

after, pressing a button, it should become:





abc
123
thisandthat


Here's elisp code:
Show full article (2.09Kb)
8 Comments
Re: elisp: turn current paragraph into html table         


Author: Peter Hildebrandt
Date: Apr 29, 2008 02:00

xahlee@gmail.com wrote:
> The Problem
>
> a b c
> 1 2 3
>
> after, pressing a button, it should become:
>
>
>
>
>
>
abc
123
thisandthat

Indeed, I see the problem.

Who is responsible for html again?

CNR,
Peter
no comments
Re: elisp: turn current paragraph into html table         


Author: Pascal J. Bourguignon
Date: Apr 29, 2008 10:00

Peter Hildebrandt gmail.com> writes:
> xahlee@gmail.com wrote:
>> The Problem
>> a b c
>> 1 2 3
>> after, pressing a button, it should become:
>>
>>
>>
>>
>>
abc
123
thisandthat
>
> Indeed, I see the problem.
>
> Who is responsible for html again?

Tim Berners-Lee.
Show full article (0.93Kb)
no comments
Re: elisp: turn current paragraph into html table         


Author: John Thingstad
Date: Apr 29, 2008 10:32

PÃ¥ Tue, 29 Apr 2008 19:00:12 +0200, skrev Pascal J. Bourguignon
informatimago.com>:
> Peter Hildebrandt gmail.com> writes:
>
>> xahlee@gmail.com wrote:
>>> The Problem
>>> a b c
>>> 1 2 3
>>> after, pressing a button, it should become:
>>>
Show full article (1.32Kb)
no comments
Re: elisp: turn current paragraph into html table         


Author: harven
Date: May 2, 2008 06:50

As a sidenote, you could also use
M-x table-capture
M-x table-generate-source
to build html or latex tables fast.
no comments
Re: elisp: turn current paragraph into html table         


Author: xahlee
Date: May 2, 2008 07:41

On May 2, 6:50 am, harven wrote:
> As a sidenote, you could also use
> M-x table-capture
> M-x table-generate-source
> to build html or latex tables fast.

interesting. table-capture does ascii-art styled table.

table-generate-source seems to be able to generate html table
according to its online doc, but how do i use it? it's online doc is
rather not clear. It just give me error: "if: Table not found here".

Thanks.

Xah
xah@xahlee.org
∑ http://xahlee.org/

☄
no comments
Re: elisp: turn current paragraph into html table         


Author: harven
Date: May 2, 2008 11:05

On May 2, 4:41 pm, "xah...@gmail.com" gmail.com> wrote:
> On May 2, 6:50 am, harven wrote:
>
>> As a sidenote, you could also use
>> M-x table-capture
>> M-x table-generate-source
>> to build html or latex tables fast.
>
> interesting. table-capture does ascii-art styled table.
>
> table-generate-source seems to be able to generate html table
> according to its online doc, but how do i use it? it's online doc is
> rather not clear. It just give me error: "if: Table not found here".
>
> Thanks.
>
> Xah
> x...@xahlee.org
> ∑http://xahlee.org/
> ...
Show full article (0.70Kb)
no comments
Re: elisp: turn current paragraph into html table         


Author: xahlee
Date: May 2, 2008 17:07

harven wrote:
«
As a sidenote, you could also use
M-x table-capture
M-x table-generate-source
to build html or latex tables fast.
»

Xah wrote:
«...but how do i use it? »

harven wrote:
«Have a look at the emacs wiki for a worked-out example.
http://www.emacswiki.org/cgi-bin/emacs-en/TableMode »

Thank you very much. That is superb.

Xah
xah@xahlee.org
∑ http://xahlee.org/

☄
no comments
Re: elisp: turn current paragraph into html table         


Author: David Combs
Date: May 17, 2008 17:57

In article ,
John Thingstad wrote:
...
>
>Sidenote:
>
>In an amazing turn of events IE8 is more or less standards compliant per
>default.
>CSS (W3C) and JavaScript (ECMA) is consistent with standards and other
>browsers.
>Netscape and Opera already are so in a way it will soon be a lot simpler..
>
>--------------
>John Thingstad

Firefox?
no comments

RELATED THREADS
SubjectArticles qty Group
Re: [PATCH 05/12] i386: During page table initialization always set the leaf page table entries.linux.kernel ·
Draw table button (not layout draw table) nowhere to be found?microsoft.public.expression.webdesigner ·