Improving the Emacs OPI

Torsten Anders torsten.anders at plymouth.ac.uk
Mon Feb 18 17:01:18 CET 2008


Dear all,

actually, what I need most is not just the automatic completition of  
some Oz variable name etc., but some information about the interface  
of, e.g., a procedure. For example, I meanwhile know the Record  
functor more or less by hard, and when I forgot some proc I may just  
browse/inspect the functor itself.

However, for years now I am constantly re-checking the order of  
certain procedure arguments in the documentation. Would be a great  
time-saver if the editor could help us there! With a working Oz TAGS  
file for Emacs (see my former mail), we could, e.g., jump to the  
definition of some procedure with a single keystroke to see its  
interface (perhaps even its documentation!), or edit its code.

I should perhaps mention that the TAGS generation approach reported  
before does already work in principle for procedures, functions, and  
class methods. For not explicitly supported languages like Oz, the  
etags program can simply find positions in a file which match a  
regular expression and records file and position of the matches.  
What's missing is that the functor variable for each file is added  
before each tag (except for class methods). For example, a function  
Foo in file MyFunctor.oz should actually be MyFunctor.foo. I could  
automatically edit the resulting TAGS file with some script which  
inserts the most likely functor name before the variable names.

Still, this approach does not always work. The local Oz variable  
names within a functor and the exported features may differ. Also, I  
can not automatically conclude from the file name how the  
corresponding functor variable is called (although it is often the  
same). But any further improvement probably means to parse all Oz  
source files, which seems like overkill to me. Any better idea?

Best
Torsten

On Feb 18, 2008, at 2:46 PM, Filip Konvička wrote:
> Yves Jaradin (18.2.2008 15:37):
>> Le lundi 18 février 2008 à 14:45 +0100, Filip Konvička a écrit :
>>
>>> Hi Torsten,
>>>
>>>> I would highly welcome any improvements to the Emacs OPI. For  
>>>> example,
>>>> I once started working on creating a TAGS file for Oz which  
>>>> would then
>>>> allow for code completition etc. Unfortunately, this attempt got  
>>>> never
>>>> to a stage where it really got useful. Nevertheless, I am  
>>>> posting the
>>>> present shell command here (see below). Perhaps someone is  
>>>> interested
>>>> to collaborate so we get this thing working, or someone already has
>>>> even finished something related..
>>>>
>>> just my quick tip, in case you didn't know, Alt+/ works for me -  
>>> it's
>>> called dynamic completion or something like that, and it works  
>>> most of
>>> the time (hold Alt and press / repeatedly to cycle). I'm using  
>>> XEmacs,
>>> and I think GNU Emacs has this as well.
>>>
>>> Hope this helps,
>>> Filip
>>>
>>>
>> When I was talking about intelligent completion, I was thinking more
>> along the lines of Eclipse or other such IDE which do abstract
>> interpretation of the code to find exactly what's allowed at the  
>> cursor
>> point.
>> Anyway, this is quite a fine trick :-)
>>
> Sure, that would be cool, but this one is fast, cheap and  
> configurable.
> For example, it can search other open files when you have multiple  
> files
> open. It's the famous 80 / 20 to me. Most of the time, you get quickly
> what you need.
>
> F.
>
> ______________________________________________________________________ 
> ___________
> mozart-hackers mailing list                           mozart- 
> hackers at mozart-oz.org
> http://www.mozart-oz.org/mailman/listinfo/mozart-hackers

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de






More information about the mozart-hackers mailing list