I get an occasional email attachment that shows up with a begin 644
and a bunch of characters. I tried to run it through the uudecode and
get the following message:
uudecode: \n\tinput file: stdin\n\tencoded file:
IntCollect.txt-072709.txt\n\tcharacter out of range: [33-96]
Can someone help. Can I use texmate to fix files like this?
Hello, everyone
I am new to Textmate and all the snippets stuff, but I am recently
working on a Mediawiki file which uses the mediawiki bundle, and I made
some new snippets such as inserting images to the page, is there anyway
I can submit it to the svn? So everyone else can use it?
Cheers
Allen
After a year and half of development and testing and some hints to the world
at large now and then, I've finally decided to release RubyFrontier into the
wild.
RubyFrontier is a TextMate bundle. It implements a Web site framework
basically modelled after the UserLand Frontier Web site framework, written
in Ruby. In other words, it's a tool for writing and maintaining Web sites.
Documentation and description here:
http://www.apeth.com/RubyFrontierDocs/default.html
Incredibly great new screencast here (rather long, take it in stages or at
least have a coffee machine sitting next to you the whole time):
http://www.apeth.com/rubyFrontier.mov
The download:
http://sourceforge.net/projects/rubyfrontier/
Share and enjoy. Tell a friend (if you have one). m.
PS I don't want to make a big sentimental thing of this, but just for the
record, this would have been *totally* impossible without TextMate. I was
completely up a creek about how to migrate out of Frontier until I realized
that TextMate would handle the whole interface for me.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
Hi all,
has anyone had problems with specifying the master file in compiling Sweave
documents?
I've set the TM_SWEAVE_MASTER variable in the given Textmate project (also
tried with TM_LATEX_MASTER) but it wouldn't compile from the master file
when I run "Sweave, Typeset and View" from another Sweave file in the
project.
Thanks for any hint,
Stephane
> On 2/1/09 1:08 PM, in article A6DF15FC-7FE8-4C82-92CF-
> F9AFE6EA9BCF@...,
> "Gert van Oss" <gertmt@...> wrote:
>
> > Last week I read an article re. where a bundle 'RubyFrontier' was
> .......
> > confirm that it is not available yet.
>
> See me after class. :) m.
great an opportunity for me to learn Ruby and built sites in a
structured way!
Thanks a lot for the in-depth introduction via the screencast.
Gert
On Jul 22, 2009, at 8:00 AM, Allan Odgaard wrote:
> While recording the macro press ?F and enter the text, then click the
> find action you want (next). This saves a search for the given string
> (and options) in the macro, as opposed to just a ?find next? which
> you?d get, had you only used ?G.
Thanks, Allan, for identifying FindNext as the culprit. Works great now.
jon
Attempting to use the latest CVS bundle (checked out via git), I'm
finding that most of the CVS commands are not working in TextMate
v1.5.8 (1498). The History -> Log
and Revert commands worked, but others fail with errors like this
(from a diff attempt):
/Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:310:in
`to_plist': An object in the argument tree could not be converted
(ArgumentError)
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:310:in`block
in initialize'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:309:in`popen'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:309:in`initialize'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:20:in`new'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:20:in`dialog'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/progress.rb:42:in`call_with_progress'
from /Users/steve/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_diff.rb:13:in`diff_active_file'
from -:6:in `<main>'
or this (from a commit attempt):
/Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:212:in`eval':
wrong argument type Proc (expected Binding) (TypeError)
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:212:in`_capture_outer_self'
from /Users/steve/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:145:in`method_missing'
from /Users/steve/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:19:in `'
Each failed command leaves an untitled, unclosable window in its wake.
Anyone else see this? Is there a place to submit bug reports for
bundles?
Thanks,
Steve
When I want to use the Markdown --> Headings --> Level 1 [setext] /
Level 2 [setext] commands, I get the error message
"/tmp/temp_textmate.qXjdGq:11: undefined method `rstrip' for
nil:NilClass (NoMethodError)".
Textmate is Version 1.5.8 (1505) on Leopard 10.5.7 with the stock ruby
1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0].
I updated Markdown.tmbundle to r11632 and Support to r11693 but it didn't help.
Any idea what is going wrong here?
The Code of the Headings Command is:
#!/usr/bin/env ruby -wKU
require 'jcode'
# Split document into lines. Get current line number minus one for
# previous, minus another for ruby being 0 based.
lines = STDIN.readlines
line = ENV['TM_LINE_NUMBER'].to_i - 2
# Get length of previous line, using jlength for unicode
length = lines[line].rstrip.jlength
# Print same number of =
length.times { print "=" }
Regards, Sebastian R.
I'm confused about how to record a macro using a pre-defined text
string *without* defaulting to whatever was last in my Find dialogue.
For example, for use after invoking Edit-in-TextMate for an email
reply, I recorded a trivial macro that searches for
"On dateblah Jane Rodriguez wrote:"
then captures the first name using something like this
^.+? (\w+) \w+ wrote:$
and finally plops this at the top of my reply:
"Hi Jane,"
(What can I say, I'm a lazy correspondent.)
I've tried setting the macro both to local and global clipboards, and
also editing the macro syntax (with which I'm not terribly familiar)
to something like this:
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>argument</key>
<string>wrote:</string>
<key>command</key>
<string>findNext:</string>
</dict>
...
Seems like this should be easy, but I'm stuck--any help appreciated.
jon
PS: thanks to Jay Soffian for solving my JavaScript-as-TextMate script
question!
The Ruby on Rails bundle has the Control-Pipe keyboard shortcut for the "Call
Generate Scripts" function.
How do I enter the shortcut on an Apple Wirelss Keyboard? The pipe symbol is
on Option-7 there but Control-Option-7 does not work.
Your help is greatly appreciated.
-Ralf
--
View this message in context: http://www.nabble.com/How-to-enter-Control-Pipe-with-Apple-Wireless-Keyboar…
Sent from the textmate users mailing list archive at Nabble.com.
I've update my Ant bundle to include macros in the symbol list, as we
use a few in our build process. If anybody is interested, a patch is
attached.
Adam
Has anyone tried the bundle repository recently? It seems to be down,
ping also times out. Not sure if this is specific to my network
environment.. Is there anyone who is seeing the same symptoms?
--
Sangwhan Moon
Hi,
The 'Cleanup Whitespace' command in the Python bundle is very useful but is
cleaning up some whitespace that causes errors when I check for compliance
with PEP8. In the following code:
class test(object):
pass
PEP requires that the second line has no spaces, whereas 'Cleanup
Whitespace' adds 4. Would it be easy to fix this to be compliant with PEP?
Thanks,
Tom
--
View this message in context: http://www.nabble.com/Python-bundle-and-%27Cleanup-Whitespace%27-tp24558866…
Sent from the textmate users mailing list archive at Nabble.com.
Hi all,
I was wondering if there's a neat shortcut in Textmate to jump to capital
letters in word directly. Say I wanted my caret to jump to "That" in
"VeryLongWordThatIWantToEdit" using something akin to Option+right arrow
Thanks,
Stephane
Makes perfect sense. Thanks you for the through explanation... "_if_
there is a bundle in the Pristine Copy folder" was the part of the
puzzle I was missing... Thanks again!
>>>> How do you guys do it?
>>>
>>> I keep the bundles I hack on completely in ~/.../TextMate/Bundles,
>>> and
>>> those I mainly just _use_ in ~/.../Pristine Copy/Bundles. That way,
>>> editing my own bundles in TextMate changes exactly the files I want
>>> to
>>> push out, while my changes to other bundles is kept outside of their
>>> source tree and won?t lead to merge conflicts.
>>>
>>> Going back to git, when you create a repository on GitHub it gets
>>> you
>>> to a page containing step by step instructions for getting your
>>> source
>>> tree or local repository into the new remote repository.
>>
>> I'm not asking help on how to create a git repo or using github etc.
>> That's fine... What I'm not clear about is how you manage the
>> workflow
>> so that you don't have to copy the bundles to a different place and
>> just make the bundles you're using within TextMate repos themselves.
>> Or if you shouldn't do that at all? How do you "keep the bundles I
>> hack on completely in ~/.../TextMate/Bundles"? Do you manually copy
>> from the pristin/ folder first? Because the ~/.../TextMate/Bundles
>> only contains the changes you've made to~/.../Pristine Copy/Bundles
>> right? So you can't just push that without including what in Pristine
>> too. Or am I over thinking this somehow?
>
> Ah, I see. Sorry I misunderstood you before :-)
>
> ~/.../TextMate/Bundles only contains the changes from ~/.../Pristine
> Copy/Bundles _if_ there is a bundle in the Pristine Copy folder.
> That?s the destination TextMate installs to when you double-click
> bundles in the Finder, but you can just as well place bundles directly
> in ~/.../TextMate/Bundles.
>
> To summarize:
> - Assuming you start with a ?clean slate?, i.e. there is no version of
> your bundle in either ?/Bundles or ?/Pristine Copy, and
> - assuming you have a complete current version of your bundle around
> somewhere _else_, you would
> - copy (recursively) the bundle into your ?/TextMate/Bundles folder,
> then
> - do any git/generic-scm/other setup hubbub you want.
> After making changes in the Bundle Editor, your bundle contents will
> be changed _in place_, and you can perform your favourite version of
> the commit/push dance.
>
> As for combining a bundle?s Pristine Copy and tmDeltas, I find the
> easiest way for that to be:
> Just drag the bundle out of the Bundle Editor and drop it onto your
> desktop; the dropped bundle will include all of the deltas you want.
>
> Hope that?s more helpful?
> Martin
So I was in IRC asking Allan about this earlier today, but he said it was
still working in Leopard and
I could look in the source for any Snow Leopard issues (I've been
developing off and on with SL).
Well, I'm back on my Leopard side and it's broken here too. I
reinstalled the InputManager and still a no-go. It beeps at me when I
try to use the command (but as in SL, the bundle IS loaded as I can
see the command is there.)
So is anyone else suffering from a break with the "Edit in TextMate"
InputManager? I'd figured I'd poll the group at large before I start mucking
around or write it off as a non-working hack at this point.
-- Jesse
>> I got a HTML + CSS bundles that a few people use and I've been asked
>> to put them on github... So I'm looking into how you do that.
>> Ideally,
>> I'd like to just edit my bundles in TextMate, and push the update to
>> github when I come up with new snippet improvement, command, bug fix,
>> etc... But that mean I need to combine both of those (using mCSS as
>> example) first right?:
>>
>> ~/Library/Application Support/TextMate/Pristine Copy/Bundles/
>> mCSS.tmbundle
>> ~/Library/Application Support/TextMate/Bundles/mCSS.tmbundle
>
> I can?t see how this is related to git; don?t you have to do that
> anyway when you make your bundle available anywhere?
It's not directly related to git. I was just giving a little bit of
context so that people can understand what I'm trying to do. Now I can
see how my email subject might not be optimum... sorry.
>
>> How do you guys do it?
>
> I keep the bundles I hack on completely in ~/.../TextMate/Bundles, and
> those I mainly just _use_ in ~/.../Pristine Copy/Bundles. That way,
> editing my own bundles in TextMate changes exactly the files I want to
> push out, while my changes to other bundles is kept outside of their
> source tree and won?t lead to merge conflicts.
>
> Going back to git, when you create a repository on GitHub it gets you
> to a page containing step by step instructions for getting your source
> tree or local repository into the new remote repository.
I'm not asking help on how to create a git repo or using github etc.
That's fine... What I'm not clear about is how you manage the workflow
so that you don't have to copy the bundles to a different place and
just make the bundles you're using within TextMate repos themselves.
Or if you shouldn't do that at all? How do you "keep the bundles I
hack on completely in ~/.../TextMate/Bundles"? Do you manually copy
from the pristin/ folder first? Because the ~/.../TextMate/Bundles
only contains the changes you've made to~/.../Pristine Copy/Bundles
right? So you can't just push that without including what in Pristine
too. Or am I over thinking this somehow?
Thanks again!
Sorry for the noob question but...
I've just started getting into Git yesterday... (finally...) and I
can't quite figure out the best workflow to keep bundles on github up
to date.
I got a HTML + CSS bundles that a few people use and I've been asked
to put them on github... So I'm looking into how you do that. Ideally,
I'd like to just edit my bundles in TextMate, and push the update to
github when I come up with new snippet improvement, command, bug fix,
etc... But that mean I need to combine both of those (using mCSS as
example) first right?:
~/Library/Application Support/TextMate/Pristine Copy/Bundles/
mCSS.tmbundle
~/Library/Application Support/TextMate/Bundles/mCSS.tmbundle
How do you guys do it?
I did google it, but whatever I try I get a million posts talking
about bundles on Github and not how they actually get there...
I'm pretty shaky on Git still, so I understand if you don't have time
to explain the specifics, what I'd like is a general idea of the
workflow... I can research the rest. Thanks for any pointer!
Allan, Ciarán, all,
I used the phpdoc snippets a lot in TextMate. I also go back and add
to those phpdoc blocks. When I go back and edit those blocks TextMate
doesn't provide any help.
I created a command and snippet to help:
The Command provides Auto complete when you use a @ in a phpdoc comment.
The second file is a snippet for when you hit enter it puts an
asterisk at the start of the next line.
Timothy
I'm making some custom templates (among other things) for my favorite
languages, and I need some advice/best practices about them.
1. I heard that people are moving away from normal Templates and towards
Snippets for this purpose; is this correct?
2. One advantage I see with Snippets is that it lets me set the filename
(which I can then use) before calling the Snippet, which is not possible
with a Template unless I'm in a project. Is there some way around that with
Templates?
3. As I make these Templates, I'm finding a lot of common text between them,
and when I want to tweak it across the board...well, it's like programming
without functions. What, if anything, can I do to reduce redundancy in my
templates?
Thanks,
Neil.
In developing my bundle, I've been issuing feedback to the user with Create
New Document. Now that things are working decently, I want to switch to Show
As HTML. Here's the problem. Throughout my routines, when I want to issue
some feedback, I just say "puts". Now, however, using Show As HTML, I want
to wrap this in some way such that every time there is a "puts" I grab it,
shove a <br> on the end, and pass it along, so that my output appears
streaming into the HTML window as the script runs.
So, yeah, I could look thru all my code, find every "puts", and append the
<br> myself. But I don't want to. I want to just wrap up what I'm already
doing and perform the transformation as the input appears. There must be
some simple way to do this.
Here's what I have so far:
def self.perform(command_name, *args)
require "#{ENV["TM_SUPPORT_PATH"]}/lib/web_preview.rb"
STDOUT.sync = true
html_header(command_name.to_s)
puts "<pre>"
self.send(command_name, *args) # FIX ME
puts "</pre>"
html_footer()
end
It's that "self.send" line that I want to wrap up in some way so that I can
intercept the output from each "puts" within my routines and modify it.
Oh, and while we're up: is there a way I can detect whether we are currently
set to Create New Document or Show As HTML? I'd like to funnel all my
commands thru this one bottleneck but NOT do all that stuff if we are set to
Create New Document (in that case I just want to pass the output thru
untouched).
Thx! m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
Hi guys,
I just started using Textmate recently and at the moment I am trying to get
some Python scripts working with it. Everything works great but I was
wondering how to you pass command line arguments to a python script when you
run it?
Thanks
Regards
David
Ah ok thanks,
Although it might not be a bad idea to have a different meant to run
it by expanding the python bundle to "Run scripts with Arguments"
Thanks again for a possible solution.
Regards
Dave
On 9 Jul 2009, at 19:53, textmate-request(a)lists.macromates.com wrote:
> There is no support for this, it?s not that we don?t want to provide
> it, just that it?s not really feasible to do without bringing up a
> dialog and that would be a pain for the 99% where you don?t want to
> provide arguments.
>
> What you can do is simply read from stdin then TextMate will show a
> dialog, this is how I handle it in most of my scripts, i.e. read the
> arguments from stdin instead of command line options (when I know I
> mostly run the script in TM).
Hi,
Many of my Textmate commands are slow and take up to 15 seconds. My
problem seems to be the same than the one described in this thread:
http://lists.macromates.com/textmate/2006-January/007647.html. The top
command shows that the bash seems to be taking up all available CPU
cycles while TextMate is loading. This is really annoying, since this
happens with even very basic bundle commands like bolding in LaTeX,
which renders the commands in LaTeX bundle virtually unusable.
I tried the solution provided in this post:
http://lists.macromates.com/textmate/2006-January/007705.html. However,
I don't have fink or any other suspicious lines in my .bash_profile,
.bash_login or .profile files. Does anyone have any idea on what might
possibly cause the problem?
Regards,
Juho
--
Juho Makkonen
+358 41 5022 683
>> This is probably old news to everyone, but the scope of the quote
>> toggle did not include source. [...] I added 'source' to the scope
>> list and this fixed the "problem". I figure toggling quotes is
>> useful in any source location.
>The command is intended to be used without a selection, as it will
>work on the current scope, which is string.quoted.*.
>By adding ?source? to the scope selector you break it for when there
>is no selection (as it will then receive the entire source as stdin).
That will make my life loads easier. Now it works. I swear I tried that
before. Now that I see SOURCE in the source area of the bundle item.
Everything is clear. The Key
Equivalent won't work if you have the quotes selected though, or
anything selected. It
will work if you have the quote selected and you select the bundle item from
the menu. This is what sent me down the wrong path.
Thank you.
--
Brad Tittle
Tech Support
I am working in a project that has many folders corresponding to real
directories. After working for a while, there may be some folders
that are expanded and others that are collapsed. The thing is that if
I close the project and open it again later, then all of the folders
will be collapsed. This is very annoying because I must expand all
the folders I want access to every time I work on the project. Is
there a way for TextMate to maintain the state of which folders are
expanded and which are not the next time I open the project?
Hi Allan, Ciarán, all,
My projects frequently have a git root that is outside the project
directory, sometimes I even use source files from multiple projects/
repositories at the same time.
The appended patch to ProjectPlus allows the git module to handle that
correctly.
Seems the release notes and maybe version are updated by some utility,
so I did not touch them.
Gerd
When I attempt to create a new project called "Foo", I get the following
error:
/tmp/temp_textmate.VmGETS:30:in 'read': No such file or directory -
/Users/jjones/Documents/Code/Foo/___PROJECTNAMEASIDENTIFIER____Prefix.pch
(Errno::ENOENT) /tmp/temp_textmate.VmGETS:30:in 'expand_file'
/tmp/temp_textmate.VmGETS:94:in 'process'
/tmp/temp_textmate.VmGETS:92:in 'each'
/tmp/temp_textmate.VmGETS:92:in 'process'
/tmp/temp_textmate.VmGETS:138
I see that the folder /Users/jjones/Documents/Code/Foo has been created and
a bunch of projects are in there. Not sure what the issue is here and I was
wondering if anyone here knows what to do to get around this?
Thanx,
Joe
For when a single regular expression is not sufficient for a mirror
transformation, is there any way to access current mirror values from
within interpolated shell code in snippets?
(I'm trying to write a transformation that will first convert a human
phrase to CamelCase /then/ lowercase the first character to generate a
StudlyCaps version of the phrase.)
--
Benjamin Hawkes-Lewis
This is probably old
news to everyone, but the scope of the quote toggle did not include
source. At least in my version of the bundle, it just had
string.quoted.double, string.quoted.single. If the quotes were
included in the selection, then the scope devolved to text.html.basic,
source.php.embedded.block.html (my file type
is set to html).
I added 'source' to the scope list and this fixed the "problem". I figure
toggling quotes is useful in any source location.
--
Brad Tittle
Tech Support
Hello,
I needed to write perl code with some arabic letters recently. While
right-to-left languages are (excuse me) pain in the *** on more than
one level, textmate is not really helping me.
if I edit RTL language in TextMate, cursor moves "as expected" (=
right key moves right, lef key moves left), which is not standard
behaviour with RTL languages (in other editors, when you press right
in RTL language, you move left, and left moves right). But that would
be OK.
But it doesn't end there - if you, in TM, edit something on one end of
RTL text, it appears on the OTHER end. So, you are writing something
at the other end of the line, where the cursor is, so you don't know
where you will be writing until you write.
If RTL is mixed with LTR, the letters appear/dissapear randomly, but
never where the cursor is.
Another thing, maybe more important? - the file is actually saved
differently from how it looks in textmate. Example: in textmate, it
looks like this:
http://i41.tinypic.com/b8n636.png
but in textedit (and how perl sees it) it looks like this:
http://i40.tinypic.com/2i2bke8.png
(notice the misplaced parenthesis and semicolon)
I don't really use Arabic much, but I think it is a bug worth fixing.
Karel Bilek
I have a fork of the Perforce bundle, except that I forked it from a
previous GitHub fork that did a SVN import.
When I try to follow the recent instructions for rebasing, I end up
with "no common commits" and no real idea of how to resolve that
situation.
Is there something I can try to get my fork rebased to the official
bundle (and get GitHub to note that), or am I better off just newly
forking the official mirror and replaying the changes?
-Adam Vandenberg
http://adamv.com/
Allan,
First, thank you for creating such a wonderful editor. I've been using
it full time for almost a year now and love it very much.
I've been trying to be mouse less when doing development with TextMate
and iTerms. One thing I feel a little inconvenient is when I have
opened too many tabs, I can not drag files from vertical list to tabs.
Also, there is no keyboard shortcuts to move current tab to re-order
tabs. Please add them to your feature requests if you feel they are
interesting.
Regards,
Cao
I keep seeing this message pop up from time to time, looks to be a
growl notification. Usually at boot, but I've seen it at other random
times.
Anyone have any insight as to what this is? I suppose it's nice that
my bundles are up to date, but I'd rather not have something updating
my bundles without my OK. Looking around in the standard places for
launch at boot items, crontabs, etc. I don't see anything that would
do this.
-Dave
I've asked this before and didn't get an answer that I understood, so I'm
trying again.
My bundle consists of a bunch of ruby scripts, and the output is shown as
HTML. Thus, when a command is given, I am running a ruby script and then
scrambling to transform any output for display as HTML, deal with
exceptions, etc. In other words, I am doing simply and crudely what RubyMate
already does perfectly.
So the question is, isn't there some way I can just *use* RubyMate to run my
scripts and display output and exceptions for me?
m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
On Sat, Jul 4, 2009 at 6:00 AM, <textmate-request(a)lists.macromates.com> wrote:
> ---------- Forwarded message ----------
> From: Scott Haneda <talklists(a)newgeo.com>
> To: TextMate users <textmate(a)lists.macromates.com>
> Date: Fri, 3 Jul 2009 12:40:55 -0700
> Subject: [TxMt] Re: The dreaded Regexp question
> On Jul 3, 2009, at 10:00 AM, Michael Newton wrote:
>
>> Sorry, I know this isn't particularly on-topic (aside from the fact
>> that I'm using Textmate!) but I'm not having luck with the search
>> engines.
>>
>> I have a bunch of HTML that needs to be converted to XHTML, notably
>> <input type="text"> needs to be <input type="text"/> which is easy
>> enough. Problem is, it's PHP so there are things like <input
>> type="<?php echo $type?>"> which I'm having troubles with. So how can
>> I create a regular expression that captures the guts of the HTML
>> brackets, while ignoring any PHP brackets it might come across inside
>> the HTML?
>
>
> I used this web tool to help me:
> http://www.gskinner.com/RegExr/
>
> I did my best to put in single tics, quote marks etc:
> <input type="<?php echo $type?>"> some type and then another input <input type="<?php echo $type?>" name='value' class="foo">
> <input type="some_value">
> <input type="$some_$value">
> <hr>
> <br>
>
> My regex pattern was:
> (</?\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?(>)
>
> My replace pattern was:
> $1$2$3/>
> * You could do less pattern grouping, I did so as I was working through it.
>
> Result was:
> <input type="<?php echo $type?>" type="<?php echo $type?>"/> some type and then another input <input type="<?php echo $type?>" name='value' class="foo" class="foo"/>
> <input type="some_value" type="some_value"/>
> <input type="$some_$value" type="$some_$value"/>
> <hr/>
> <br/>
>
> The one issue is it will alter plain closing tags, like </a> will become </a/> and I could not wokr that out. Either you can solve that in the regex by ignoring anything with a "/" in it already, or, I may be inclined to cheat. With the recording ability of textmate, I would try something like:
> find "/>"
> replace "#tmp#
> find (</?\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?(>)
> replace $1$2$3/>
> find "#tmp#
> replace "/>"
>
> It should happen pretty quick.
> --
> Scott * If you contact me off list replace talklists@ with scott@ *
>
Thanks, I actually figured it out just now as I was composing a reply.
Negative lookbehind assertion only matches ">" if it's not preceded by
"?" or "/":
find: <((?:input|img|link|meta|hr|br|area).*?)(?<![?/])>
replace: <$1/>
turns this:
<input name="foo"<?php echo $bar?>>
<input name="foo" value="<?php echo $foo?>">
<input name="foo" <?php echo $bar?>/>
<input name="foo" value="<?php echo $foo?>"/>
<a href="bar">baz</a>
into this:
<input name="foo"<?php echo $bar?>/>
<input name="foo" value="<?php echo $foo?>"/>
<input name="foo" <?php echo $bar?>/>
<input name="foo" value="<?php echo $foo?>"/>
<a href="bar">baz</a>
Just need to see if it works in TM when I get back to my office (and
my Mac!) Definitely bookmarking that site though, and will look more
into this "recording ability."
--
Michael Newton
http://mike.eire.ca/
Although only a TextMate newbie, I would be happy to pay for an
upgrade to version 2.
That said, I can imagine a purchase page that allowed upgraders to
choose from a number of possible "donation" amounts--say, via the sort
of pull-down menu you get when paying for music at http://
Magnatune.com. You could then bury the option to Upgrade for Free
somewhere deep on the page or on another page, so that it's an option
for the needy.
I would also love to contribute a few beers to bundle developers--
perhaps via a similar system or a "checkbox" list.
Thanks to everyone who's contributed to this vibrant community!
jon
/RNN (http://responsenotnecessary.com)
______________________________
Still Water--what networks need to thrive.
http://newmedia.umaine.edu/stillwater/
Sorry, I know this isn't particularly on-topic (aside from the fact
that I'm using Textmate!) but I'm not having luck with the search
engines.
I have a bunch of HTML that needs to be converted to XHTML, notably
<input type="text"> needs to be <input type="text"/> which is easy
enough. Problem is, it's PHP so there are things like <input
type="<?php echo $type?>"> which I'm having troubles with. So how can
I create a regular expression that captures the guts of the HTML
brackets, while ignoring any PHP brackets it might come across inside
the HTML?
Thanks in advance.
Hello,
I had an issue with the Show Outline command from the LaTeX bundle
when using multiple source files spread accross different (relative)
directories.
I took a look at the code and was able to fix it for me by modifying
the line
points += outline_points(filename.adjust_end($1)) if
line.match(INCLUDE_REGEX)
to
points += outline_points(LaTeX.master(filename).adjust_end($1))
if line.match(INCLUDE_REGEX)
Someone with a little more insight might want to check if that is a
good idea and possibly apply it for future versions. :)
Cheers,
Guido
I'm working on adding auto complete to my bundle. I can get the
suggestions to display, but not the tool tip.
The current code section is as follows
completion = {"display" => removed_block,"tool_tip" => "testing this"}
choices.push(completion)
options = {
:extra_chars => '_/' ,
:case_insensitive => false,
:initial_filter => "",
:tool_tip_prefix => 'prefix'
}
TextMate::UI.complete(choices, options)
The choices will display but the tool tip won't.
Timothy
After reading through the comments here:
http://blog.simongregory.com/09/as3-autocompletion-in-textmate/
I have so far failed to get any good looking AS3 autocomplete. What
do I need to do to work out what's going wrong? I am getting this
when I press Alt-Esc:
please select a class to locate the package for
Here's my sample code:
var s:Sprite = new Sprite();
s.(here I press Alt-Esc and get the tooltip)
I can't find the TM log file to look for errors. I have soft linked
my Flex SDK into /Developer/SDKs/flex_sdk_3 as suggested in the
comments on the original thread but I cant make it go. Any suggestions?
Thanks,
Gaby.
--
Sent from my email program on my computer sitting on my desk in my
house.
http://playr.co.uk/
Hey guys,
I wrote a couple snippets for event-based programming in AS3:
-- addEventListener
addEventListener(${1:MouseEvent}.${2:CLICK}, ${3:on${2/(_)?([A-Z])([A-
Z]+)/\u$2\L$3/g}}, ${4:false}, ${5:0}, ${6:true});
-- onEventType
${1:private} function on${2:Click}(event:${3:Event}${4: = null}):
${5:void} {
$0
}
--
I realize that addEventListener is also available in autocomplete.
Here's why you might use it anyway:
- Chording two keys (opt-esc) for a function that is supposed to save
you time (autocomplete) can feel clumsy.
- The tab trigger will autofill a onEventType as a callback for
EVENT_TYPE.
- The above feature works well if you use escape to trigger naive
autocompletion.
Thanks Simon for all your work on the AS3 bundle. Feel free to
include these if you find them worthy. =)
Brenton