Projectile Support for Locate
Edward Steere <[email protected]> Sat, 26 Mar 2016 16:49:20 +0200
| Newsgroups | gmane.emacs.cedet |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_63B0FD75-B06E-4AD0-9F52-7366AD4BF995
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Hi All,
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.
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.
Usage:
(setq ede-locate-setup-options
'(ede-locate-projectile
ede-locate-base))
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.
Kind regards,
Edward Steere
--Apple-Mail=_63B0FD75-B06E-4AD0-9F52-7366AD4BF995
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=20df477288eea53643c8a4623e2317c420889a832c=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=
1/4]=20Added=20projectile=20back=20end=20to=20ede-locate.=0A=0AVery=20=
simple=20implementation.=20It=20uses=20LOC=20to=20detect=20the=20root=20=
of=20the=0Aproject=20and=20uses=20that=20to=20select=20the=20relevant=20=
projectile=20project.=20The=0Aonly=20method=20which=20it=20overrides=20=
from=20the=20base=20locate=20object=20is=20the=20locate=0Aimplementation=20=
for=20which=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|=2027=20+++++++++++++++++++++++++++=0A=201=20=
file=20changed,=2027=20insertions(+)=0A=0Adiff=20--git=20=
a/lisp/cedet/ede/locate.el=20b/lisp/cedet/ede/locate.el=0Aindex=20=
d8b29d3..7273532=20100644=0A---=20a/lisp/cedet/ede/locate.el=0A+++=20=
b/lisp/cedet/ede/locate.el=0A@@=20-206,6=20+206,33=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+(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(projectile-all-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=_63B0FD75-B06E-4AD0-9F52-7366AD4BF995
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=278785351&iu=/4140
--Apple-Mail=_63B0FD75-B06E-4AD0-9F52-7366AD4BF995
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=_63B0FD75-B06E-4AD0-9F52-7366AD4BF995--