Hi,
In a snippet with a mirror, how do you allow a mirror to be followed
immediately by a number without that number being interpreted as a part of
the mirror value?
i.e., make it that $11 is interpreted as <contents of group 1><digit 1>
$11 is interpreted as match 11
$1\1 (and \\1 and \\\\1) all let the slashes flow right through rather than
consuming them as escapes.
Any clues or is this a limitation in snippets?
Tim
____________________
Famous lauded but completely wrong judgements:
When Oliver Wendell Holmes defined the class of speech which was not
protected by the first amendment as being the class of speech which includes
shouting "fire" in crowded theatre when there was none, he did so in a case
where he was justifying the jailing of Yiddish protestors against the draft
in WWI.
It is of course most critical to protect speech exactly when there is debate
over whether there is a "fire" (incitement to imminent violence) or not, and
that is what Holmes failed utterly to do.
I decided to write a modified version of a MultiMarkdown command, and
because I'm better at Ruby than I am at bash, I wrote my version of the
command in Ruby. It's working!
However, in order to pass the incoming text thru MultiMarkdown.pl, I open a
subprocess. I am not very savvy at subprocesses, so I have a couple of
questions:
(1) Is there an elegant way? Right now I'm using IO.popen, which has the
virtue that I understand what I'm doing, even though it's wordy.
(2) More important: we do not seem to be picking up the paths automatically,
so I have to construct (from ENV) a full path to where MultiMarkdown.pl sits
inside the support bundle. Is there a trick for handling this? The original
bash version just automagically "sees" MultiMarkdown.pl and SmartyPants.pl;
is there some way my Ruby script can automagically see them too?
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.amazon.com/gp/product/0596102119>
Hi,
First off, a big thank you to whomever wrote the Hyperlink Helper! What a
great little bundle! I think you have helped the world, as this will make
more pages incorporate referencing for claims, and help wikipedia become the
top link for information and make links more semantically (in the Tim
Berners Lee sense of semantic link) valid
Buglet for you:
Select the text "Cronbach's alpha"
"Lookup selection on wikipedia and link" -->
Received exception:bad URI(is not URI?):
http://en.wikipedia.org/wiki/Cronbach\'s_alpha
<a href="" title=""></a>
In a plain text document it returns the following
Received exception:bad URI(is not URI?):
http://en.wikipedia.org/wiki/Cronbach\'s_alpha
(this language is not supported, see for more info)
> On 4. Jul 2007, at 23:12, Max Lein wrote:
>
> > The problem with TextMate is that it essentially forces people to
> > use UTF8.
>
> Yes, and as I tried to explain, there is good reason it does that.
There are usually `good' reasons not to as well. For all I love about
TextMate, it's a bit pushy here ;-)
> > I have yet to find a way how to teach TextMate that my default
> > encoding is Latin1 (even though this is the default encoding which
> > I have set in the prefs): as long as a TeX file doesn't contain any
> > special characters, it will automatically assume they are UTF8
files
> > (ignoring my preference and -- if existant -- the metadata
connected
> > to that file).
>
> When checking “use for existing files” it will respect your
> preference. However, I fixed the problem for next build, so when
files
> with ASCII encoding can’t remain as ASCII, it will first try your
> preferred encoding (even when the “use for existing files” is not
> checked).
Well, my web pages use UTF8 ... so this option doesn't really solve the
problem. (I am aware of said option, but it just shifts my problem.) As
I said, an encoding per project option would be greatly appreciated (I'm
not sure I understand the last part of your reply correctly and whether
TextMate 2.0 would effectively resolve this issue).
> >> [...]
> >
> > However, going UTF8 is sometimes just not an option [...]
>
> Maybe not, but the bundle commands (which was the topic of this
> thread) can’t be expected to work with your files, when those
> are not UTF-8. I.e. go with Latin-1 and use special characters,
> and you should be prepared to see no or garbled output from script
> runners (which show script output), diff commands (showing changes in
> your files), build commands (which quote parts of your source), log
> commands (showing SCM log entries), various validation/completion/
> pretty-printing commands, a.s.o.
You clearly have the perspective of someone who codes (which is fine by
me, just an observation), but I haven't noticed any garbled output while
working with Latin1. That's probably due to the simple fact that I just
use a very specific subset of TextMate's commands. For me, a one-time
warning would be acceptable.
> > I frequently exchange files with people who work on Windows,
> > Linux or Solaris and the standard encoding they use is usually
> > Latin1. Yes, there are ways how to use UTF8 on other OS, but have
> > you ever tried to convince someone to switch to UTF8 who still
> > writes his papers in Plain TeX?
>
> Would plain TeX not be ASCII? :)
... but my contribution isn't. The encoding is `hardcoded' into
LaTeX (it's a simple command), so when the chapters are merged, we'd
get into trouble (not necessarily with Plain TeX people of which
there are admittedly very, very few left, but with all of my active
co-workers). (We usually split our work into sections which are then
compiled. Obviously any other wants to be able to compile the TeX code
on his system without fiddling for half an hour. I've seen it happen
often enough.)
> > Instead of blindly arguing for people to convert to UTF8 (which
> > is what I would use if I got to choose), you should accept that
> > people (= customers) want to and sometimes need to work with other
> > encodings as well.
>
> In what you replied to I gave a technical explanation of why it
> is highly infeasible to support other than UTF-8 for the various
> commands, which was the topic raised. Me accepting that some can’t
> use UTF-8 doesn’t really change that.
Well, I understand the reasons you gave, but people who use LaTeX need
just functionality, most of which is provided by the LaTeX (or Beamer)
bundle. I think if people consciously change the encoding to something
other than UTF8, they have a good reason for doing so. Give them a
warning (once) that some commands may not work would be acceptable to
me. I haven't heard of people in my field using diff on their TeX source
files, for instance. I've also never had any problems with TextMate's
built-in commands that produced no or garbled output.
I can certainly understand if you'd rather fix other problems than
these. But I think there are certain fields when this is just an
essential feature and the people would even be willing to live with a
smaller feature set.
> > I'm still longing for an `encoding per project' option which
> > TextMate would stick to no matter what. And also an error message
> > that tells me that I cannot save my .tex file in Latin1 because
> > there are some (invisible) characters that prevent it from doing so
> > (right now, it'll just revert to UTF8 without telling me).
>
> I have commented on this a few times in the past; the lack of a
> warning is indeed very unfortunate, and it comes from the code that
> does this “bumping” of encoding not having access to the UI. A
> mistake 2.0 will be without -- and as for encoding per project, I
> can’t recall exactly how much I have said here, but 2.0 does move
> a lot of things to be more folder-oriented and has another approach
> to dealing with encodings, basically offloading this to customizable
> import/export hooks, so non-UTF-8 users should be able to get
whatever
> they want.
That's very good news (although the first time I hear of those new
features). I hope that you don't have to set these encoding hooks
globally (not 100 % sure what you mean by that), as I mentioned, I use
UTF8 whenever I can (e. g. for the websites I maintain) and Latin1
*when I have to*. Hence different projects, different encodings and
a per project encoding seems like the best option to me. (I usually
create a project for my papers (LaTeX) since LaTeX is very noisy and
creates a phletora of files I almost surely don't need.) :-)
Max
UC Berkeley
Department of Physics
Is it possible to create a "palette" using tm_dialog? From a ruby
shell I can create a dialog that reads in a list and then lets me
load a nib asynchronously, clicking add multiple times. It then
returns all of the added choices when I close the nib. There are two
issues I'm working through:
1. When I run the same code from within a command, the dialog (nib)
freezes and takes no input until I cancel the command. I'm using the
wait_for_command loop from the dialog.rb code. I then manually close
the nib from the terminal. Is there something I'm missing?
2. I'd like to be able to keep the "palette" open and insert
snippets (or tags in this case) as I go, rather than upon window
close. I'd like to use this for both the Autotag bundle and the
Wordpress bundle, keeping a palette of Tags/Wordpress snippets open
and insertable at any time. Any way to do this?
Thanks,
Brett
Suppose you’re a person with a bad short-term memory doing test-
driven design. (You’d be me.) You’d want to have both the test source
and corresponding product code source visible at the same time. You'd
probably also like to to spend screen real estate to show a couple of
other files as well.
To this novice user, TextMate doesn’t seem like it wants you to be
doing that. For example, apple-t doesn’t remember visits to separate
windows, so when I want to visit “that file I was just in”, I have to
remember whether it was in a tab or a window and use either apple-t
or apple-`. But the reason I want separate windows is I have no
memory for such things.
However, I’m early enough in the Emacs->TextMate switch that I’m sure
I’m missing many things. How do you use TextMate on big screens?
-----
Brian Marick, independent consultant
Mostly on agile methods with a testing slant
www.exampler.com, www.exampler.com/blog
if I create an image and save it to a folder that has been opened in the
project pane, how do I get TextMate to recognise the new files?
the files are on a shared network folder, could this be part of the problem?
(I'm using TM on a Mac mini, with a WAMP set up for my development on a
different box on the LAN)
currently I have to "add existing files"
is there a better way to "refresh" the files and folders in the project
that I've missed?
if all the files were on a Mac would TM recognise new files in project
folders automatically?
TIA
--
Join me: http://wiki.workalone.co.uk/
Engage me: http://www.boldfish.co.uk/portfolio/
>> I understand the problem now. However, how come TextMate can
>> detect what encoding was used for a file, and the scanner can not ?
>
> TextMate can *not* detect the encoding of your files. If you use
> UTF- n encoding, there is a 99.9999…% chance that it will get it
> right, but *any* other encoding, and TM’s guess is based on a
> frequency table and how well your file corresponds to this
> distribution when interpreted in the various encodings.
The problem with TextMate is that it essentially forces people to use
UTF8. I have yet to find a way how to teach TextMate that my default
encoding is Latin1 (even though this is the default encoding which I
have set in the prefs): as long as a TeX file doesn't contain any
special characters, it will automatically assume they are UTF8 files
(ignoring my preference and -- if existant -- the metadata connected
to that file).
> So anything else than mandating UTF-8 will make things break, and
> there is no technical solution to this problem. Sure, you can have
> things work “good enough” for some w/o going 100% UTF-8, and you
> can maybe fix some of the stuff that breaks when you are not using
> UTF-8, but you can never fix it all, so IMO it’s really not worth
> trying to support more than UTF-8, UTF-8 is the solution to the
> encoding problems of the past.
However, going UTF8 is sometimes just not an option. I frequently
exchange files with people who work on Windows, Linux or Solaris and
the standard encoding they use is usually Latin1. Yes, there are ways
how to use UTF8 on other OS, but have you ever tried to convince
someone to switch to UTF8 who still writes his papers in Plain TeX?
Instead of blindly arguing for people to convert to UTF8 (which is
what I would use if I got to choose), you should accept that people
(= customers) want to and sometimes need to work with other encodings
as well.
I'm still longing for an `encoding per project' option which TextMate
would stick to no matter what. And also an error message that tells
me that I cannot save my .tex file in Latin1 because there are some
(invisible) characters that prevent it from doing so (right now,
it'll just revert to UTF8 without telling me).
Max
UC Berkeley
Department of Physics
I'm having a bit of trouble trying to work out if it's possible to
have compound regular expressions in a snippet.
Basically, I want to replace all spaces in a tab-stop with hyphens,
whilst also lowercasing the whole string -- two things I can happily
do separately:
${1/.*/\L$0/}
${1/ /-/\g}
but can't seem to work out if it's possible to do both at the same
time. I've tried replacing the tab-stop in one expression with the
output from another:
${${1/ /-/\g}/.*/\L$0/}
but it doesn't work. I know it's possible if I create an intermediate
tab-stop like this:
${2:${1/.*/\L$0/}}
${2/ /-/\g}
but I don't want to do this as I have no use for the intermediate value.
Any help would be greatly appreciated! Thanks in advance.
Jordan