jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Update to my Jed macros page


On Thu, Oct 13, 2005 at 09:05:11AM +0100, Peter Bengtsson wrote:
> Dave,
> I've been using your search_current_word macro for a long time now and
> find it very useful. It's great for programming where I put the cursor
> right where a function is called, press the key combo and with a bit
> of luck end up where the function is defined.
> Just one thing... If the current word is "getFoobar" then what it
> searches is "getFoobar"; if instead the current word is "get_foobar"
> and I have the cursor between the two "o"'s, then what it searches for
> is "foobar" only.
> 
> With my un-understanding of slang understand (at least) that it's not
> your fault. The culprit is get_word() from txtutils.sl. Digging
> deeping in txtutils I think the culprit is that stuff about Word_Chars
> where I'm not totally lost.

I believe that Word_Chars is local to to txtutils.sl.  Use
define_word() instead.  See more below.

> 
> I'm wondering if perhaps you can help me solve this problem because it
> would really make search_current_word useful for me.
> 
> Peter
> 
> PS. If the cursor is at the beginning of the word "this" of
> "is_this_astring" and I press Ctrl-D to kill the forward word, then I
> still want it only to delete the word "this" like my setup currently
> allows.

This behavior is controlled by define_word().  In my .jedrc, I have:

    define_word("_A-Za-z0-9");

So, the behavior of search_current_word is not a problem for me.

But, you are right, in that this causes skip_word, bskip_word, and
kill_word to work across underscores.  To get the behavior you
want, you can add something like the following at the beginning of
search_current_word:

    define_word("A-Za-z0-9");

and this at the end:

    define_word("_A-Za-z0-9");

Thanks for pointing this out, because I did not realize that it
could be a problem.  I'll add a note in my macros document.

Hope this helps.

Dave

[snip]

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]