Re: [CEDET-devel] Patch adding EDE simple integration for one of Java SRecode macros
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2013-01-24 22:19:05
|
On 01/24/2013 11:15 AM, Vladimir Kazanov wrote: > Hi all! > > Recently I started using SRecode for smart templating. First thing I > noticed was that java empty file template does not try to use EDE to get > correct package name. Instead, it uses a simple heuristic: looks for > "src/" in buffer file, and uses it to extract package name for a Java class. > > The patch included leaves the heuristic, but first it checks if there > are any source paths specified for current project, and uses them for > package name generating. > > It would be nice, if someone could check the patch and consider adding > it into trunk. I believe my ELisp is still a bit... Clumsy. Both > comments and critic are welcome! I posted the below patch last week to add a :project argument available to templates. You could use it to improve your patch. I think a dilemma is that it only works if you have a project, so perhaps this needs to be updated to have a fallback value. Anyway, multiple languages seems to have its own "turn the file into a symbol". With two questions in the same month on the same topic, it probably makes sense to create an mode local function for it. I hadn't checked this in yet as I was still contemplating its value. I suspect there is something bigger here. In the meantime, you will probably like the way to calculate the relative path name in this patch. Eric |