Re: Projectile Support for Locate

Edward Steere <[email protected]> Tue, 29 Mar 2016 20:07:17 +0200
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi All,

Found a mistake in my original patch.
I used `projectile-all-project-files=E2=80=99 but I should have been =
using `projectile-current-project-files=E2=80=99.

Please find an updated patch attached.

Kind regards,

Edward Steere


--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139
Content-Disposition: attachment;
	filename=0001-Added-projectile-back-end-to-ede-locate.patch
Content-Type: application/octet-stream;
	name="0001-Added-projectile-back-end-to-ede-locate.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20e9aa093489c652ae5e21eba50c6ad011d6d02565=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Edward=20Steere=20<[email protected]>=0A=
Date:=20Sun,=2013=20Mar=202016=2007:37:13=20+0200=0ASubject:=20[PATCH]=20=
Added=20projectile=20back=20end=20to=20ede-locate.=0A=0AVery=20simple=20=
implementation.=20It=20uses=20LOC=20to=20detect=20the=20root=20of=20the=0A=
project=20and=20uses=20that=20to=20select=20the=20relevant=20projectile=20=
project.=20The=0Aonly=20method=20which=20it=20overrides=20from=20the=20=
base=20locate=20object=20is=20the=20locate=0Aimplementation=20for=20=
which=20it=20looks=20through=20a=20cache=20of=20files=20from=0A=
projectile=20(constructing=20the=20cache=20if=20it=20doesn't=20exist)=20=
matching=0Afilesubstring=20to=20regex=20matches.=0A---=0A=20=
lisp/cedet/ede/locate.el=20|=2030=20++++++++++++++++++++++++++++++=0A=20=
1=20file=20changed,=2030=20insertions(+)=0A=0Adiff=20--git=20=
a/lisp/cedet/ede/locate.el=20b/lisp/cedet/ede/locate.el=0Aindex=20=
d8b29d3..5d27212=20100644=0A---=20a/lisp/cedet/ede/locate.el=0A+++=20=
b/lisp/cedet/ede/locate.el=0A@@=20-206,6=20+206,36=20@@=20that=20created=20=
this=20EDE=20locate=20object."=0A=20=20=20=20=20)=0A=20=20=20)=0A=20=0A=
+;;;=20PROJECTILE=0A+;;=0A+=0A+(defclass=20ede-locate-projectile=20=
(ede-locate-base)=0A+=20=20((projectile-file-cache=20:initform=20nil=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
:documentation=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20"List=20of=20files=20in=20this=20project=20=
according=20to=20projectile."))=0A+=20=20"EDE=20Locator=20using=20=
Projectile.")=0A+=0A+=0A+(defun=20ede-create-projectile-cache=20=
(project-root)=0A+=20=20"Create=20a=20list=20of=20project=20files=20as=20=
reported=20by=20projectile.=0A+The=20list=20is=20cached=20because=20it=20=
would=20be=20too=20heavy=20to=20call=0A+`projectile-all-project-files'=20=
every=20time=20--=20which=20allocates=20an=0A+entire=20list=20with=20=
every=20call."=0A+=20=20(let=20((default-directory=20project-root))=0A+=20=
=20=20=20(mapcar=20(lambda=20(x)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20(concat=20project-root=20x))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
(projectile-current-project-files))))=0A+=0A+(defmethod=20=
ede-locate-file-in-project-impl=20((loc=20ede-locate-projectile)=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20filesubstring)=0A+=20=20=
"Locate=20occurances=20of=20FILESUBSTRING=20under=20the=20project=20root=20=
in=20LOC."=0A+=20=20(progn=0A+=20=20=20=20(when=20(null=20(oref=20loc=20=
projectile-file-cache))=0A+=20=20=20=20=20=20(oset=20loc=20=
projectile-file-cache=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
(ede-create-projectile-cache=20(oref=20loc=20root))))=0A+=20=20=20=20=
(-filter=20(lambda=20(x)=20(string-match-p=20filesubstring=20x))=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20(oref=20loc=20projectile-file-cache))))=0A=
+=0A=20;;;=20GLOBAL=0A=20;;=0A=20=0A--=20=0A2.5.4=20(Apple=20Git-61)=0A=0A=

--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 26 Mar 2016, at 4:49 PM, Edward Steere <[email protected]> =
wrote:
>=20
> Hi All,
>=20
> This is the first in a series of four patches I=E2=80=99m submitting =
today.
> This one adds support for projectile to EDE-locate.
>=20
> The implementation is very simple, it just uses projectile as a way of
> getting a list of files for this project. When we search for a file it =
just runs
> filesubstring as a regular expression against all those files.
>=20
> Usage:
>=20
> (setq ede-locate-setup-options
>          '(ede-locate-projectile
>            ede-locate-base))
>=20
> Originally I wanted to store the files in a trie using the trie =
library, but
> that seems to run into problems with the size of keys (absolute paths)
> for java projects. I find that this implementation works well enough
> ito performance across the various machines which I use.
>=20
> Kind regards,
>=20
> Edward Steere
>=20
> <0001-Added-projectile-back-end-to-ede-locate.patch>


--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel

--Apple-Mail=_B3FF91BE-9ED3-4315-8897-16D696F5F139--