hello:)
I've some difficulties with the macro "Convert ASCII Symbol to LaTeX",.
arrowShortcuts.rb is there :
/Library/Application Support/TextMate/Bundles/Latex.tmbundle/Support/
bin/arrowShortcuts.rb
and in the macro we have : command = "\"$TM_BUNDLE_SUPPORT/bin/
arrowShortcuts.rb\"";
or Show TM_* Variables give :
TM_BUNDLE_PATH=/Library/Application Support/TextMate/Bundles/
TextMate.tmbundle
TM_BUNDLE_SUPPORT=/Library/Application Support/TextMate/Bundles/
TextMate.tmbundle/Support
so i think that the script is not found !
the script is fine because i put the code in a command and the
command works very well
But i've a question
TM_BUNDLE_SUPPORT is unique or this variable depends on Bundle ?
how do I have to make so that works?
Thanks
Alain
Hi guys,
The sexy and helpful textmate manual says I can fold/unfold code
blocks using my F1 key. But I can't get it to work. What needs to
be selected? Where should my caret be placed? Do I have to utter
some secret magical phrase while clicking F1?
Thanks,
Sean
:::: DataFly.Net ::::
Complete Web Services
http://www.datafly.net
On Feb 21, 2006, at 10:50 AM, Oliver Taylor wrote:
>> ------------------------
>> ONCE
>> (twice)
>> Three times a lady.
>> Not as much as the Gambler.
>> (This sucks)
>> How would you know?
>> ------------------------
>>
>> How do I match the 2nd line but not the 5th?
>> How do I match the 6th, but not he 3rd?
So I just read in the documentation:
> [...] it is not possible to use a pattern that matches multiple
> lines. [...]
Total bummer, although this still may be possible using "begin" and
"end"
So, to restate my question in a more clear way... (thanks for your
patience Haris) I know nothing about programming...
I'm trying to run a perl search/replace command via a 'bundle
command'. I've entered the following into the 'Edit Command' box:
perl -pe '
s/^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$/\n\n\t\t\t\t$1\n\t\t\t$2\n\n
$3/g;
'
I've set the input to 'Entire Document' and the output to 'Create New
Document'.
But when I run the command none of the tabs or newlines I've
specified in the replace section of the command are applied to the
text in question. I've also tried the command with the 'e' option at
the end which, as far as I can tell, is supposed to evaluate the
right side of the search/replace command as regex... but it's not
working.
Any help is appreciated.
Just so you know, I'm trying to write a set of commands that will
transform the plai-text output from Final Draft when exporting a
screenplay. If I can get this working then I can bring all my scripts
over to TextMate.
As an example, this:
-----------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
-----------------
should look like this:
---------------------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
---------------------------
The Go To File command doesn't show files in the same easy-to-read
hierarchy as the project drawer. This is especially evident when a
project contains many files that have been carefully arranged into
custom groups. In this situation, the flat list of the Go To File
dialog isn't as easy to navigate as the project drawer.
This is why I like to select files directly from the drawer instead
of with Go To File. With mouse navigation, this works fine; I can
simply point and click. But I prefer to use the keyboard as much as
possible, and there doesn't seem to be any way to move the keyboard
focus to the project drawer (unless of course I use the mouse, but
that defeats the whole point of keyboard navigation). Is there some
hidden key combo not mentioned in the manual that will do this? Thanks,
Trevor
I'm trying to get what seems like a simple custom coloring rule
working. As a simple test, I just want to set a custom color for all
characters between <code> and </code>.
I added this to the HTML language definition:
{ name = 'markup.code.html';
begin = '<(code)>';
end = '</(code)>';
captures = { 1 = { name = 'entity.name.tag.html'; }; };
patterns = ( { include = '$self'; } );
},
I then went into the Fonts & Colors panel and set a custom color for
the scope markup.code.html, but I don't see any effect.
I read Allan's blog post on scopes and it really seems like the above
should work, but I'm finding a lot of conflicting information on this
topic. The wiki mentions a number of things are out of date so I'm
not sure where the authoritative docs are. The blog? The wiki? If so,
which page?
The full explanation of scope is useful (assuming it's up to date),
but it would be really nice to have some simple, practical examples
just to get started. I believe instant gratification as a strong
motivator for further research. :)
Thanks!
- Scott
> On Feb 22, 2006, at 2:08 AM, Haris wrote:
> You've done amazingly well with the bundle so far. I'm very impressed.
Thanks.
> First of all, why don't you use the find&replace feature of
> TextMate? Then you could record the whole thing as a macro.
You know, I never even thought of that. I'll give it a shot.
Still, I'd like to know how to run a perl search/replace command with
regex in the replace side properly for future reference.
> So maybe a search without ^ and with ([^\n]+) instead of (.+)$
> might do the trick.
tried that, didn't work.
--------------------
I'll try these things and report in the morning on my progress. To
bed now. Thanks again Haris, you are continually my savior.
On Feb 21, 2006, at 5:23 PM, Haris wrote:
> [...] I am not sure what you mean by "piped thru a command" [...]
Sorry, what I meant this that I'm using the search and replace perl
string inside a bundle command.
On Feb 21, 2006, at 2:58 PM, Haris wrote:
> Oliver: One thing you could try, if these things are hierarchical,
> is to have a begin pattern for the first line, and ending in
> something hopefully meaningful.
Here's what i managed to come up with:
begin = '^[A-Z]{2,10}.*[A-Z]*(\s*|\()$';
end = '\.$|\?$|\!$|--$|-$';
...which suits my needs *okay* but not perfectly.
----------
I'm using the following (adapted from Dr. Drang's suggestion):
^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$
for a search and replace string like this one:
s/^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$/\n\n\t{4}$1\n\t{3}$2\n\{2}$3/;
...which makes sense to me, but it doesn't insert those tabs or
newlines when piped thru a command. Clearly I'm missing something
here. As you can no-doubt tell, I'm a complete noob when it comes to
all this programing.
As an example, this:
-----------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
-----------------
should look like this:
---------------------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
---------------------------
> If I may suggest, it would be helpful if you add a test screenplay
> in the bundle, so that anyone in the future working on it knows how
> it looks like and what not to break. Like the test.tex we have in
> the LaTeX bundle.
I'll do that.
Hello
I am a professor of mathematics and my essential activity is to
create exercises which I arrange in a structure called "Base"
Often, I work in the following situation:
I create a file "exercise.tex", i put this file in the "Base"
then I create a new file "try.tex" :
\documentclass{myclass}
\begin{document}
\input{exercise.tex}
\end{document}
I do not have enough knowledge on scripts to obtain this:
In Textmate, when i work on an file exercise.tex, i would like wih
one command or script (?)
to compile "try.tex" directly.
I think that a modification of "LATEX & VIEW" should be enough...
With this idea and
with FILE = exercise.tex (the file which I create)
with VAR_FAV_CLASS = myclass
1) modification of FILE in ---> NEWFILE
NEWFILE =
"\documentclass[]{VAR_FAV_CLASS}
\begin{document}
\input{$File}
\end{document}"
2) Compilation of NEWFILE like in "LATEX & VIEW"
Is it possible ?
Would somebody have an idea to build this script?
in LATEX & VIEW, line 35/36 there is
if [ "$TEX" != latexmk.pl ]
then "$TEX" ${TM_LATEX_OPTIONS:=--shell -escape -
interaction=nonstopmode -file-line-error-style} "$1"
I'm not sure but "$1" is perhaps the file I want modify
Thanks
Alain Matthes
I'd like to find and replace a variable inside of a document. How can
I do this? [VAR] Represents the variable:
Find: title="[VAR]"
Replace With: title="dummytext"
Text in Document I want it to affect:
title="Webmaill"
title="Control Panel"
title="Customer Service"
title="Web Hosting"
How can I do this in TextMate?
Also TextMate has no way to upload/browse SFTP/SSH/ or FTP? The price
is way to steep for an application that can't connect and upload the
edited files directly.
Please let me know your thoughts,
Best Regards,
Court Kizer
>> ------------------------
>> ONCE
>> (twice)
>> Three times a lady.
>> Not as much as the Gambler.
>> (This sucks)
>> How would you know?
>> ------------------------
>>
>> How do I match the 2nd line but not the 5th?
>> How do I match the 6th, but not he 3rd?
>
> What is different in each case? The presence of ONCE exactly in the
> line before?
>
> Indeed, I'm uncertain what the logic behind the matches is supposed
> to be. Is the second line matched because of the sequence of cardinal
> numbers, a parenthetical following a line of all capital letters, a
> parenthetical with only one word, a parenthetical with no capitalized
> letters, a parenthetical followed by a statement... and so on.
Yeah, sorry.
Matching the 2nd line (but not the 5th): I want to match any line
that begins and ends with a parenthetical ... ^\(.*\)$ ... but only
when the line is directly preceded by a line of all capitol letters,
Matching the 6th (but not the 3rd): Actually, I got this one
backwards. I want to match the 3rd but not the 6th. So... Any line
that is directly preceded by the match I described above.
----
I'll check out the IRC channel.
> [1] http://www.geocities.jp/kosako3/oniguruma/
I'll check it out.
Hi,
I already know that it is not possible by default to have a different
tab and indention size.
I'm new to TxMt so I want to ask if this is possible to achieve via
scripts / bundles ?
One example to show my need. I'm working in a Python projekt, where
the interpreter handles one tab as 8 chars. We use an indention of 4
chars.
My workaround at the moment: set Tabs to 8 convert all tabs to spaces
the set tabs to 4 soft spaces.
If somebody has hints, I'll work on it for myself.
Thx Jonatan
Hi,
It would be helpful if the language bundle editor had a pop-up hierarchical
menu of the standard name
Something like:
keyword
meta
string
support
variable -> other.
storage parameter.
string
So when writing a language syntax, and looking for names, you can just have
the insertion point in the right location, click on the pop up to see what
is appropriate, then either it inserts when you release the menu, or there
is an insert button beside it.
tim
____________________
---
"Of what use is a philosopher who doesn't hurt anybody's feelings?"
--Diogenes of Sinope, Herakleitos and Diogenes pt. 2, Fragment 10 (tr. by
Guy Davenport, 1976)
I don't know where else to turn for help with regex, so I turn to
you. Consider the following:
------------------------
ONCE
(twice)
Three times a lady.
Not as much as the Gambler.
(This sucks)
How would you know?
------------------------
How do I match the 2nd line but not the 5th?
How do I match the 6th, but not he 3rd?
Is this possible?
P.S. Do you guys have any really good references for regex (aside
from the manuel), where I can hunt down problems like this?
I just wrote a blog entry on a convenience command for Ruby on
Rails... but I'm not sure to whom I should address this. I'd like to
see it added to the default Rails bundle that ships with future
TextMate versions if others find it useful. How should I go about
submitting this for review?
Thanks,
Duane Johnson
P.S. Blog entry is at http://blog.inquirylabs.com/
Hi guys,
I get errors when I try to run some Ruby scripts in TM.
NB: I don't have those errors when I run these scripts in Bash (even
from inside TM) or in IRB
I have "TM_RUBY /usr/local/bin/ruby" in my shell variables.
e.g.
When using erb (example taken from Programing Ruby):
---------
#!/usr/local/bin/ruby
require 'erb'
input = %{\
<% high.downto(low) do |n| # set high, low externally %>
<%= n %> green bottles, hanging on the wall
<%= n %> green bottles, hanging on the wall
And if one green bottle should accidentally fall
There'd be <%= n-1 %> green bottles, hanging on the wall
<% end %>
}
high,low = 10, 6
erb = ERB.new(input)
erb.run
-----------
I get:
RubyMate r2496 running Ruby v1.8.4.
>>> ~/bin/test.rb
/Library/Application Support/TextMate/Bundles/Ruby.tmbundle/Support/
tmruby.rb:180: bad value for range (ArgumentError)
from /Library/Application Support/TextMate/Bundles/Ruby.tmbundle/
Support/tmruby.rb:120
===========================================
When using 'sqlite3':
-----------
#! /usr/local/bin/ruby
require 'sqlite3'
db = SQLite3::Database.new( "/Users/fatal/bin/test.db" )
p db.execute( <<-SQL
SELECT * FROM posts;
SQL
)
db.close
-----------
I get:
RubyMate r2496 running Ruby v1.8.4.
>>> ~/bin/jots/test2.rb
(eval):5: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [powerpc-
darwin8.4.0]
Program exited with return code.
NB: This script works, but I get the error, sometimes scripts using
sqlite3 doesn't work at all, sometimes I only get "Program exited
with return code."
I have other errors of this kind, but examples are more complicated
to share or I didn't take note of them.
Am I missing something?
Thanks for any tips.
-
Fred
>> When searching in the "go to symbol" pop-up, I find that because
>> the search alphabetizes the results, it's very much the opposite
>> of useful.
>
> It shouldn’t alphabetize them, but instead rank them based on how
> good a candidate the match is for the search/filter string.
>
> For example if we have George Costanza and Charlie Sheen in the
> list, and enter CS, it will show both names (as both contain C and
> S), but it should show Charlie Sheen first, since CS is a “better”
> match for that, than it is for George Costanza.
Okay, that makes sense.
A ranked-order search result makes a lot of sense when the order of
symbols is unimportant and/or there are not enough identical results
to confuse the list. But when there are a lot (say, over 20) of
identical results, the placement in the document becomes very
important, in fact it becomes just as important as the match itself.
A simple way to achieve this is with a search result that also
outputs line-numbers... I know that would do the trick for me. Now
for a crappy mock-up! This is not the prefect example, but you get
the idea.
First I tried an update and got:
svn: Failed to add directory '/Library/Application
Support/TextMate/Bundles/SQL.tmbundle/support': object of the same
name already exists
I deleted the checked out directory and did a fresh checkout and got
the same error!
I notice that the last 2 commits are:
intermediate step to rename support
recover capitalized Support directory
Any ideas what this might be? Possibly some naming clash as a result
of an attempt to rename Support to support.
Stephen
Hi,
I just wanted to post a nice snippet I just made...er, actually I just
ripped it from the fun (function) snippet. It goes like this:
prototype.${1:method_name} = function(${2:first_argument}) {
${0:// body...}
};
I have it set up to expand on proto<tab>. Actually, after thinking
about it, maybe this would be better:
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
${0:// body...}
};
Either way, I think this is really useful because like all good snippets
it keeps you from typing a bunch of stuff that is always the same, and
it keeps you from forgetting the trailing semicolon (which the fun
snippet and auto-close brace omit).
Any chance on getting something like this included with Textmate out of
the box? Forgive me if this has already been discussed; a quick search
on the list and wiki didn't turn up anything on this subject.
Also, the fun snippet that's included uses "# body..." instead of "//
body...". Is this intentional, or was the hash just forgotten when
porting the snippet from another language?
Mike
There has been some talk in the past about TextMate's undesired
tendency to use a software generated bold for the Bitstream Vera Sans
Mono font.
One fix seems to be to run:
sudo rm -rf /Library/Caches/com.apple.ATS
Afterwards one will have to reboot the machine, but then the bold
shows up as drawn. And what a difference it makes:
Though I don't know for how long this fix will work. And it will
still look incorrect when the bold text is light on a dark background.
Hi All,
I'm evaluating TextMate and find it very useful, but I can't get it
to remember the [BBEdit] Theme that I have downloaded.
1: Does the non-licensed version not remember importet Themes?
2: Is something else wrong?
Here's how I do it:
- Doubble-click the Theme file in the Finder -> opens it in TextMate
and activates it..
- Quit TM = It's gone from the Theme selector in Prefs, but still in
my AppSupport folder...
Hints?
Jakob Peterhänsel
"Tell me why, don't we try, not to break our hearts
and make it so hard for our selfs"
P.S.B. 1987
Email: jakob(a)hjemme.dk
AIM: Marook
Phone: +45 22684961
Hi,
I'm working on a grammar for Io (www.iolanguage.com) and I've got a
basic one working. I notice that in the other languages I've looked
at, typing a "{" , getting the auto-paired "}" , and hitting return
with the cursor in the middle, gets you a new line and the
indentation decreased. Like so:
before:
if(true) {}
hit return:
if(true) {
}
Now, in Io, matching parens serve as block delimiters (effectively
anyway). So you could have this statement:
if(true) then (
// do something
)
So, I'd like to have the same behavior for parens as one gets for
braces, but I can't seem to locate where this is enacted. As far as
I can tell, there is no key in the grammar or language preferences to
auto-expand this sequence, but I'm new to all this.
Does anyone know if this is part of the language definition system
that I can control?
Thanks in advance,
John
John Clayton
---------------------------------------------------------------------
http://www.fivesquaresoftware.com
john(a)fivesquaresoftware.com
---------------------------------------------------------------------
CatSlapper - Manage and install multiple Tomcats
When searching in the "go to symbol" pop-up, I find that because the
search alphabetizes the results, it's very much the opposite of useful.
In my screenwriting bundle it's possible to have over 20 matches for
the same symbol-search-string, if I can't see those results in the
order they are in in the document, the search is useless. Wouldn't
this be a problem in other languages as well?
There is a "Keep Symbols Alphabetized" option in the pop-up at the
bottom of the window, why not the search pop-up? Am I missing a
preference somewhere?
hello:)
I can't delete a space with the key "delete" or with the key <- also.
I need to delete the file preference of textmate
i would like to know if i made a bad thing and if can modify the bad
prefs
finally which can be the origin of this problem?
Greetings Alain Matthes
In the bundle I've created I'm attempting to refine my scopes. Take
the following example:
INT. SHIPYARD DOCKS - DAY
The above line falls under the scopes "text.splay.screenplay" (the
document) and "splay.slugline" (the element). What I want is to be
able to define the three separate elements: "INT", "SHIPYARD DOCKS",
"DAY" as independent scopes, while retaining their status as
"splay.slugline" So "INT" would fall under the jurisdiction of
"text.splay.screenplay splay.slugline splay.slugline.setting".
I guess the simple question is: how do you stack more than two (the
document and the element) scopes?
In Markdown a link gets text.html.markdown,
markup.paragraph.markdown, markup.underline.link.markdown... how do I
do that?
I recorded a macro to search forwards and backwards for
(?=(?:private|public)( static)? ), which is working nicely for
ActionScript, but it'd be interesting to see it tied into the language
grammers somehow. Any thoughts?
Ben
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
This has been such a fun project. Couldn't keep myself away:
http://blog.inquirylabs.com/2006/02/19/syncpeople-on-rails-07/
== Summary ==
Easily navigate between ActionMailer models, views, partials,
controllers, helpers, javascripts and stylesheets with a single key
(keypad 'enter') in TextMate. This release also adds an Enhanced
TODO List (ctrl-shift-t) and is now officially LGPL licensed.
Duane Johnson
(canadaduane)
http://blog.inquirylabs.com/
Not sure what you need to debug this, but all of a sudden indentation
has stopped working in the php bundle. I've tried trashing the pref
files, my bundles and themes, and even trashing txmate itself, and
nothing is bringing it back.
Any Suggestions?
Eric Coleman
I'm stumped again. I got > comments working for plain text documents
using this method, but now I want to set // type comments for all php
source. I've tried adding the following preferences to both PHP and HTML
bundles, using source.php as the selector:
/* preferences */
{
shellVariables = (
{ name = 'TM_COMMENT_START';
value = '// ';
},
{ name = 'TM_COMMENT_END';
value = '';
},
{ name = 'TM_COMMENT_MODE';
value = 'line';
},
);
}
Doesn't work! I've tried with .php files set to both HTML and PHP
language types.
Idears?
Thanks again, Q
PS: Is it _always_ appropriate to use "HTML" as a file's language? I
noticed the "Source -> View source as HTML" command doesn't work unless
you select " X PHP -> Use HTML".
Hello,
I'm trying Spell Catcher X, and I notice that it does not work so
well with Textmate when using "Auto-Show Suggestions" with a popup
list: the popup list is shown when there is a mistake, but no more
input is processed until I click on the window.
Is this a known bug of Textmate or Spell Catcher X? As both programs
look really nice, I'd be glad to have both work together.
Thanks,
Alan
--
Alan Schmitt <http://sardes.inrialpes.fr/~aschmitt/>
The hacker: someone who figured things out and made something cool
happen.
.O.
..O
OOO
Arrrg! Trying to understand the format of bundle definitions.
Trouble number one: I'm trying to change the type of comments used for
plain text types. I've added the following to the patterns array of the
"Plain Text" language definition:
{ name = 'comment.line.right-angle-bracket.text';
match = '>.*$';
}
And nothing happens. I then tried creating a new bundle for a new type
of document ("Test Doc") and setting the patterns array to only the
above. Nothing.
What am I doing wrong?
Thanks if you can help!
Quinn
hello:)
Allan,since Texlive 2005 or Tetex 3 this code
I announce you that since Tex one should not any more
use this code (used in the Latex templates)
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
\pdfoutput=1 % we are running PDFLaTeX
\pdftrue
\fi
must be replaced by \usepackage{ifpdf}
% Use: LaTeX: \usepackage{ifpdf}
% plain: \input ifpdf.sty
% The package provides the switch \ifpdf:
% \ifpdf
% ... do things, if pdfTeX is running in pdf mode ...
% \else
% ... other TeX or pdfTeX in dvi mode ...
% \fi
% The package can also be used to set global
% documentclass options:
% \RequirePackage{ifpdf}
% \ifpdf
% \documentclass[pdftex,...]{...}
% \else
% \documentclass[...]{...}
% \fi
note in texlive 2005 :
Last year, we kept \pdfoutput and other primitives undefined for DVI
output, even though
the pdfetex program was being used. This year, as promised, we undid
that compatibility
measure. So if your document uses \ifx\pdfoutput\undefined to test if
PDF is being
output, it will need to be changed. You can use the package ifpdf.sty
(which works under
both plain TEX and LATEX) to do this, or steal its logic.
Greetings
Alain
Hello all, hope to pick yer brains...
I notice that you can define multiple files for a template, but I can't
figure out how to create multiple files when running the template. Why
else would TM use multiple files in a template? But then again, there
seems to be only one $TM_NEW_FILE variable per template.
I'm trying to setup a template for a particular case when I will always
need several files at once. For now I'll just define one template for
each file I will need generated.
A quick side question, how can I populate env variables at runtime? If
my template has ${WHAT_DID_I_HAVE_FOR_LUNCH_TODAY} and I want to run a
template every day... is it possible to popup a dialog with fields to
fill-in or something?
Thanks!
Quinn
Strange Find and Replace Bug - r906
Summary:
Doing a selection based find and replace consistently inserts many lines
of code when it should be only replace one word with another single word.
Reproducing The Bug:
* Open the attached (.rb) file
* Switch to Ruby on Rails editor mode
* Do a full line selection on line #39
* Hit cmd+f to go into the finder window
* Replace the word ":now" with "now" while using the shift button to do
a selection only replace
Results:
* Replaces the entire line #39 with only the word "now"
* Performs a selection from line #39 down to #110
* Duplicates a bunch of code under line #110 (copies and pastes the new
selection)
Details:
* Ignore and wrap are checked. Reg exp. is unchecked.
* Restarting Textmate doesn't seem to fix the issue.
* Soyru in IRC helped me confirm the bug, so it is not specific to my
situation.
Environment:
* I don't use manager hacksies.
* I haven't edited the default bundle editor commands.
* I do use quicksilver, starting it is ctrl+alt+cmd+space; Everything
else is at defaults
class TimerController < ApplicationController
#
def index
unless @user.master_timer_is_stopped?
# initialize current task timer
# initialize task list
@upcoming_tasks = @user.upcoming_tasks
@recent_tasks = @user.recent_tasks
@favorite_tasks = @user.favorite_tasks
end
end
# Start a master timer
def start_clock
@user.start_master_timer
redirect_to :action => 'index'
end
# Pause a running master timer
def pause_clock
@user.pause_master_timer
redirect_to :action => 'index'
end
# Stop a running or paused master timer
def stop_clock
@user.stop_master_timer
redirect_to :action => 'index'
end
# Start a task
def start_task
# capture the time now so all timers match up
:now = Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
redirect_to :action => 'index'
end
private
before_filter :find_user
#
#
def find_user
@user = session[:user]
end
end
class TimerController < ApplicationController
#
def index
unless @user.master_timer_is_stopped?
# initialize current task timer
# initialize task list
@upcoming_tasks = @user.upcoming_tasks
@recent_tasks = @user.recent_tasks
@favorite_tasks = @user.favorite_tasks
end
end
# Start a master timer
def start_clock
@user.start_master_timer
redirect_to :action => 'index'
end
# Pause a running master timer
def pause_clock
@user.pause_master_timer
redirect_to :action => 'index'
end
# Stop a running or paused master timer
def stop_clock
@user.stop_master_timer
redirect_to :action => 'index'
end
# Start a task
def start_task
# capture the time now so all timers match up
now
# capture the time now so all timers match up
:now = Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
= Time.now
# find currently selected task
:selected_task = @user.selected_task
# if a selected task exists
if :selected_task
# if the recently started task is already the selected task
if :selected_task.id == params[:id]
if :selected_task.status == 2
# notice - can't start a timer that is already running
elsif :selected_task.status == 1
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = :selected_task.id
# change status of the this task
:selected_task.status = 2
:selected_task.save
else
# error - stopped tasks can't be selected
end
# if the recently started task is not already the selected task
else
# stop the task timer if it's still running
if :selected_task.status == 2
:task_timer = TaskTimer.find(:first,
:condition => "ended_at is null and " +
"user_id = #{(a)user.id} and " +
"task_id = #{:selected_task.id}")
:task_timer.ended_at = :now
:task_timer.save
end
#change status of selected task to stopped
:selected_task.status = 0
:selected_task.save
# find the newly started task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
# if no selected task exists
else
# find the newly selected task
:selected_task = Task.find(params[:id])
# start the master timer, if necessary
unless @user.master_timer_is_running?
@user.start_master_timer
end
# start a new task timer timer
TaskTimer.create :started_at => :now,
:user_id => @user.id,
:task_id = params[:id]
# change status of the this task
:selected_task.status = 2
:selected_task.save
end
redirect_to :action => 'index'
end
private
before_filter :find_user
#
#
def find_user
@user = session[:user]
end
end
There are two heredoc-rules for the PHP grammar:
A generic one and an HTML one with HTML Syntax (the first rule even).
I improved the HTML one a little by including the PHP variables and
made another two for XML and SQL.
Maybe someone with svn write access could include them in the default
grammar. Forking the PHP grammar does not really work as one had to
fork the HTML as well…
Have fun,
Soryu
Hi Robert, hi Mark (et al.),
I've just downloaded TextMate and subscribed to this list, curious if
there's also a ConTeXt bundle to work with.
As I have read your thread from last year I was wondering how things
are going?
Or does anybody else has good news for us ConTeXters?
Steffen
Thanks Niko,
mysql is definitely in my path. I use tcsh and mysql is there:
setenv PATH /usr/local/mysql/bin:$PATH
However /usr/local/mysql/bin/ and other directories that I set in my
path are not reported in the search path that the MySQL bundle tells
me it is using:
"Couldn't find mysql
Locations searched:
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/
CocoaDialog.app/Contents/MacOS
/bin
/sbin
/usr/bin
/usr/sbin
/Applications/TextMate.app/Contents/SharedSupport/Support/bin"
I tried modifying the PATH variable in the Advanced pane of TextMate
Preferences, to no avail.
So as a hack, I created a symbolic link to mysql in TextMate using
these commands:
cd /Applications/TextMate.app/Contents/SharedSupport/Support/bin
ln -s /usr/local/mysql/bin/mysql mysql
It's not pretty but it works. I'd still like to figure out how to
modify the PATH that the SQL Bundle uses ...
JR
I looked through the mailing list history and I know the whole FTP
integrated thing has been talked about a lot already but hear me out;
I just started working for this company where I HAVE to work off of
the server. I don't like it, but that's the way it's gonna have to
be for now (working on it though ;)
So I tried to figure out a way to work with project windows off of
the server and discovered it was impossible... What I do now, is
open all the files via FTP and then drag them to an empty project and
hide all the windows. It's a major pain but I do it once in the
morning and leave it open all day so that's not too bad.
What I would like to know is if there's a way I could automatize the
process, some sort of "add all open windows to empty project" type
macro or something along those lines. Not as good as being able to
save projects on remote servers, but it would be good enough for now...
I also read that someone had some kind of Perl/rsynch combo that sort
of mimicked the project on server idea, but I couldn't find enough
info to get anything working.
Any help in optimizing a remote type workflow would be greatly
appreciated. Thanks!
(As a side note, I almost got my boss to switch from BBEdit, but the
whole remote project issue blew it.)
Yann
> minimal.design textmate at minimaldesign.net
> Wed Feb 15 00:10:25 GMT 200
>
> I just started working for this company where I HAVE to work off of
> the server.
> ... Any help in optimizing a remote type workflow would be greatly
> appreciated.
Transmit has a new feature they're calling 'Edit in Whatever.' Edit
any remote file, in any app — even graphics!
<http://www.panic.com/transmit/>
Editing Files in an External Editor
Transmit can edit any remote file, using any local editor. Transmit
will download the file to a temporary directory, and watch the file
for changes. When you hit "Save" in your local editor, and the file
is changed, Transmit will automatically upload the file to the server.
Select the file to be edited.
- Choose File > Edit in [Editor Name]. (The name of the Finder's
default editor for that file type will be displayed.)
- Keep Transmit running while editing the file.
- Make the desired changes in the editor.
- If you want to keep the changes, save the file in the editor.
Transmit will save the file to the server automatically. The editor
can be closed or quit when it is no longer needed.
If you wish to edit files in a different editor than the Finder's
default:
- Right click, or control-click, the file to be edited.
- Choose Edit With > [Name of Editor You Want To Use]
- If the editor you wish to use isn't present, choose Edit With >
Other... and select the editor manually
If you wish to permanently edit files in a different editor than the
Finder's default:
- Choose Transmit > Preferences.
- Click Files.
- Click the icon next to Custom File Editors.
- Type the extension you wish to associate (for example, html), and
choose the application you wish to edit with.
I have mysql 4.1 installed on my machine in /usr/local/mysql/bin/.
It's up and running just fine.
When I run the "Execute Selection as MySQL Query" command from
TextMate, I get the following error message:
"Couldn't find mysql
Locations searched:
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/
CocoaDialog.app/Contents/MacOS
/bin
/sbin
/usr/bin
/usr/sbin
/Applications/TextMate.app/Contents/SharedSupport/Support/bin"
Any ideas?
Thanks,
Jeff
Here's what I'd like to do:
On my webserver, I'll edit my .bash_profile to include and alias for 'mate'
to a shell script. The shell script will do the following:
1. secure copy the argument file to my local tmp folder
2. open the the local tmp file with 'mate -w'
3. once I finish editing the file in TextMate and close it, secure copy the
new file to replace the file on the webserver
The problem is, I don't know anything about shell scripting. :-)
But I'm wondering if anyone else already has something like that or would be
willing to help write one.
Any other ideas for accomplishing the same goal (edit remote files with
TextMate) are also welcome.
Thanks,
Simon
P.S.-I saw the copy to tmp folder idea in this useful view safari source
applescript:
http://comox.textdrive.com/pipermail/textmate/2005-September/005727.html
I did a super quick search and didn't notice anything, so I am
posting here (feel free to tell me to shuddap if it's been discussed
before).
Isn't there a way we could customize bundles that are "added" in. I
was thinking that when you do an update, if a bundle gets updated,
but I have a "customized" version (aka, i added a few things) I won't
get the updated bundle. Is this correct? Or is textmate smart and
only inserts my updates?
Eric Coleman
Hello all,
I'm trying to work out how to order files/folders in the project drawer.
I dragged and dropped files in to the drawer ordered however they're
listed in a bit of a random order now.
Any ideas?
Thanks!
Alastair
hi everybody.
i really LOVE the TODO-Bundle (thanks to whoever wrote it). as i'm
using it alot, i added some features:
- i like to see, wether s/th is TODO, FIXME or CHANGED. so i added
these words to the list and colored them differently.
- i added buttons to hide each category.
- as i'm a programming nube, i add own "changed"-comments
("NikosChange") to stuff i change in my RoR- and Joomla-projects to
keep track of what i do (wrong ;-). i added this as another category.
adopt this to your needs.
as i'm a programming nube (but you know that already), i'm all but
shure that i didn't make mistakes in my changes (you know that, too).
so if anybody and especially the author of the TODO-bundle finds bugs
in my code, please tell me over this list.
regards, niko.
ps: excuse my bad english.
--
____________________________
niko dittmann <ni-di(a)web.de>
____________________________
Hi Robert, hi Mark (et al.),
I've just downloaded TextMate and subscribed to this list, curious if
there's also a ConTeXt bundle to work with.
As I have read your thread from last year I was wondering how things
are going?
Or does anybody else has good news for us ConTeXters?
Steffen
I have a server that gets all the åäö (and the like) botched when I
upload my stuff to it. I hate to see all the ä stuff when I
edit, so I thought a macro to do a project wide search and replace
would be nice just before uploading the stuff.
I tried to record a macro that would do a project wide find/replace,
but it didn't seem to work. Suggestions?
A reference to characters can be found at
http://dillo.rti-zone.org/Html.testsuite/entities-latin1.html
Andreas
> inspired by the UI thread I hacked together a TextMate plugin. It
> shows all bundle shortcuts applying to the current scope whenever a
> modifier key is held for more than a second.
I agree this plugin is fantastic, but I had to remove it after just a
few minutes of use as I had no idea I often hold modifier keys while
I'm thinking, and it kept popping up when I didn't want it to.
Simply changing the method to invoke it would make it immensely more
useful.
Thanks for your work on this! Very cool idea..
Nate.
---------------------
CLIXEL Design & Coding -- http://clixel.com/
BRAINFAG Comics -- http://brainfag.com/
Hello,
I'm evaluating TextMate (coming from Vim) and I really like what I
see. I'm now trying to create my first Bundle, to deal with some
editing I do every week to create the Caml Weekly News. The format
I'm using is xml, so I'd like to have a Bundle with the same language
syntax, a few new snippets, and a command stolen from the HTML bundle.
About the language syntax, I'm a little confused by what the manual
says (http://macromates.com/textmate/manual/
language_grammars#language_grammars) about scopeName:
"scopeName (line 1) — this should be a unique name for the grammar,
following the convention of being a dot-separated name where each new
part specializes the name. Normally it would be a two-part name where
the first is either text or source, and the second is the name of the
language or document type. But if you are specializing an existing
type, you probably want to derive the name from the type you are
specializing. E.g. Markdown is text.html.markdown and Ruby on Rails
(rhtml files) is text.html.rails. The advantage of deriving it from
(in this case) text.html is that everything which works in the
text.html scope will also work in the text.html.«something» scope
(but with a lower precedence than something specifically targeting
text.html.«something»)."
So I tried a scopeName of "text.xml.CWN" to see if I would get XML
like syntax hilighting for free, but it did not work. I had to do:
{ scopeName = 'text.xml.cwn';
fileTypes = ( );
patterns = ( { include = 'text.xml'; } );
}
including the text.xml language.
Is this the correct way to proceed?
Another question is about the presence of a support directory in a
tmbundle (as there is one in the html bundle). Do they need to be
created by hand in the Finder, or is there a way to add a Support
file using the Bundle Editor?
My last question is about snippets: it seems that it's not possible
to invoke a snippet while completing one (that is, in the middle of
tabbing through all the fields to fill). Is it the case?
Thanks a lot,
Alan
--
Alan Schmitt <http://sardes.inrialpes.fr/~aschmitt/>
The hacker: someone who figured things out and made something cool
happen.
.O.
..O
OOO
Is there a way to run some code from a Bundle before TextMate opens a
file? The idea would be that when I run either:
$ mate foo.c
or
$ mate myprojectdir
and then click on foo.c I get to see if foo.c is version controlled
and then I check it out if it is. The version control system that I
use (BitKeeper) has a 'get' mode that checks out the files read-only,
and before editing you have to check them out in 'edit' mode. I have
written a function in a bundle that does this, but I have to call it
manually. I would like that to be automatic...
Thanks,
-Oscar
--
pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1