Hi,
>> here comes a suggestion for all R users.
>> I wrote a tiny R daemon bundle in order to run R 'inside' of TM.
>> There is no need to start RGUI etc.
>> I found a naive way to do it and it turns out, at least for me,
>> it's quite useful. So my question is whether this approach is also
>> useful for others. If yes, I/we can elaborte this bundle.
This is a fantastically useful prospect for R users: just a vote in
favor of continuing work on this. A functional equivalent within TM to
ESS within Emacs would really break the last strong reason many Latex
+R types have for sticking with Emacs.
Kieran
I am not *writing* XML files, but I often want to understand one --
either just for education or because I need to modify it.
Often the file in question was automatically generated and "ease of
reading by humans" was not part of the process.
Right now, I trying to pull apart a XML file where a single element
contains about 90 attributes. Thankfully, they *do* seem to be
ordered alphabetically, but they are all run together in a single
line. That is, there are no linefeeds between attributes. Which
would be just what I'd like (for readability anyway -- I'm hoping
that "white space is white space and it won't matter whether those
white-spaces are space characters or line feeds).
For this file, using Find and Replace seems to work. (Find
<doublequote><space> replace with <doublequote><newline>). I don't
know enough about XML to know if it always going to be as easy as that.
The XML bundle item "Tidy" actually runs xmllint, but I don't see a
way to make that do what I want.
Searching Google on "XML pretty print" I came up with a number of
hits, but many bits of code were from the year 2000 or so.
Does anyone know of any... contemporary solutions? Or have other
suggestions/ideas?
Thanks!
eo
Hi,
Since I updated to r1455 this morning I have been unable to run tests in my
rails app. RakeMate returns the following error:
Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again:
http://rubygems.rubyforge.org
I have RubyGems 1.0.1 installed and had no problems prior to the update. I
am running on Leopard, upgraded from Tiger, and I am still using my previous
MacPorts Ruby config. The application is Rails 2.0.2. Is anyone else
having this problem?
Peer
On Dec 31, 2007, at 1:04 AM, Hans-Jörg Bibiko wrote:
On 30.12.2007, at 20:13, Sergei Yakovlev wrote:
It would certainly be easier for the average user (and somewhat
more flexible) if TextMate had something like
$TM_SELECTED_TEXT_START_LINE_NUMBER and
$TM_SELECTED_TEXT_START_COLUMN_NUMBER
variables, or, alternatively, slightly changed semantics of
$TM_LINE_NUMBER and $TM_COLUMN_NUMBER variables
so that they always return the starting position of selection
(no matter how the selection was made).
Do you know these variables?
$TM_INPUT_START_LINE
$TM_INPUT_START_LINE_INDEX
Oh, I did not know these existed. Thank you, Hans! These variables
are missing from the official Manual. I decided to check for other
variables, and found that TM_COLUMNS and TM_COLUMN_NUMBER
are missing as well. Should I submit a documentation patch?
Ho-ho-ho,
Sergei Yakovlev
I've created a rather nasty hack to allow one to paste to any online
contact ASWELL as any open chat in adiumx. (current version is only
any open chat). The full source of get_destinations.scpt (found in
TextMate.tmbundle/Support/) is attached along with a screen shot.
Compile it with Script Editor.
On Dec 26, 2007, at 10:28 PM, Allan Odgaard wrote:
On 26 Dec 2007, at 14:28, Сергей Яковлев wrote:
[...]
Suggestion 1. It would be useful if TextMate had
variables like $TM_SELECTION_START and
$TM_SELECTION_END which would return the
corresponding offsets in the file (or the cursor
offset, if nothing is selected).
It does in the form of a line/column position of the start position.
Maybe I am simply misunderstanding you, but are you saying that
TextMate returns line and column position of the start position of
selection?
I'm asking because the $TM_LINE_NUMBER and
$TM_COLUMN_NUMBER variables don't quite work this way.
To illustrate what I mean, let's add a 'Show Position' command
that displays position as a tooltip:
echo "$TM_LINE_NUMBER:$TM_COLUMN_NUMBER"
and type 'TextMate' into an empty document. Now, if we select
'TextMate' with mouse from left to right, the command returns 1:9.
If we select 'TextMate' with mouse from right to left, the command
returns 1:1. Finally, if we select 'TextMate' by double-clicking
between 't' and 'M', the command returns 1:5.
So, these variables actually return the cursor position, not the
starting position of selection and it is impossible to calculate the
starting and ending positions of selection from
$TM_LINE_NUMBER and $TM_COLUMN_NUMBER variables
(without knowing how the selection was made).
The only way to do this (that is known to me) is to write a macro that
first calls a command that replaces selection with itself wrapped in
U+FFFC characters:
echo -n $'\357\277\274'$TM_SELECTED_TEXT$'\357\277\274'
and then calls another command that receives the whole document
as an input and can "find" the selection looking for U+FFFC
characters.
It would certainly be easier for the average user (and somewhat
more flexible) if TextMate had something like
$TM_SELECTED_TEXT_START_LINE_NUMBER and
$TM_SELECTED_TEXT_START_COLUMN_NUMBER
variables, or, alternatively, slightly changed semantics of
$TM_LINE_NUMBER and $TM_COLUMN_NUMBER variables
so that they always return the starting position of selection
(no matter how the selection was made).
The reason it does not use a byte offset is that internally TM would have to
"calculate" this (by adding the length of each line preceding the selection)
and I am generally wary of exporting shell variables that need to be
calculated and have an unknown running time (i.e. in practice the user could
have a million lines and each command execution would then always require a
million numbers to be added together).
I assumed that these calculations were already being performed,
after I had a look at:
$ class-dump -C OakTextView TextMate | grep selectedRange
- (struct _NSRange)selectedRange;
- (void)setMarkedText:(id)fp8 selectedRange:(struct _NSRange)fp12;
and saw 'selectedRange'. But, evidently, something much more
complicated is going on, and I certainly would not ask you questions
about TextMate internal workings :-)
The only remaining question is what symbol to use as a
mark. I decided to use √ (221A, SQUARE ROOT character,
which you can type with Option-V), but I'm not sure
this is the best choice. Maybe it's better to use some
character from Private Use Area (E000--F8FF)?
We generally use U+FFFC, OBJECT REPLACEMENT CHARACTER.
I've attached a new version of macros using U+FFFC to the original ticket.
Happy New Year!
-- Sergei Yakovlev
Hello list,
when running the following simple Ruby-Program:
require 'rubygems'
require 'active_support'
using Command+R, I get the following output:
/Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/blankslate.rb:84:in
`blank_slate_method_added': stack level too deep (SystemStackError)
from /Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/blankslate.rb:
84:in `blank_slate_method_added'
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:86:in `method_added'
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:111
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/
active_support/core_ext/array/conversions.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
... 8 levels...
from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/
active_support.rb:30
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require'
from /Users/cypher/Projects/test.rb:2
/Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/blankslate.rb:84:in
`blank_slate_method_added': stack level too deep (SystemStackError)
from /Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/blankslate.rb:
84:in `blank_slate_method_added'
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:86:in `method_added'
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:111
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/
active_support/core_ext/array/conversions.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
... 8 levels...
from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/
active_support.rb:30
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require'
from /Users/cypher/Projects/test.rb:2
(OS X.5, default Ruby 1.8.6p111, TextMate Build 1436)
The problem is that both the builder-gem and TextMate's builder.rb try
to alias method_added to blank_slate_method_added. I've patched TM's
builder.rb to alias to tm_blank_slate_method_added instead, which
works. However, this is only a hack to fix this problem, I'm sure
there is a better way to address this (e.g. builder.rb checking wether
a module 'Builder' already exists, and if not, load tm_builder.rb or
something like that).
regards, Markus
When typing the space key in my code in TextMate, how can I let
TextMate use a particular number of spaces instead of that tab character?
I would like to always use 2 spaces instead of the tab character.
Also, how can I auto-format code that already have tabs (or tabs replaced by, say, 4 spaces)
to format it the way I want it (say, tabs replaced by 2 spaces)? Microsoft Visual Studio allowed me to do that. Does TextMate provide such facilities? (Guess I could always turn to regular expressions to fix such stuff.)
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Today i get new revision of TextMate. This is good! and i saw this:
[2007-12-29: REVISION 1455]
[NEW] JavaScript bundle: Add a Javascript beautifier script, with a shortcut
of Ctrl+Q. (Michael Sheets)
Cool! But... sorry pals - I can't find it!
I didnt use svn version of Javascript bundle (but ofcourse i svn up Support
and all *.tmbundles after i receive new TM revision).
I restart TM - and still nothing.
Ctrl+Q works but it do something i would call "minify me code".
Do i miss something?