On Mon, 25 Oct 2004 23:55:02 -0500 Kjell Olsen wrote:
> I can't make the date function work within the command - If I execute
> my script outside of textmate it works beautifully, but from within
> textmate I get:
>
> <code>
> date: illegal time format
> usage: date [-nu] [-r seconds] [+format]
> date [[[[[cc]yy]mm]dd]hh]mm[.ss]
> </code>
Timothy Martens' solution of using an external script which is then
called with a command works well, or -- if you'd prefer to keep it all
within TextMate, you could try something like:
ruby <<END
task_text = "$TM_SELECTED_TEXT"
task_text.gsub!("\[ \] ","[X] ")
print ""
from = File.basename("$TM_FILEPATH",".txt")
comp_time = Time.now
datestamp = comp_time.strftime("%d/%m/%Y at %H:%M")
File.open("/Users/me/completed.txt",'a'){|archive_file|
archive_file.puts
archive_file.puts "#{task_text} => in #{from} on #{datestamp}"
}
END
I ran into a similar problem, which I suspect in my case was down to
escaping the quotes in the format string wrongly. The double quotes to
form the Ruby string make this tricky. I decided to side-step the issue
slightly long-windedly by using Ruby's 'date' methods. Note also that
this code works on selected text: I have Standard in = selected text
and Standard out = Replace selected text. The selected task then gets
deleted from the original file and pasted in to the completed.txt file
with a checkbox ([X]).
I also put the date stamp on the same line as the text to make it
easier to grep for; when someone chases me about something I've done, I
can double-check when I did it ;-)
I'm a Ruby-newbie too, so I'm sure more experienced coders could make
it more efficient.
Jackie
--
Jackie Chappell
jmchappell(a)mac.com
On Tue, 26 Oct 2004 13:17:50 -1000 Timothy Martens wrote:
> /bin/sh: line 1: ruby: command not found
>
> why? do I need the full path in line 1?
Hmm. I don't use the full path for Ruby but it works for me. Also
whereis ruby returns nothing for me, but I also have Ruby 1.8.1 in
/usr/local/bin.
my $PATH is:
PATH="/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:
/usr/local/mysql/bin:$PATH"
export PATH
in .bashrc, but you can also put it in .bash_profile (I 'source'
.bashrc in .bash_profile). I found that if I put the default $PATH
first, the shell would find the Panther version of Ruby (in /usr/bin)
first before my 1.8.1 version in /usr/local/bin, but YMMV.
I think this must be a path issue. Does the command work if you specify
the full path instead of just ruby?
Jackie
--
Jackie Chappell
jmchappell(a)mac.com
Allan,
Thought you would like to know that my colleague at work is very happy with
the new auto-insert features in 1.02b1, I have even seen her use the
wrap-selection-in-quotes feature.
Well done.
Chris
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Allan,
Thought you would like to know that my colleague at work is very happy with
the new auto-insert features in 1.02b1, I have even seen her use the
wrap-selection-in-quotes feature.
Well done.
Chris
DDB London - Effectiveness Agency of the Year
DDB Worldwide - Global Network of the Year
The Information given in the above email
and / or attachment is provided without warranty of
any kind, either expressed or implied on the part
of the writer or the Agency.
______________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
1. I think the program rocks.
2. I was writing some HTML and I had the need to have a command that
jumped to the *inside* of the next tag. I couldn't figure out how to
do this in TM (or any other editor), playing with snippets and Perl
shell command ideas until I realized I could record a macro that did:
find <(.*?)> as regular expression
hit left arrow (to go to start of found selection), hit right arrow
(to skip over the <)
find [^>]* to select all characters up to the >.
It works just great.
3. In some corner of my head I feel like snippets, macros and
commands should really all be one type of automation entity. I'm not
sure how to do that, but it's a little confusing to have so much
power distributed across three different kinds of triggers...
4. Actual interface bug (in my opinion). If you start a selection,
say in the middle of the screen, and drag up past the window top, TM
should select everything up through the first character of the
document. Instead, it only selects up to the first line stopping at
the original column.
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
On 26. Oct 2004, at 19:47, Ian G. Gillespie wrote:
> Does anyone know of a good program that one can use to create a help
> file and a PDF manual without maintaining two sets of documents?
LaTeX does really nice PDF and with tex4ht I think the HTML result is
also reasonable good.
Another option is DocBook, though the PDF is not very nice when using
the freeware converters available.
Basically you just want to settle on some generic markup language that
allows you to convert it to whatever format you desire.
Which markup language is best suited probably depends mostly of what
type of documentation you're writing, i.e. is it heavily interlinked,
using all sorts of "typegraphic" features, footnotes, images etc.
Kind regards Allan
--
http://macromates.com/ ::: TextMate, OS X text editor
http://macromates.com/sigpipe/ ::: Personal weblog about
programming
On 26. Oct 2004, at 23:26, kumar mcmillan wrote:
> when copying and pasting text from one document to another document in
> a project, the pasted text gets shifted to the right one column.
Disable “Indented Paste” from the Behavior menu.
It tries to match the indent level of where you paste -- some
improvements could probably be made though (I think it fails to
properly treat spaces and tabs transparently).
> also... if you select several lines of text (like the require
> statement + comments above), then choose Text > Move Selection >
> Column Right, TextMate only moves the first line, not all lines of the
> selection. The same thing happens for Text > Move Selection > Column
> Left.
Yes, move column left/right only makes real sense for either selecting
sub-lines (e.g. words) or doing a columnar selection.
Kind regards Allan
On my US keyboard the [ ] characters do have their own keys, and if you
shift them they are { } (braces).
-rich
On 10/25/04 6:28 PM, "Allan Odgaard" <allan(a)macromates.com> wrote:
> On 25. Oct 2004, at 23:55, Richard Kilmer wrote:
>
>> I followed the procedure to copy the KeyBindings.dict file to:
>>
>> ~Library/Application Support/TextMate/KeyBindings.dict
>>
>> I want to map shift right/left to xcode-style/command + ] and command
>> + [
>>
>> "@[" = "shiftLeft:";
>> "@]" = "shiftRight:";
>>
>> But it does not seem to work!
>>
>> Any help would be appreciated.
>
> Are you using a US-keymap? i.e. does the [ and ] have their own keys,
> or are they e.g. on option-8, option-9 (as with some european keymaps).
>
> Kind regards Allan
>
> P.S. This is really a mailing list type of question! ;)
>
> http://lists.macromates.com/mailman/listinfo/textmate
>
>
I am making a syntax module for the Rebol language and I am having
trouble getting some keywords to match properly. This expression works:
match = "(action!|any-block!|any-function!|)"
but it is not ideal for I needed it to work with word boundaries. When
I include word boundaries in the regex, the rule is never matched.
match = "\\<(action!|any-block!|any-function!|)\\>"
I think this is a problem with the exclamation point "!". I have tried
using it with these escape sequences: \!, \\!, \041 \\041; with no luck
so far.
I had the same problem with keywords having the question mark "?" in
them, ie:
match = "\\<(about|abs|absolute|action?|add|alert|type?)\\>"
Ideas would be most welcome. Is there a limitation in the regex engine?
Thanks, Jaime
It would be useful if smart typing wasn't active when writing code
comments. The reason being you're more likely to be writing natural
language sentences than code.
for example:
<?php
// Don't forget the elephants!
$elephants = true;
?>
with smart typing comes out like this:
<?php
// Don't forget the elephants!'
$elephants = true;
?>
What do other's think?
drew.