Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  patch: emacs flymake support

jdavisp3
Posted: Sun May 16, 2010 6:58 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
This patch adds (optional) support for flymake mode
(on-the-fly syntax checking) on Emacs, for UNIX systems.

This work was originally submitted to the Erlware version
of the Emacs mode by Mats Cronqvist.

http://github.com/jdavisp3/otp/tree/emacs-flymake

dave

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Sun May 16, 2010 6:59 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
This patch adds (optional) support for flymake mode
(on-the-fly syntax checking) on Emacs, for UNIX systems.

This work was originally submitted to the Erlware version
of the Emacs mode by Mats Cronqvist.

http://github.com/jdavisp3/otp/tree/emacs-flymake

dave

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
Guest
Posted: Mon May 17, 2010 1:25 pm Reply with quote
Guest
On Sat, May 15, 2010 at 11:01:34PM -0700, Dave Peticolas wrote:
> This patch adds (optional) support for flymake mode
> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>
> This work was originally submitted to the Erlware version
> of the Emacs mode by Mats Cronqvist.
>
> http://github.com/jdavisp3/otp/tree/emacs-flymake

Thanks. Included in 'pu' with minor tweaks of the commit message
and whitespace fixes.

For future contributions please use the recommended
source format e.g:
git fetch git://github.com/jdavisp3/otp.git emacs-flymake

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon May 17, 2010 1:25 pm Reply with quote
Guest
On Sat, May 15, 2010 at 11:01:34PM -0700, Dave Peticolas wrote:
> This patch adds (optional) support for flymake mode
> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>
> This work was originally submitted to the Erlware version
> of the Emacs mode by Mats Cronqvist.
>
> http://github.com/jdavisp3/otp/tree/emacs-flymake

Thanks. Included in 'pu' with minor tweaks of the commit message
and whitespace fixes.

For future contributions please use the recommended
source format e.g:
git fetch git://github.com/jdavisp3/otp.git emacs-flymake

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Tue May 25, 2010 8:52 am Reply with quote
Guest
Hi.

A few doubts about your contribusion:
* The added files are missing from the Makefile. Can you
please fix this?
* flymaker.sh is a bash script and we have Solaris 8 on our
list of supported platforms, so a /bin/sh script would
be more portable. This will not not stop us from accepting
your contribution, but is there anything bash specific
in the script? A quick readthrough only revealed some
'==' tests that is portably written as '=', but I saw
no essential bash features used.
* Could even flymaker.sh be an escript? That might even
make it work on Windows.

On Mon, May 17, 2010 at 07:53:47AM -0700, Dave Peticolas wrote:
> On 05/17/2010 06:24 AM, Raimo Niskanen wrote:
> >On Sat, May 15, 2010 at 11:01:34PM -0700, Dave Peticolas wrote:
> >
> >>This patch adds (optional) support for flymake mode
> >>(on-the-fly syntax checking) on Emacs, for UNIX systems.
> >>
> >>This work was originally submitted to the Erlware version
> >>of the Emacs mode by Mats Cronqvist.
> >>
> >> http://github.com/jdavisp3/otp/tree/emacs-flymake
> >>
> >Thanks. Included in 'pu' with minor tweaks of the commit message
> >and whitespace fixes.
> >
> >For future contributions please use the recommended
> >source format e.g:
> > git fetch git://github.com/jdavisp3/otp.git emacs-flymake
> >
>
> Will do, thanks!
>
> dave

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Tue May 25, 2010 8:52 am Reply with quote
Guest
Hi.

A few doubts about your contribusion:
* The added files are missing from the Makefile. Can you
please fix this?
* flymaker.sh is a bash script and we have Solaris 8 on our
list of supported platforms, so a /bin/sh script would
be more portable. This will not not stop us from accepting
your contribution, but is there anything bash specific
in the script? A quick readthrough only revealed some
'==' tests that is portably written as '=', but I saw
no essential bash features used.
* Could even flymaker.sh be an escript? That might even
make it work on Windows.

On Mon, May 17, 2010 at 07:53:47AM -0700, Dave Peticolas wrote:
> On 05/17/2010 06:24 AM, Raimo Niskanen wrote:
> >On Sat, May 15, 2010 at 11:01:34PM -0700, Dave Peticolas wrote:
> >
> >>This patch adds (optional) support for flymake mode
> >>(on-the-fly syntax checking) on Emacs, for UNIX systems.
> >>
> >>This work was originally submitted to the Erlware version
> >>of the Emacs mode by Mats Cronqvist.
> >>
> >> http://github.com/jdavisp3/otp/tree/emacs-flymake
> >>
> >Thanks. Included in 'pu' with minor tweaks of the commit message
> >and whitespace fixes.
> >
> >For future contributions please use the recommended
> >source format e.g:
> > git fetch git://github.com/jdavisp3/otp.git emacs-flymake
> >
>
> Will do, thanks!
>
> dave

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Thu May 27, 2010 9:45 pm Reply with quote
Guest
>> >>This patch adds (optional) support for flymake mode
>> >>(on-the-fly syntax checking) on Emacs, for UNIX systems.
>> >>
>> >>This work was originally submitted to the Erlware version
>> >>of the Emacs mode by Mats Cronqvist.

Hi,

I took a different approach, which perhaps is of interest to
someone. I'll post it here for the record. This patch is a pure
elisp implementation and seems to work on linux, mac osx and
windows (provided that erlc is in the path).

;; Syntax check erlang source code on the fly (integrates with flymake).
;;
;; Start using flymake with erlang by putting the following somewhere
;; in your .emacs file:
;;
;; (require 'erlang-flymake)
;;
;; Flymake is rather eager and does its syntax checks frequently by
;; default and if you are bothered by this, you might want to put the
;; following in your .emacs as well:
;;
;; (erlang-flymake-only-on-save)
;;
;; There are a couple of variables which control the compilation options:
;; * erlang-flymake-get-code-path-dirs-function
;; * erlang-flymake-get-include-dirs-function
;; * erlang-flymake-extra-opts
;;
;; This code is inspired by http://www.emacswiki.org/emacs/FlymakeErlang.

There are a few differences that I've spotted. The previously
posted version adds include and code paths whereas mine are by
default empty (any takers? Smile ). They are configurable though.
I've used this in a setting where include and code paths are
stated in a special file within the application. I wrote
functions which produced lists of paths based on that file. The
following variables can be set to point at such functions:

* erlang-flymake-get-code-path-dirs-function and
* erlang-flymake-get-include-dirs-function

The flags used to specify compiler warnings differ as well.
There's another variable that can be used to specify the options
one wants to use:

* erlang-flymake-extra-opts


Code here:

git fetch git://github.com/klajo/otp.git erlang-flymake


Cheers,
Klas

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Thu May 27, 2010 9:45 pm Reply with quote
Guest
>> >>This patch adds (optional) support for flymake mode
>> >>(on-the-fly syntax checking) on Emacs, for UNIX systems.
>> >>
>> >>This work was originally submitted to the Erlware version
>> >>of the Emacs mode by Mats Cronqvist.

Hi,

I took a different approach, which perhaps is of interest to
someone. I'll post it here for the record. This patch is a pure
elisp implementation and seems to work on linux, mac osx and
windows (provided that erlc is in the path).

;; Syntax check erlang source code on the fly (integrates with flymake).
;;
;; Start using flymake with erlang by putting the following somewhere
;; in your .emacs file:
;;
;; (require 'erlang-flymake)
;;
;; Flymake is rather eager and does its syntax checks frequently by
;; default and if you are bothered by this, you might want to put the
;; following in your .emacs as well:
;;
;; (erlang-flymake-only-on-save)
;;
;; There are a couple of variables which control the compilation options:
;; * erlang-flymake-get-code-path-dirs-function
;; * erlang-flymake-get-include-dirs-function
;; * erlang-flymake-extra-opts
;;
;; This code is inspired by http://www.emacswiki.org/emacs/FlymakeErlang.

There are a few differences that I've spotted. The previously
posted version adds include and code paths whereas mine are by
default empty (any takers? Smile ). They are configurable though.
I've used this in a setting where include and code paths are
stated in a special file within the application. I wrote
functions which produced lists of paths based on that file. The
following variables can be set to point at such functions:

* erlang-flymake-get-code-path-dirs-function and
* erlang-flymake-get-include-dirs-function

The flags used to specify compiler warnings differ as well.
There's another variable that can be used to specify the options
one wants to use:

* erlang-flymake-extra-opts


Code here:

git fetch git://github.com/klajo/otp.git erlang-flymake


Cheers,
Klas

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
jdavisp3
Posted: Fri May 28, 2010 3:53 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
On 05/27/2010 02:44 PM, Klas Johansson wrote:
>>>>> This patch adds (optional) support for flymake mode
>>>>> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>>>>>
>>>>> This work was originally submitted to the Erlware version
>>>>> of the Emacs mode by Mats Cronqvist.
>>>>>
> Hi,
>
> I took a different approach, which perhaps is of interest to
> someone. I'll post it here for the record. This patch is a pure
> elisp implementation and seems to work on linux, mac osx and
> windows (provided that erlc is in the path).
>
> ;; Syntax check erlang source code on the fly (integrates with flymake).
> ;;
> ;; Start using flymake with erlang by putting the following somewhere
> ;; in your .emacs file:
> ;;
> ;; (require 'erlang-flymake)
> ;;
> ;; Flymake is rather eager and does its syntax checks frequently by
> ;; default and if you are bothered by this, you might want to put the
> ;; following in your .emacs as well:
> ;;
> ;; (erlang-flymake-only-on-save)
> ;;
> ;; There are a couple of variables which control the compilation options:
> ;; * erlang-flymake-get-code-path-dirs-function
> ;; * erlang-flymake-get-include-dirs-function
> ;; * erlang-flymake-extra-opts
> ;;
> ;; This code is inspired by http://www.emacswiki.org/emacs/FlymakeErlang.
>
> There are a few differences that I've spotted. The previously
> posted version adds include and code paths whereas mine are by
> default empty (any takers? Smile ). They are configurable though.
> I've used this in a setting where include and code paths are
> stated in a special file within the application. I wrote
> functions which produced lists of paths based on that file. The
> following variables can be set to point at such functions:
>
> * erlang-flymake-get-code-path-dirs-function and
> * erlang-flymake-get-include-dirs-function
>
> The flags used to specify compiler warnings differ as well.
> There's another variable that can be used to specify the options
> one wants to use:
>
> * erlang-flymake-extra-opts
>
>
> Code here:
>
> git fetch git://github.com/klajo/otp.git erlang-flymake
>
>

An all-elisp solution seems like an improvement over the patch I sent.

What do you think about providing a default implementation of the include
and code path functions that assume the typical directory layouts for
otp apps?
That way folks who use the standard layout don't have to add anything
extra to their
configs.

dave


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Fri May 28, 2010 3:54 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
On 05/27/2010 02:44 PM, Klas Johansson wrote:
>>>>> This patch adds (optional) support for flymake mode
>>>>> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>>>>>
>>>>> This work was originally submitted to the Erlware version
>>>>> of the Emacs mode by Mats Cronqvist.
>>>>>
> Hi,
>
> I took a different approach, which perhaps is of interest to
> someone. I'll post it here for the record. This patch is a pure
> elisp implementation and seems to work on linux, mac osx and
> windows (provided that erlc is in the path).
>
> ;; Syntax check erlang source code on the fly (integrates with flymake).
> ;;
> ;; Start using flymake with erlang by putting the following somewhere
> ;; in your .emacs file:
> ;;
> ;; (require 'erlang-flymake)
> ;;
> ;; Flymake is rather eager and does its syntax checks frequently by
> ;; default and if you are bothered by this, you might want to put the
> ;; following in your .emacs as well:
> ;;
> ;; (erlang-flymake-only-on-save)
> ;;
> ;; There are a couple of variables which control the compilation options:
> ;; * erlang-flymake-get-code-path-dirs-function
> ;; * erlang-flymake-get-include-dirs-function
> ;; * erlang-flymake-extra-opts
> ;;
> ;; This code is inspired by http://www.emacswiki.org/emacs/FlymakeErlang.
>
> There are a few differences that I've spotted. The previously
> posted version adds include and code paths whereas mine are by
> default empty (any takers? Smile ). They are configurable though.
> I've used this in a setting where include and code paths are
> stated in a special file within the application. I wrote
> functions which produced lists of paths based on that file. The
> following variables can be set to point at such functions:
>
> * erlang-flymake-get-code-path-dirs-function and
> * erlang-flymake-get-include-dirs-function
>
> The flags used to specify compiler warnings differ as well.
> There's another variable that can be used to specify the options
> one wants to use:
>
> * erlang-flymake-extra-opts
>
>
> Code here:
>
> git fetch git://github.com/klajo/otp.git erlang-flymake
>
>

An all-elisp solution seems like an improvement over the patch I sent.

What do you think about providing a default implementation of the include
and code path functions that assume the typical directory layouts for
otp apps?
That way folks who use the standard layout don't have to add anything
extra to their
configs.

dave


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
Guest
Posted: Sun May 30, 2010 9:06 pm Reply with quote
Guest
On Fri, May 28, 2010 at 5:53 AM, Dave Peticolas <dave@krondo.com> wrote:
> On 05/27/2010 02:44 PM, Klas Johansson wrote:
>>>>>>
>>>>>> This patch adds (optional) support for flymake mode
>>>>>> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>>>>>>
>>>>>> This work was originally submitted to the Erlware version
>>>>>> of the Emacs mode by Mats Cronqvist.
>>>>>>
>>
>> Hi,
>>
>> I took a different approach, which perhaps is of interest to
>> someone.
Guest
Posted: Sun May 30, 2010 9:06 pm Reply with quote
Guest
On Fri, May 28, 2010 at 5:53 AM, Dave Peticolas <dave@krondo.com> wrote:
> On 05/27/2010 02:44 PM, Klas Johansson wrote:
>>>>>>
>>>>>> This patch adds (optional) support for flymake mode
>>>>>> (on-the-fly syntax checking) on Emacs, for UNIX systems.
>>>>>>
>>>>>> This work was originally submitted to the Erlware version
>>>>>> of the Emacs mode by Mats Cronqvist.
>>>>>>
>>
>> Hi,
>>
>> I took a different approach, which perhaps is of interest to
>> someone.
Guest
Posted: Mon May 31, 2010 11:43 am Reply with quote
Guest
On Sun, May 30, 2010 at 11:05:32PM +0200, Klas Johansson wrote:
> On Fri, May 28, 2010 at 5:53 AM, Dave Peticolas <dave@krondo.com> wrote:
: :
> >
> > An all-elisp solution seems like an improvement over the patch I sent.
> >
> > What do you think about providing a default implementation of the include
> > and code path functions that assume the typical directory layouts for otp
> > apps?
> > That way folks who use the standard layout don't have to add anything extra
> > to their
> > configs.
> >
> > dave
>
> Hi again,
>
> I've made a couple of additional commits:
> * Include erlang-flymake.el in Makefile
> * By default pass <app>/include and <app>/ebin to compiler
> (note, this covers only the "current" application, not all
> applications on the same level as in the other version,
> hopefully this makes the erlang-flymake more useful
> out-of-the-box)
> * Make the syntax check command configurable
> (i.e. now you aren't restricted to erlc, you could for example
> use a wrapper script instead if you want to)
> * Document in README
>
> Code here:
>
> git fetch git://github.com/klajo/otp.git erlang-flymake

Thank you, it will be included in 'pu', replacing Dave Peticolas
contribution for now...

>
>
> Cheers,
> Klas
>
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
>

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon May 31, 2010 11:44 am Reply with quote
Guest
On Sun, May 30, 2010 at 11:05:32PM +0200, Klas Johansson wrote:
> On Fri, May 28, 2010 at 5:53 AM, Dave Peticolas <dave@krondo.com> wrote:
: :
> >
> > An all-elisp solution seems like an improvement over the patch I sent.
> >
> > What do you think about providing a default implementation of the include
> > and code path functions that assume the typical directory layouts for otp
> > apps?
> > That way folks who use the standard layout don't have to add anything extra
> > to their
> > configs.
> >
> > dave
>
> Hi again,
>
> I've made a couple of additional commits:
> * Include erlang-flymake.el in Makefile
> * By default pass <app>/include and <app>/ebin to compiler
> (note, this covers only the "current" application, not all
> applications on the same level as in the other version,
> hopefully this makes the erlang-flymake more useful
> out-of-the-box)
> * Make the syntax check command configurable
> (i.e. now you aren't restricted to erlc, you could for example
> use a wrapper script instead if you want to)
> * Document in README
>
> Code here:
>
> git fetch git://github.com/klajo/otp.git erlang-flymake

Thank you, it will be included in 'pu', replacing Dave Peticolas
contribution for now...

>
>
> Cheers,
> Klas
>
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
>

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
jdavisp3
Posted: Mon May 31, 2010 3:12 pm Reply with quote
User Joined: 03 Feb 2008 Posts: 21
On 05/31/2010 04:43 AM, Raimo Niskanen wrote:
> On Sun, May 30, 2010 at 11:05:32PM +0200, Klas Johansson wrote:
>
>> On Fri, May 28, 2010 at 5:53 AM, Dave Peticolas<dave@krondo.com> wrote:
>>
> : :
>
>>> An all-elisp solution seems like an improvement over the patch I sent.
>>>
>>> What do you think about providing a default implementation of the include
>>> and code path functions that assume the typical directory layouts for otp
>>> apps?
>>> That way folks who use the standard layout don't have to add anything extra
>>> to their
>>> configs.
>>>
>>> dave
>>>
>> Hi again,
>>
>> I've made a couple of additional commits:
>> * Include erlang-flymake.el in Makefile
>> * By default pass<app>/include and<app>/ebin to compiler
>> (note, this covers only the "current" application, not all
>> applications on the same level as in the other version,
>> hopefully this makes the erlang-flymake more useful
>> out-of-the-box)
>> * Make the syntax check command configurable
>> (i.e. now you aren't restricted to erlc, you could for example
>> use a wrapper script instead if you want to)
>> * Document in README
>>
>> Code here:
>>
>> git fetch git://github.com/klajo/otp.git erlang-flymake
>>
> Thank you, it will be included in 'pu', replacing Dave Peticolas
> contribution for now...
>
>

I concur, Klas's patch is better. I'll happily withdraw mine.

dave


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 2
Goto page 1, 2  Next
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