Re: emacs / distel problem with dynamic tags

[email protected] Thu, 05 Jul 2007 06:56:00 +0100
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Bill,

"Bill Clementson" <[email protected]> writes:

> On 7/4/07, [email protected] <[email protected]> wrote:
>> In other words, the old behaviour of "C-u M-x
>> erl-find-source-under-point" is identical to the (old and new) behaviour
>> of "M-x erl-find-mod".
>>
>> Actually, that's not quite true. C-u M-x erl-find-source-under-point
>> defaults the selection to the module/function under the point, whereas
>> erl-find-mod does not. Also, erl-find-mod is not bound to a convenient
>> key sequence.
>
> Yes, in fact I didn't realize it even existed before you commented on
> it. [...] I had the feeling that there might be "legacy code" reasons
> for it being in distel as its functionality seems to have been
> subsumed by erl-find-source-under-point.

The two commands are indeed very similar.

> Actually, the default that is displayed when you do "C-u M-." is m:f/a
> (where the "a" is the arity). Since I'm still a newbie at erlang, I
> frequently press "C-u M-." on a function and specify a different "a"
> value. I don't know if this is common or not; however, I seem to do it
> on a regular basis.

That is a reasonable use case.

> My personal preference (at the moment), would be a) as I would almost
> always have switched to the node that I would be doing the "C-u M-."
> lookup on prior to my doing the command. However, this is probably due
> to my erlang newbie status and I would probably find that I do want to
> do source lookups on other nodes in the future. However (when I
> consider how I usually use "M-."), I might be quite happy with a) even
> once I'm more accomplished with erlang since the need to press ENTER
> on the node for c) is compounded when you're doing multiple m:f/a
> lookups. For example, I will often do multiple source lookups on
> functions with different arities as I drill down into functions that
> are called by the function that I initially go to. And, once I've
> changed the node, I no longer have to specify the node again on
> subsequent searches whereas with c) I would have to press ENTER at the
> node prompt each time.

ok. Let's stick with a) (the old behaviour) then, until enough people
complain about the inconsistency. Currently it's just me ;)

> Option b) and d) are probably bad choices as they negatively impact
> users who are accustomed to using "C-u M-." as it existed before the
> mods. I don't really like the idea of having multiple key bindings
> (nor multiple commands) for source lookup. So, I guess that (if I had
> to pick only one option) I would select a) and eliminate erl-find-mod
> altogether. However, I guess that other people might be using
> erl-find-mod as well, so eliminating erl-find-mod probably isn't an
> option. For the same reason (e.g. - other people are used to using
> "C-u M-." to specify a m/f/a for a source lookup), options b) and d)
> probably aren't good options.

We should not worry about backwards compatibility too much. The distel
user base is quite small and in any case folks who desperately want the
old behaviour back can just engage in some minor elisp hackery to do so.

So let's get rid of erl-find-mod.

> However, I like the mod you made to erl-target-node and it is good to
> try to keep behaviour consistent (although an argument could be made
> that the prefix arg node selection functionality should only apply to
> distel functions that have "node" as an argument and erl-find-source
> does not have "node" as an argument and it has always done a search on
> the current node). So, option c) would be the option that I would most
> favour if you feel that it is still a good idea to do prefix arg node
> selection with "C-u M-.".

Option c), node name defaulting and history, would be a valuable
addition in any case. I won't have time to work on this over the next
few days, but if yo want to have a go just take a look at the elisp docs
for read-string as a starting point.


Matthias.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/