Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  TextMate

Guest
Posted: Mon Jan 21, 2008 8:05 am Reply with quote
Guest
Hi,

I'm trying to use TextMate as a replacement for emacs, but the auto
formatting for Erlang code sucks. Does anyone know of a decent Erlang
code formatting capability in TextMate?

Yariv

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
rsaccon
Posted: Mon Jan 21, 2008 1:06 pm Reply with quote
User Joined: 09 Aug 2006 Posts: 144
yeah, that really sucks

I am not aware of anything ready to use, but as part of highly
experimental-buggy-hack erlymate.googlecode.com I once wrote a
keybinding which lets you see the AST of a selected text. That was
very easy. So it should be easy to implement a prettyprint-replacement
some text selection or a whole document, if one is willing to digg
into that erlymate.googlecode.com hack.

Roberto


On Jan 21, 6:04 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Hi,
>
> I'm trying to use TextMate as a replacement for emacs, but the auto
> formatting for Erlang code sucks. Does anyone know of a decent Erlang
> code formatting capability in TextMate?
>
> Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message
rsaccon
Posted: Tue Jan 22, 2008 3:55 am Reply with quote
User Joined: 09 Aug 2006 Posts: 144
I forgot to mention the easy way if you don't mind the 0.2 sec delay
to start an Erlang VM:

just write a command in Erlang script for pretty printing selected
text and bind it to some keys of your choice and there you go !

On Jan 21, 11:05 am, Roberto Saccon <rsac...@gmail.com> wrote:
> yeah, that really sucks
>
> I am not aware of anything ready to use, but as part of highly
> experimental-buggy-hack erlymate.googlecode.com I once wrote a
> keybinding which lets you see the AST of a selected text. That was
> very easy. So it should be easy to implement a prettyprint-replacement
> some text selection or a whole document, if one is willing to digg
> into that erlymate.googlecode.com hack.
>
> Roberto
>
> On Jan 21, 6:04 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
>
> > Hi,
>
> > I'm trying to use TextMate as a replacement for emacs, but the auto
> > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > code formatting capability in TextMate?
>
> > Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Tue Jan 22, 2008 5:43 am Reply with quote
Guest
Heh that's a good idea. I'll give it a try. Let me know if you get it to work.

On Jan 21, 2008 7:54 PM, Roberto Saccon <rsaccon@gmail.com> wrote:
>
> I forgot to mention the easy way if you don't mind the 0.2 sec delay
> to start an Erlang VM:
>
> just write a command in Erlang script for pretty printing selected
> text and bind it to some keys of your choice and there you go !
>
>
> On Jan 21, 11:05 am, Roberto Saccon <rsac...@gmail.com> wrote:
> > yeah, that really sucks
> >
> > I am not aware of anything ready to use, but as part of highly
> > experimental-buggy-hack erlymate.googlecode.com I once wrote a
> > keybinding which lets you see the AST of a selected text. That was
> > very easy. So it should be easy to implement a prettyprint-replacement
> > some text selection or a whole document, if one is willing to digg
> > into that erlymate.googlecode.com hack.
> >
> > Roberto
> >
> > On Jan 21, 6:04 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> >
> > > Hi,
> >
> > > I'm trying to use TextMate as a replacement for emacs, but the auto
> > > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > > code formatting capability in TextMate?
> >
> > > Yariv
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Jan 23, 2008 7:34 am Reply with quote
Guest
Are you using the erlang bundle from textmate's repository?

http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle


Yariv Sadan wrote:
> Hi,
>
> I'm trying to use TextMate as a replacement for emacs, but the auto
> formatting for Erlang code sucks. Does anyone know of a decent Erlang
> code formatting capability in TextMate?
>
> Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Jan 23, 2008 7:42 am Reply with quote
Guest
I'm using the default one that came with TextMate. Is the one from the
repository more recent? Can it do code formatting?


On Jan 22, 2008 11:33 PM, flyfish <dsledge@gmail.com> wrote:
>
> Are you using the erlang bundle from textmate's repository?
>
> http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle
>
>
>
> Yariv Sadan wrote:
> > Hi,
> >
> > I'm trying to use TextMate as a replacement for emacs, but the auto
> > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > code formatting capability in TextMate?
> >
> > Yariv
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Jan 23, 2008 6:25 pm Reply with quote
Guest
It does do some formatting and gives you several shortcut keys that
will insert layouts of functions, case logic and many others. Export
the bundle and double click on the bundle file (Erlang.tmbundle dir)
to install it. Then an Erlang menu option will show up under bundles
in the textmate main menu bar. You can see all the key bindings and
features under there.


On Jan 23, 2:42
rsaccon
Posted: Wed Jan 23, 2008 7:44 pm Reply with quote
User Joined: 09 Aug 2006 Posts: 144
can you elaborate on how it does "some formatting" ?

what is the command or default key-binding for it ?

I want to reformat a given document and text selection.

On Jan 23, 4:24 pm, flyfish <dsle...@gmail.com> wrote:
> It does do some formatting and gives you several shortcut keys that
> will insert layouts of functions, case logic and many others. Export
> the bundle and double click on the bundle file (Erlang.tmbundle dir)
> to install it. Then an Erlang menu option will show up under bundles
> in the textmate main menu bar. You can see all the key bindings and
> features under there.
>
> On Jan 23, 2:42 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:> I'm using the default one that came with TextMate. Is the one from the
> > repository more recent? Can it do code formatting?
>
> > On Jan 22, 2008 11:33 PM, flyfish <dsle...@gmail.com> wrote:
>
> > > Are you using the erlang bundle from textmate's repository?
>
> > >http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle
>
> > > Yariv Sadan wrote:
> > > > Hi,
>
> > > > I'm trying to use TextMate as a replacement for emacs, but the auto
> > > > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > > > code formatting capability in TextMate?
>
> > > > Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Wed Jan 23, 2008 8:17 pm Reply with quote
Guest
"some formatting" means that once you have the bundle installed it
will do things like auto add closing parens and brackets, when using
key bindings you get formatted prototype code like "control shift f"
to create a function will look like this:

function (param) when guard ->
body

and generating a fun like this:

fun
(pattern) when guard ->
body
end

and auto generated recieve prototype code like this:

receive
pattern when guard ->
body
after
expression ->
body
end

Of course you get syntax coloring, It sadly Sad does not have a
reformatter to beautify existing code. It would be nice to see that
feature added. Maybe I will look into extending the bundle to do that
when I have time and submit the patch to textmate to be included.
There are currently 24 key bindings for generating prototype code.
Hope this helps a little. I currently switch between emacs and
textmate myself as I like different features each one has.



On Jan 23, 2:42
rsaccon
Posted: Sat Jan 26, 2008 3:15 am Reply with quote
User Joined: 09 Aug 2006 Posts: 144
I experimented a bit with erlang native pretty printing:

{ok, Ast} = epp_dodger:parse_file(MyErlangSourceFile),
String = erl_prettypr:format(erl_syntax:form_list(Ast)),
io:format("~s~n", [String]).

That is very easy to put into an escript command for textmate. For
prettyprinting selctions, there is a bit more trickery necessary, see

http://www.trapexit.org/forum/viewtopic.php?p=130&sid=d3504836a6840bbfd7c5291700f3e82d

On Jan 23, 6:16 pm, flyfish <dsle...@gmail.com> wrote:
> "some formatting" means that once you have the bundle installed it
> will do things like auto add closing parens and brackets, when using
> key bindings you get formatted prototype code like "control shift f"
> to create a function will look like this:
>
> function (param) when guard ->
> body
>
> and generating a fun like this:
>
> fun
> (pattern) when guard ->
> body
> end
>
> and auto generated recieve prototype code like this:
>
> receive
> pattern when guard ->
> body
> after
> expression ->
> body
> end
>
> Of course you get syntax coloring, It sadly Sad does not have a
> reformatter to beautify existing code. It would be nice to see that
> feature added. Maybe I will look into extending the bundle to do that
> when I have time and submit the patch to textmate to be included.
> There are currently 24 key bindings for generating prototype code.
> Hope this helps a little. I currently switch between emacs and
> textmate myself as I like different features each one has.
>
> On Jan 23, 2:42 pm, Roberto Saccon <rsac...@gmail.com> wrote:
>
> > can you elaborate on how it does "some formatting" ?
>
> > what is the command or default key-binding for it ?
>
> > I want to reformat a given document and text selection.
>
> > On Jan 23, 4:24 pm, flyfish <dsle...@gmail.com> wrote:
>
> > > It does do some formatting and gives you several shortcut keys that
> > > will insert layouts of functions, case logic and many others. Export
> > > the bundle and double click on the bundle file (Erlang.tmbundle dir)
> > > to install it. Then an Erlang menu option will show up under bundles
> > > in the textmate main menu bar. You can see all the key bindings and
> > > features under there.
>
> > > On Jan 23, 2:42 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:> I'm using the default one that came with TextMate. Is the one from the
> > > > repository more recent? Can it do code formatting?
>
> > > > On Jan 22, 2008 11:33 PM, flyfish <dsle...@gmail.com> wrote:
>
> > > > > Are you using the erlang bundle from textmate's repository?
>
> > > > >http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle
>
> > > > > Yariv Sadan wrote:
> > > > > > Hi,
>
> > > > > > I'm trying to use TextMate as a replacement for emacs, but the auto
> > > > > > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > > > > > code formatting capability in TextMate?
>
> > > > > > Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Sat Jan 26, 2008 9:40 pm Reply with quote
Guest
It looks like this approach doesn't preserve comments Sad

On Jan 25, 2008 7:13 PM, Roberto Saccon <rsaccon@gmail.com> wrote:
>
> I experimented a bit with erlang native pretty printing:
>
> {ok, Ast} = epp_dodger:parse_file(MyErlangSourceFile),
> String = erl_prettypr:format(erl_syntax:form_list(Ast)),
> io:format("~s~n", [String]).
>
> That is very easy to put into an escript command for textmate. For
> prettyprinting selctions, there is a bit more trickery necessary, see
>
> http://www.trapexit.org/forum/viewtopic.php?p=130&sid=d3504836a6840bbfd7c5291700f3e82d
>
>
> On Jan 23, 6:16 pm, flyfish <dsle...@gmail.com> wrote:
> > "some formatting" means that once you have the bundle installed it
> > will do things like auto add closing parens and brackets, when using
> > key bindings you get formatted prototype code like "control shift f"
> > to create a function will look like this:
> >
> > function (param) when guard ->
> > body
> >
> > and generating a fun like this:
> >
> > fun
> > (pattern) when guard ->
> > body
> > end
> >
> > and auto generated recieve prototype code like this:
> >
> > receive
> > pattern when guard ->
> > body
> > after
> > expression ->
> > body
> > end
> >
> > Of course you get syntax coloring, It sadly Sad does not have a
> > reformatter to beautify existing code. It would be nice to see that
> > feature added. Maybe I will look into extending the bundle to do that
> > when I have time and submit the patch to textmate to be included.
> > There are currently 24 key bindings for generating prototype code.
> > Hope this helps a little. I currently switch between emacs and
> > textmate myself as I like different features each one has.
> >
> > On Jan 23, 2:42 pm, Roberto Saccon <rsac...@gmail.com> wrote:
> >
> > > can you elaborate on how it does "some formatting" ?
> >
> > > what is the command or default key-binding for it ?
> >
> > > I want to reformat a given document and text selection.
> >
> > > On Jan 23, 4:24 pm, flyfish <dsle...@gmail.com> wrote:
> >
> > > > It does do some formatting and gives you several shortcut keys that
> > > > will insert layouts of functions, case logic and many others. Export
> > > > the bundle and double click on the bundle file (Erlang.tmbundle dir)
> > > > to install it. Then an Erlang menu option will show up under bundles
> > > > in the textmate main menu bar. You can see all the key bindings and
> > > > features under there.
> >
> > > > On Jan 23, 2:42 am, "Yariv Sadan" <yarivsa...@gmail.com> wrote:> I'm using the default one that came with TextMate. Is the one from the
> > > > > repository more recent? Can it do code formatting?
> >
> > > > > On Jan 22, 2008 11:33 PM, flyfish <dsle...@gmail.com> wrote:
> >
> > > > > > Are you using the erlang bundle from textmate's repository?
> >
> > > > > >http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle
> >
> > > > > > Yariv Sadan wrote:
> > > > > > > Hi,
> >
> > > > > > > I'm trying to use TextMate as a replacement for emacs, but the auto
> > > > > > > formatting for Erlang code sucks. Does anyone know of a decent Erlang
> > > > > > > code formatting capability in TextMate?
> >
> > > > > > > Yariv
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum