Yesterday on the TextMate irc channel the [gSpell service for OSX][1]
was mentioned, which is a fairly neat way of spell checking (more
details on the gSpell homepage.) I decided to try and simulate the
service as a TextMate command which takes a selection and looks up
the most reasonable alternative with Google.
[The tmCommand is Available here.][2]
[1]: http://nspindel.com/gspell/
[2]: http://homepage.mac.com/andy.herbert/.Public/Check%20Spelling%
20Using%20Google.tmCommand
Hello,
Is it reasonable to have a 'find string' fail only because I happened to
have all the text selected in the document window? Changing the
selection text back to an ibar cursor seems to have made the sought
after string to be found without any other changes to the contents of
the document. That seems to have been my experience however I have not
re-examined this to be sure.
Cheers
AZ
> regarding to the multiple word checking I found a way to do it, but
> in Ruby I have no idea to get the REAL length of a (I guess) UTF-8
> string. The point is that s="Fähre" s.length returns 6 not 5. I tried
> to set $KCODE = 'UTF-8' in the script but it doesn't work.
Take a look at the new Rails Multibyte character support, I think
they tackled this problem already and the patches might point you in
the right direction. Hell, you might be able to swipe their string
extensions outright ;)
- Ben
Hello,
After a recent update (I'm not sure which one) to TextMate, I'm
finding that every time I write a comment in Python:
# whatever
and press Return at the end of the line, that TextMate is filling in
"# " at the start of the next line. This is really getting in my way,
and I'd like to turn it off -- but I can't find which trigger is
responsible for this.
I thought at first it'd be the "Continue Line Comment" snippet in the
Source bundle, but that triggers on Enter.
Is there any way to find out which command/snippet is responsible for
this without going through all bundles one by one?
Andrew
>Thanks. I like the --with-file, but the --with-directory could get
>annoying if you regularly want to save copies to a different
>directory.
Duplicating to the same directory is my most common use case. However there's always scope for both, ie adding the second
version to shift-apple-D.
If I remember correctly then --with-file will only work when --with-directory is specifed.
El 23/04/2007, a las 14:00, textmate-request(a)lists.macromates.com
escribió:
> De: Allan Odgaard <throw-away-1(a)macromates.com>
> Fecha: 23 de abril de 2007 03:03:18 GMT+02:00
> Para: TextMate users <textmate(a)lists.macromates.com>
> Asunto: Re: [TxMt] QuickOpen included files
> Responder a: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 20. Apr 2007, at 20:59, Juan Falgueras wrote:
>
>> I have change the source of the list of paths for QuickOpen
>> included files. It works fine:
>
> Thanks, seems to work fine here as well. Some comments:
>
> • we should differ between <system> and "user" include paths
actually the script does consider <system> and "user" paths and get
first the "user" path not looking for TM_HEADER.. when "user"
if (!$header) {
$line =~ /#\s*include\s*([<"])(.*?)[">]/;
$local = $1;
$header = $2;
}
if ($local eq '"') {
$t = $ENV{'TM_DIRECTORY'};
if (-f "$t/$header" ) {
print "$t/$header";
system("mate -r \"$t/$header\"");
exit 0;
}
}
> • TM_HEADER_SEARCH_PATHS should default to the output from gcc/g+
> + (to not require user setup)
I have thought about it but, when? If you ask for echo | g++ -E -
v -x c++ - and then analyze the output (with the A.Tomazos perl
script, for example), you then don't want any TM_HEADER_SEARCH_PATHS,
but instead, to call to the g++ compiler for this. I've thought this
must be slow, and the answer to the previous query is near always
the same.
> • search path could depend on whether we are in source.c or
> source.c++ (the former has a smaller search path)
yes. The difference is (in my system):
C++
/usr/include/c++/4.0.0
/usr/include/c++/4.0.0/powerpc-apple-darwin8
/usr/include/c++/4.0.0/backward
/usr/local/include
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include
/usr/include
/System/Library/Frameworks
/Library/Frameworks
versus
C
/usr/local/include
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include
/usr/include
/System/Library/Frameworks
/Library/Frameworks
I have used the most frequently used C++ :)
> • additional search paths should be taken from the current Xcode
> project file, if any (and Xcode’s products build dir should also
> be a search path for frameworks)
oups! don't use XCode, sorry. I think it must be done asking XCode
(via AS) or hacking the XCode project file... (complicated and dirty) :(
> • need to handle framework inclusion, e.g. <Cocoa/Cocoa.h>
you are again wright:
% locate Cocoa.h
/Developer/ADC Reference Library/documentation/Cocoa/Cocoa.html
/Developer/ADC Reference Library/documentation/Cocoa/Conceptual/
CarbonCocoaDoc/Articles/CarbonInCocoa.html
/Developer/ADC Reference Library/documentation/Cocoa/Conceptual/
CarbonCocoaDoc/Articles/CarbonUIInCocoa.html
/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/
Cocoa.framework/Versions/A/Headers/Cocoa.h
/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/
JavaEOCocoa.framework/Versions/A/Headers/EOCocoa.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
Cocoa.framework/Versions/A/Headers/Cocoa.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
JavaEOCocoa.framework/Versions/A/Headers/EOCocoa.h
/System/Library/Frameworks/Cocoa.framework/Versions/A/Headers/Cocoa.h
is not found by this simple script and there are:
% find /System/Library/Frameworks/ -iregex ".*\/Headers\/.*\.h" | wc -l
2112
many.
It was not a problem for me since I am working in a UNIX standard
programming way...
> • need to handle import as well as include (in the regexp)
is is easy to add it
>
> And if I understood Chris correctly, he’d like to optionally
> search under /Developer/SDKs/«chosen SDK».
As far as I have understood this is included in your Frameworks plus
XCode dirs expansion search
>
> Are there other things we’d like to support?
(;
Hi,
Two things tripped me up just now using the reST bundle:
(1) I'm not sure if it's broken or not, but the Validate Syntax
command didn't work for me as it stands, and it's the first line
that's tripping it up for me:
`TRST=${TM_PYTHON:=rst2html.py}`
I found that most of the rest commands used `TRST=$
{TM_RST2HTML:=rst2html.py}` and when I switched it in for that, it
seems to be working.
Just out of curiousity, where/how is this $TM_RST2HTML environment
variable getting set, anyway (and what's `:=`)?
(2) I feel like the "Convert Document to HTML" command should have
its output set to "Create New Document" instead of replacing the reST
in the file w/ the HTML so you don't blow out the file you've been
working on.
Thanks,
-steve
Hi,
I have to write much XSL stuff. I use among others the snippet
collection of Andreas Schöller (BTW thanks for that).
He was so kind to add information about the valid values of parameters.
example:
Snippet ou =>
<xsl:output
name=""
encoding="utf-8|ASCII|US-ASCII|iso-8859-1|utf8|KOI8R|cp1251"
indent="no|yes"
use-character-maps="mapping1 mapping2"
method="text|html|xml|xhtml"
/>
As usual I can use TAB to jump to each ${n:} token.
Now my question:
Would it be possible to convert e.g. the token 'text|html|xml|xhtml'
into a pull-down menu?
I tried it this way:
After pressing TAB TM highlights 'text|html|xml|xhtml'; I invoke a
command:
`echo -en "$TM_SELECTED_TEXT" | ruby -e '
require File.join(ENV["TM_SUPPORT_PATH"], "lib/dialog.rb")
words = STDIN.read().split("|")
print words[(Dialog.menu words)]
'`
and I can choose what I want. After that, of course, I cannot use TAB
to navigate through the snippet any more, unfortunately.
I also tried a snippet like:
<xsl:output method="${1:`echo -en "text|html|xml|xhtml" | ruby -e '
require File.join(ENV["TM_SUPPORT_PATH"], "lib/dialog.rb")
words = STDIN.read().split("|")
print words[(Dialog.menu words)]
'`}" encoding="${2:`echo -en "utf-8|ASCII|US-ASCII|iso-8859-1|utf8|
KOI8R|cp1251" | ruby -e '
require File.join(ENV["TM_SUPPORT_PATH"], "lib/dialog.rb")
words = STDIN.read().split("|")
print words[(Dialog.menu words)]
'`}"/>
In principal this works and the TAB behaviour isn't disturb but I
have no visual feedback what I'm typing while the menus popping up
and the TAB mechanism starts at token 1 which I already entered.
Would it cost much effort to implement such a behaviour? Meaning if I
press TAB and within the new selection occurs a given delimiter (here
| ) or tag or what ever that the snippet parser will show this
selection as pull-down menu automatically without distroying the TAB
mechanism.
And, would it make sense as a global snippet feature?
Regards,
Hans
Forgive me if this is way too rudimentary of a question, but: I use TextMate
to compose some of my blog posts, and sometimes I copy/paste in text from
interviews I've done via email (or even chat). Is there any way to make
TextMate recognize when there's been a line break between two paragraphs and
auto-insert break tags? As it stands now, I need to go in and insert two
tags after every line-separated paragraph my interviewees write, which is
becoming a PITA.
Any thoughts are much appreciated
David Chartier
--
My work:
professional blogger, The Unofficial Apple Weblog: http://www.tuaw.com
Assistant Lead Editor, Download Squad: http://DownloadSquad.com
My play:
1FPS: http://www.dcharti.com/blog/
Vox: http://dcharti.vox.com
Hi
using Perl and C/C++ etc.. I think it would be very useful to
recognize (grammatically) when a call to a function is done. I know
this can be near impossible to solve (with regexps) in the Perl case,
since there is no need and many people not use parenthesis after the
name of the function. Anyway if you use them it should easily be
easy to recognize as function call.
If function calls are grammatically recognized, then the power of TM
will be increased with thinks like colouring, jump to the definition
(only active when in a function call scope), etc.
Juan F.