Heil Jed and Dave Kuhlman

09 May 2004   1 comment   Linux

Powered by Fusion×

I've said it before but I have to say it again: jed rocks! Now even more thanks to Dave Kuhlmans SLang script. (jed is a text editor that makes Emacs look like a space shuttle and MS Word like a snail)

Granted that this is more for programming than to write a book but it's still worth noting. I can now with one key command search backwards and forwards on the word that the cursor is currently at. The alternative before was to start searching and on the dialog you write the word that you're looking for. What a waste of time! Plus, with the old way it happens often that you misspell the word you intend to find. This is ideal when you're programming because you often want to inspect where a variable or a function is coming from or how it will be used. I suspect that it will take some getting used to but it was the same story for the emacs bindings and now they are second nature.

Can't find the archived mailing list email he sent but there's the code:

autoload("get_word", "txtutils");

define search_current_word(direction)
{
    variable word;
    variable mark;
    variable result;
    variable s1;
    mark = create_user_mark();
    skip_word();
    bskip_word();
    word = get_word();
    if (direction == 1)
    {
        while (1)
        {
            go_right_1();
            result = fsearch(word);
            if (result == 0)
            {
                break;
            }
            % Search again if the word is a substring of a longer word.
            s1 = get_word();
            !if (strcmp(s1, word))
            {
                break;
            }
        }
    }
    else
    {
        while (1)
        {
            result = bsearch(word);
            if (result == 0)
            {
                break;
            }
            % Search again if the word is a substring of a longer word.
            s1 = get_word();
            !if (strcmp(s1, word))
            {
                break;
            }
        }
    }
    if (result == 0)
    {
        goto_user_mark(mark);
        message(word + " not found");
    }
}

% Bind to Alt-z+Alt-comma (alt-z then alt-comma) and Alt-z+Alt-period.
setkey ("search_current_word(-1)", "\ez\e,");
setkey ("search_current_word(1)", "\ez\e.");

Comments

Peter
And here's the web page about it.
http://www.rexx.com/~dkuhlman/jed_macros.html
Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
Obfuscating C contest running now 07 May 2004
Next:
Distributed compiling with distcc 09 May 2004
Related by keywords:
EditArea vs. CodePress 03 January 2008
Local jed settings 19 April 2013
Wing IDE versus Jed 11 December 2008
Gmail shortcuts 26 April 2005
Mvbackupfiles - a script to "delete" back autosaved backup files 24 November 2005
Jed Tags with ntags (for dummies) 11 February 2006
Make your settings in .Xdefaults come true 16 November 2004
Jed looking like Emacs 28 September 2005
Keybinding ALT-F in Jed 27 January 2004
Geeking with tags file for Jed 29 May 2006
Geeking with Eterm and Tkinter 09 February 2006
Dabbrev in Jed 26 January 2004