Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Combine TextExtras and 10.3's completion features System
Mike Ferris' TextExtras (amongst a zillion other things) provides keyword based expanion (e.g. typing adr followed by escape could be expanded to your full street address) and a completion mechanism that searches the current text field for possible matches.

Since Panther comes with its own implementation of a completion mechanism (that searches both the document and a dictionary), I was looking for a combination of TE's keyword based expansion and Panther's completion. Since we're going to modify TE, you need to have Xcode installed.

Add the following lines to file NSTextView_TETextExtras.m after line 328:

else{
    [self complete:sender];
    return;
}
Build and install your new version of TE, and change the line in ~/Library/KeyBindings/DefaultKeyBinding.dict that says
"\033" = "complete:"; 
to
"\033" = "TE_complete:";
[robg adds: I haven't tested this one yet, but hope to soon - TextExtras is a great add-on!]
    •    
  • Currently 2.83 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[11,301 views]  

10.3: Combine TextExtras and 10.3's completion features | 10 comments | Create New Account
Click here to return to the '10.3: Combine TextExtras and 10.3's completion features' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Combine TextExtras and 10.3's completion features
Authored by: jiclark on Nov 07, '03 03:55:10AM

Don't suppose you could post more elaborate instructions for how to do this... I have no idea what you're talking about as ait is!

---



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: Spartacus on Nov 07, '03 05:02:54AM

Yes, me too.



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: aranor on Nov 07, '03 05:26:16AM

Download the source to TextExtras. You can find it on Google. Open it up in XCode. Open the NSTextView_TETextExtras.m file. Go to line 328. Add the code listed there. Compile it. Install it. Install the DefaultKeyBindings.plist file as well. Open that up in BBEdit (or any other text editor) and change the line as listed. Now open up a Cocoa app and test it.



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: Spartacus on Nov 07, '03 05:41:59AM

Sure, but do we have a chance of knowing what it does without installing it? What's "Panther's own implementation of a completion mechanism (that searches both the document and a dictionary)?"



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: da5idonimac on Nov 07, '03 06:14:59AM

an example: open up a cocoa-application (such as text edit) and type the first few letters of a word, then hit F5. a list of words in the dictionary (and the document) will appear ina drop-down-menu, allowing you to select the word you wanted to type...



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: sapporo on Nov 07, '03 06:34:51AM
What's "Panther's own implementation of a completion mechanism (that searches both the document and a dictionary)?"
Open a document in TextEdit (not to be confused with TextExtras :-), type Pant<option-escape> and you'll get a drop down menu of available completions, including the words in your document starting with "Panth" plus all the words in the dictionary starting with "Panth".
Sure, but do we have a chance of knowing what it does without installing it?
The feature set of TextExtras is well beyond the scope of this hint, but it lets you define shortcuts to be expanded upon typing the completion key (option-escape by default). An Example for expansion would be typing adr<option-escape> to get 1 Infinity Loop (where completion would give you a list of words starting with adr). I just provided instructions to make the two completion mechanisms compatible.

[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: Cap'n Hector on Nov 07, '03 12:52:31PM
When I tried to compile the TextExtras I get an error when compiling it: Compiling PipeDOBackChannel/TESetMenu/TESetMenu.m (1 error, 1 warning) PipeDOBackChannel/TESetMenu/TESetMenu.m:197: parse error before `int' PipeDOBackChannel/TESetMenu/TESetMenu.m:173: warning: `doActionWithArguments' defined but not used How should I fix this?

[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: bluehz on Nov 07, '03 09:42:52PM

I get the compilation errors also - but the final bundle is created in the build dir and appears to be quite functional.

Whats the process with the auto-completion though - I have added some words in my TE auto-completion (like the example above "adr") but they never seem to show up in the auto-completion list when I activate it. Even after relaunching an application.



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: aranor on Nov 08, '03 01:13:20AM

Did you redefine the keybinding? If you don't, all you get is Panther's default completion.



[ Reply to This | # ]
10.3: Combine TextExtras and 10.3's completion features
Authored by: bluehz on Nov 08, '03 09:32:12AM
Yes - I did redefine the keyboard. Aftert thinking about it a bit more - I remembered that I had tried TextExtras several times before in various OS versions and it always caused problems. I want it to work. I REALLY want it to work. Great features... but... ... well for one thing... I woke up this morning to find my machine totally locked up (I leave it running 24/7) and it was kenel paniced and frozen solid. I can't remember the last time I had a kernel panic. Whats new? TextExtras... Also - took a look at the Safari crash log... shown below... Sign... guess I'm gonna have to dump TE once again....
Command:    Safari (/Applications/Safari.app/Contents/MacOS/Safari)
PID:        1330
Thread:     0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbf7fff80

Thread 0 Crashed:
 #0   0x900038e0 in __vfprintf (__vfprintf + 32)
 #1   0x900070b0 in sprintf (sprintf + 176)
 #2   0x902882c4 in CreateVolFSPath(unsigned, unsigned long, char const*, unsigned long, char*) (CreateVolFSPath(unsigned, unsigned long, char const*, unsigned long, char*) + 88)
 #3   0x90286358 in getattrlist_retry (getattrlist_retry + 68)
 #4   0x902855ac in GetVolFSAttributes(VolumeInfo*, unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned long, FSVolAttributeInfo*, unsigned char*) (GetVolFSAttributes(VolumeInfo*, unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned long, FSVolAttributeInfo*, unsigned char*) + 408)
 #5   0x9028c7a0 in VolFSMount::_getattrs(unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned char*) (VolFSMount::_getattrs(unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned char*) + 52)
 #6   0x902890f4 in FSMount::getattrs(unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned char*) (FSMount::getattrs(unsigned long, char const*, unsigned long, unsigned long, FSAttributeInfo*, unsigned long, unsigned char*) + 224)
 #7   0x9028c2e8 in GetFSRefAttributes(FSMount*, FSRefPrivate const*, unsigned long, FSAttributeInfo*, unsigned long, char*) (GetFSRefAttributes(FSMount*, FSRefPrivate const*, unsigned long, FSAttributeInfo*, unsigned long, char*) + 104)
 #8   0x9028c394 in PBGetCatalogInfoSync (PBGetCatalogInfoSync + 148)
 #9   0x90295d64 in FSGetCatalogInfo (FSGetCatalogInfo + 44)
 #10  0x92432304 in 0x92432304
 #11  0x924318e4 in 0x924318e4
 #12  0x924392a0 in 0x924392a0
 #13  0x90a5a7f0 in _NS_LSCopyItemInfoForRef (_NS_LSCopyItemInfoForRef + 96)
 #14  0x90a19d9c in +[NSFileAttributes attributesAtPath:traverseLink:] (+[NSFileAttributes attributesAtPath:traverseLink:] + 664)
 #15  0x0090d0a4 in -[TEPreferencesController readCompletionDictIfNeeded] (TEPreferencesController.m:806)
 #16  0x0090a19c in -[TEPreferencesController completionDictionary] (TEPreferencesController.m:408)
 #17  0x00912358 in -[NSTextView(TETextExtras) TE_complete:] (NSTextView_TETextExtras.m:321)
 #18  0x009125d8 in -[NSTextView(TETextExtras) complete:] (NSTextView_TETextExtras.m:418)
 #19  0x009123dc in -[NSTextView(TETextExtras) TE_complete:] (NSTextView_TETextExtras.m:332)
 #20  0x009125d8 in -[NSTextView(TETextExtras) complete:] (NSTextView_TETextExtras.m:418)

--- text elided ---
--- line above continued for several hundred more ---

 #507 0x009123dc in -[NSTextView(TETextExtras) TE_complete:] (NSTextView_TETextExtras.m:332)
 #508 0x009125d8 in -[NSTextView(TETextExtras) complete:] (NSTextView_TETextExtras.m:418)
</code></pre>


[ Reply to This | # ]