I have written a command to "Reflow comments" in my Stata do files.
The command is as follows:
#!/usr/bin/env bash
sed -E -e 's_^\s*//(.*)_\1_' | # strip leading // and whitespace
from each line
fmt | # reflow comment text
sed -E -e 's_^(.*)_//\1_' # prefix each line with //
Input is set to "Selected Text" or "Scope", and output is set to
"Replace selected text".
If I invoke the command with the cursor in the middle of the following
comment:
// this is a profoundly silly comment that I'm writing just to test
out how to reflow comments
// something strange happens when I select the text rather than simply
execute it within the comment scope
// i wonder what's going on
// maybe i'll write to the mailing list
I get the desired output:
// this is a profoundly silly comment that I'm writing just to test
out how to
// reflow comments something strange happens when I select the text
rather
// than simply execute it within the comment scope i wonder what's
going on
// maybe i'll write to the mailing list
However, if I instead select the entire block of text, I get the
following mangled result:
// this is a profoundly silly comment that I'm writing just to test
out how to
reflow comments // something strange happens when I select the text
rather than
simply execute it within the comment scope // i wonder what's going
on // maybe
i'll write to the mailing list
Can anyone explain what causes the differing behavior?
Thanks!
Michael Manti
statboy3000(a)gmail.com
Trying out the ActionScript 3 bundle, and I get this error when I try
to build using mxmlc:
Loading configuration file: flex-config.xml
/Library/Application Support/TextMate/Bundles/ActionScript 3.tmbundle/
Support/bin/parse_mxmlc_out.rb:31:in `+': can't convert nil into
String (TypeError) from /Library/Application Support/TextMate/Bundles/
ActionScript 3.tmbundle/Support/bin/parse_mxmlc_out.rb:31 from /
Library/Application Support/TextMate/Bundles/ActionScript 3.tmbundle/
Support/bin/parse_mxmlc_out.rb:24:in `each' from /Library/Application
Support/TextMate/Bundles/ActionScript 3.tmbundle/Support/bin/
parse_mxmlc_out.rb:24
I can't figure out what's causing this. Any suggestions?
Hi!
At time I have no Mac as a laptop and therefore I use emacs when I'm
not in front of my iMac. I just found out that emacs has quite a
simple but cool outline-mode and wanted to ask if it is already ported
to TextMate. Does anybody know?
Niels
On Fri Apr 18, Kai von Fintel wrote:
> The minimal test case below shows that something in the parsing of the
> newenvironment command is throwing off the syntax coloring by the
> LaTeX bundle, at least on my system (TM 1.5.7 1464 on Leopard). The
> text in the document is incorrectly parsed as being in a math
> environment.
>
> \documentclass{article}
>
> \usepackage{amsmath}
>
> \newenvironment{choice}
> {\left\lbrace\begin{gathered}}
> {\end{gathered}\right\rbrace}
>
> \begin{document}
>
> Text incorrectly parsed as being in a math environment.
>
> \end{document}
>
> -----
>
> Any ideas of how to fix the parsing?
Hi Kai -- This isn't exactly the correct fix, but if you go to Bundles-
>Bundle Editor->Edit Languages... and pick the LaTeX->LaTeX syntax
definition, down about 1/3rd of the way down, you'll find the place
where it is looking for these mathy environments:
align|equation|eqnarray
| multline|aligned|alignat
| split|gather|gathered
soon below that, you'll find
end = '(?x)
(?:\s*) # Optional whitespace
If you change the (?:\s*) to (?:.*?) then you can get a sort of
approximation of the correct syntax coloring.
I really don't quite understand why it works, but the idea was
essentially to allow the { that precedes the \end{gathered} to be
ignored (it wouldn't have counted as whitespace). In the original
formulation, TextMate couldn't find the \end{gathered}, and so just
assumes that the environment ends when the document does.
This isn't actually the right solution, but it at least keeps you from
having the entire body of your document math-colored. The symptom of
why this isn't the right solution is that everything following
\begin{gathered} (including the closing brace of the first argument to
\newenvironment, as well as anything from then on until just before
the line containing \end{gathered}) is math colored.
Ideally, the LaTeX bundle would be able to handle \(re)newenvironment
specially, since each of the two arguments to these commands will
almost always contain a lone \begin or \end, and scope of any
mathification should presumably be restricted to the argument itself.
But I haven't got a clue how to approach this the "right" way.
-Paul
Hi.
I've recently moved from emacs to TextMate and am enjoying the shift.
When i first tested it, the Latex bundle option "Typeset & View"
worked fine. However that was short lived, and a week later i now get
"There was a problem reading the preferences file, continuing with
defaults".
I've noticed other people have experienced this before, and the
previous posts on the subject seem to say that this is a problem with
the python plist parser under Tiger, but that Leopard should be fine.
However i'm using 10.5.2 and the latest version of vanilla TextMate
(freshly downloaded), running on a PPC G4. I have also freshly
installed teTex from macports which works fine both in emacs and from
the command line.
Can anyone suggest where to begin?
Thanks.
Hey all! I have been looking around to see if anyone has made a script or bundle
that enables the functionality of MarkupMaker for TextMate.
http://www.accessify.com/tools-and-wizards/developer-tools/markup-maker/def…
In other words: take selected text, indented by spaces, and convert them to divs.
I did a quick search on the mailing-list and saw that people were talking about
this a while back, but I wasn't sure if anyone had figured this out. :) If not,
I may have to build my own script!
Thanks!
R
When I press Control-H in a Ruby document, I don't get documentation on
what's selected; instead, I get an error message like this:
/usr/local/bin/qri:17: undefined method `require_gem' for main:Object
(NoMethodError)
This just recently started happening (perhaps after updating some gems).
'qri' itself may have been updated, as its date is April 23.
What is 'qri'? It seems to be what's broken; if I just say "qri" in the
Terminal I get the same message.
Meanwhile, 'ri' works just fine in the Terminal.
Thx -
m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
On 1 May 2008, at 12:20, Allan Odgaard wrote:
> On 30 Apr 2008, at 17:37, Juan Falgueras wrote:
>
>> the original command to get man doc from Tcl commands in Tcl mode
>> was broken (at least in my system -with Developer Tools installed)
>> I have simplify it to a simpler and working script borrow from the
>> Shell script mode one:
>
> Is there any reason to actually keep this, instead of just removing
> it and relying on the command from the Shell Script bundle?
>
> I can imagine for Tcl you’d want to provide the manual section, but
> doesn’t seem like your command does that.
Here the reason is that Tcl has its man entries in the "n" volumen and
thereafter you must issue a command like:
man n regexp
- Juan Falgueras
I am looking at an upgrade for someone. All the files are ASP. I
dragged the folder over TextMate and realized that ASP Bundle is not
there.
What nobody on a Mac is editing ASP in TextMate? I don't get it!
;-)
--
Brad Tittle
Senior Systems Analyst
Trainnow.net
206-780-9555
Hi,
I've recently switched from Makefile based C++ projects to CMake
based. The Makefile bundle had a very nice compile HTML output were C+
+ errors/warnings were highlighted and clickable.
Is there any similar bundle for CMake for Textmate?
With kindest regards
Jonatan
Hi folks.
I have a problem with "typeset and view" with the latex bundle.
It used to work; now it doesn't. Whenever I 'typeset and view' the display
window doesn't display the pdf. The progress wheel spins indefinitely. I
tried changing the shell variable TM_LATEX_VIEWER to another pdf viewer
('preview') from my previous choice of 'TeXniscope' but that didn't help.
The latex engine is working, because I get the final pdf in my directory, i
just can't see the nice quick preview with cmd-R. Any suggestions?
May it be a problem with Acrobat? The display window, while trying to
perform its fruitless display, shows an Acrobat icon.
Thanks,
Sean
--
----------------------------------------------------
Sean McDaniel
personal: sean.m.mcdaniel(a)gmail.com
-----------------------------------------------------
Since I found this:
http://blog.macromates.com/2006/multi-stroke-key-bindings/
I'm using it a lot, and it is really nicer to type ⌘A than Cmd-A,
when writing all documentation, support mails etc.
I've tried to use those ⌘⇧⌥← when editing some markdown blog
post content, and I was quite surprised that TM displays them heavily
condensed, making them totally unreadable.
I tried with few fixed-width fonts, nothing helps. Is there any way to
cure that?
Cheers,
--
Adam Strzelecki |: nanoant.com :|
Hello,
I'm new to the Python Bundle in TextMate and was wondering how one
would go about formatting the docstrings in Python. The traditional
CTRL-Q did not work correctly. I then opened up the Bundle editor and
added the "string.quoted.double.block.python" to the scope of the
format "Reformat Comment" command in the Source Bundle. Again, this
did not work correctly. I then attempted to create my own command to
reformat comment, but when I read what is passed to the script, I get
the whole damn document, and not the scope.
Thanks in Advance,
- Nithin
As an interesting side note I attempted to copy the Reformat Comment
command and do some alterations to it, but for some reason, this is
not set: ENV["TM_BUNDLE_SUPPORT"]. I wonder why it's set in the Source
Bundle, but not in my own Bundle...
Hi all,
I really having trouble with TM. For some reason TM does not consider
the % sign within LaTeX. This means I get a lot of error messages. If
I comment out some included file (e.g. %\input{history}) TM still
reads the file and sends me errors like:
Latex Error: ./history.tex:6 LaTeX Error: Something's wrong--perhaps a
missing \item.
The file looks at this point as follows:
% \item parindent durch Option halfparskip entfernt
Why does that happen and so suddenly and how could I resolve it?
Thanks
Christian
Hi,
I'm not sure whether somebody has asked this before, but what is the
current status of Ruby bundle compatibility with 1.9, at least for
execution in TM preview window?
I'm trying to execute simple ruby script with ⌘R:
> #!/usr/local/bin/ruby-1.9
> puts "Ala ma kota".reverse
I get:
> RubyMate r8136 running Ruby r1.9.0 (/usr/local/bin/ruby-1.9) >>>
> test.rb
> :0:in `require': /Applications/TextMate.app/Contents/SharedSupport/
> Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:13:
> invalid multibyte char (SyntaxError)
> /Applications/TextMate.app/Contents/SharedSupport/Bundles/
> Ruby.tmbundle/Support/RubyMate/catch_exception.rb:13: invalid
> multibyte char
> /Applications/TextMate.app/Contents/SharedSupport/Bundles/
> Ruby.tmbundle/Support/RubyMate/catch_exception.rb:13: syntax error,
> unexpected $end, expecting ')'
> ...ML e.message.sub(/`(\w+)'/, '‘\1’').sub(/ -- /, ' — ')...
> ... ^
> Program exited.
AFAIK 1.9 is getting closer towards stable release, so the final
syntax, and for sure it is much faster than 1.8, so for executing some
simple tasks but time consuming tasks it may be a good alternative to
1.8.
Cheers,
--
Adam Strzelecki |: nanoant.com :|
Greetings,
When I google the two terms "bbedit balance" (without the quotes) and
the resulting search ranks a textmate mailing list post as #1, I start
thinking, "I wonder if Allan is aware of this?"
I checked previous discussions (but only through 2006) to see if
anything had developed in the realm of balancing braces in the way that
"the app formerly known as the mac programmers first choice" did, back
in the day. And by the looks of things, I see only heavyweight solutions
to balance tags, which I believe is way more than I need and possibly
not what I want.
I also think it's undesirable to download an eval copy of "the app
formerly known as the mac programmers first choice" for this feature.
Perhaps my Christmas wish will be:
Oh please,
Oh please,
Deliver command b,
Under the tree.
Cheers!
the nameless popular programmers
On Apr 30, 2008, at 07:00, Jacob Rus wrote:
> Whether this will be implemented any time soon, or ever, is an open
> question, but several months ago we had some good discussions on
> ##textmate about how to make the most incredible indented softwrap
> the world has ever seen.
Is that conversation archived anywhere? I'd be curious to know what
people were attempting and what they were able to achieve.
Hi,
Creating a nomenclature with nomencl needs to invoke MakeIndex with
the following:
makeindex ⟨filename ⟩.nlo -s nomencl.ist -o ⟨filename ⟩.nls
The *.nlo file is successfully created after running LaTeX and I would
like invoke MakeIndex as I do it when compiling the document with LaTeX.
How could I do that?
Thanks in advance,
Christian
On 2008-05-01, at 07:00 , Allan Odgaard wrote:
> I have these notes from Jacob: http://pastie.textmate.org/189818
Thanks for that link, Allan. I thought, perhaps, someone had developed
some additional parameters for something like Markdown already. I like
everything that Jacob sketches out there.
Did anyone write anything that attempts the indented softwrap? (This
question is for the entire list.)
Hi,
When I work with new projects I often orientate on old ones. Therefore
I include these old files in the project drawer within my new project.
Often I copy something from the old ones. To prevent the old
(original) files from being changed during that, is there way to lock
it or give only rights for reading to it?
Thanks in advance
Christian
Hello,
For my glossary I use the package gloss. After a LaTeX run of the
document gloss creates a .gls.aux is created. In need to invoke BibTeX
on that file and would like to it with a nice shortcut as I do it when
using the command+L for creating my bibliography.
How could this be done with TextMate?
Thanks in advance,
Christian
Hi,
what is the best way to detect whether only DIALOG1 is available or
DIALOG2?
Up to now I would do this by checking whether the shell variable
DIALOG_1 is set. If yes I can use DIALOG2 features, if not I have to
use DIALOG1 syntax.
But I do not know whether there will be a change in the near future?
Thanks,
--Hans
Hi
the original command to get man doc from Tcl commands in Tcl mode was
broken (at least in my system -with Developer Tools installed) I have
simplify it to a simpler and working script borrow from the Shell
script mode one:
----------------
word=${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}
try_man () {
if man n -w "$word" &>/dev/null; then
page=$("$TM_SUPPORT_PATH/bin/html_man.sh" n "$word")
echo "<meta http-equiv='Refresh' content='0;URL=tm-file://$page'>"
exit_show_html
fi
}
try_man
echo "Couldn’t find documentation in 'man n' for “${word}”"
-----------------
- Juan Falgueras
Hi everyone,
Well here it goes. I am using TextMate to create ruby code. I can run
the scripts from the command line without issue. However when I run
the same script from with TextMate using command-R I end up with an
error stating it can not find the installed files seen from the
command line. I would appreciate any help with figuring this out.
Having quite a bit of editing to do in the future I would prefer to
remain in the same environment and not have to switch back and forth
during the development.
John Hannah