help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use Elisp to improve your Elisp - some code issues


From: Emanuel Berg
Subject: Re: use Elisp to improve your Elisp - some code issues
Date: Sat, 01 Aug 2015 06:20:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Sam Halliday <sam.halliday@gmail.com> writes:

> This is really great! We have plans to do something
> similar in ENSIME (for Scala, and soon Java,
> development).

Well, thank you :) The idea is great, however it is
not a new one since it is basically find + egrep, with
find here being a zsh pattern matching ls (I'm unsure
bash has "**/*", so that example may not work work tho
many others will), and egrep being
`re-search-forward'. But yeah, it is a nice little
thing :)

> The Scala/Java support is of no relevance to this
> group, so I shall just say that we have an external
> process that we communicate with and it can provide
> async suggestions of code that can be changed.
>
> It sounds like what you're doing here and we aim to
> achieve (albeit it a long burn) would benefit from
> a common interface of "code suggestion" --- both
> a format for the changes (universal diff?) and the
> method to show and accept the changes.

More or less. The tool (code) just searches for
regexps in the files whose names match another regexp.
So it is just a tool to find things in files.
However if you express style things you don't like as
regexps, it can be used as to improve the code (if you
change them as well). See the examples last in the
file - if I come up with more, I'll add them to the
same file.

One example would be what we have mentioned a couple
of times by now and that is

    (if a b)
    (if (not a) b)

which should be

    (when a b)
    (unless a b)

Anyone has an regexp for that?

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]