TextMateでGauche

Posted by yatsu Tue, 18 Mar 2008 10:27:41 GMT

『プログラミングGauche』を読んでいます。

TextMateでSchemeを書くには、Scheme.tmbundleを使えばよいのですが、⌘R でファイルを実行するときに gosh を使うには、以下の変更をして、設定の「Advanced」→「Shell Variables」で TM_SCHEME_INTERPRETERgosh とすればいいようです。

diff -uNr Scheme.tmbundle.org/Commands/Run Script.plist Scheme.tmbundle/Commands/Run Script.plist
--- Scheme.tmbundle.org/Commands/Run Script.plist   2008-03-15 15:54:26.000000000 +0900
+++ Scheme.tmbundle/Commands/Run Script.plist   2008-03-15 16:42:15.000000000 +0900
@@ -28,6 +28,8 @@
    "$INTERPRET" -s "$TM_FILEPATH" 2>"$TM_ERRORTEMP" | "$SHOWOUTPUT" "$INTERPRET" "$TM_ERRORTEMP"
 elif [ $CMD = "guile" ] ; then
   "$INTERPRET" -s "$TM_FILEPATH" 2>"$TM_ERRORTEMP" | "$SHOWOUTPUT" "$INTERPRET" "$TM_ERRORTEMP"
+elif [ $CMD = "gosh" ] ; then
+  "$INTERPRET" "$TM_FILEPATH" 2>"$TM_ERRORTEMP" | "$SHOWOUTPUT" "$INTERPRET" "$TM_ERRORTEMP"
 fi

 # Delete tempfiles
diff -uNr Scheme.tmbundle.org/Support/showoutput.rb Scheme.tmbundle/Support/showoutput.rb
--- Scheme.tmbundle.org/Support/showoutput.rb   2008-03-15 15:54:26.000000000 +0900
+++ Scheme.tmbundle/Support/showoutput.rb   2008-03-15 17:02:29.000000000 +0900
@@ -126,7 +126,8 @@
 schemesystem = File.basename(interpreter)

 systems = { "csi"       => "Chicken Scheme",
-            "mzscheme"  => "PLT MzScheme" }
+            "mzscheme"  => "PLT MzScheme",
+            "gosh"      => "Gauche" }

 # Start HTML output.
 printheader(systems[schemesystem], interpreter)

Posted in ,  | no comments | no trackbacks

Leopardでmate

Posted by yatsu Tue, 30 Oct 2007 12:26:21 GMT

LeopardでTextMateのmateコマンドを実行すると、

mate: failed to establish connection with TextMate.

というエラーが出て困っていたのですが、Nabble - mate command and screen in Leopard によると、Leopardのscreenと併用したときに起こる問題のようです。 MacPortsのscreenなら大丈夫と報告されていますが、FinkのscreenもOKでした。

Posted in , ,  | no comments | no trackbacks

EmEditorがTextMate化してきたような

Posted by yatsu Sat, 12 Aug 2006 19:14:44 GMT

EmEditorがv6になってからTextMateに似てきたような気がする。 意識しているのだろうか?

タブが付いてからWindowsのときは手放せないエディタになっていたが、今回エクスプローラ・プラグインが追加されて、ますます使いやすくなった。 僕の場合、馴れているTextMateに近いから使いやすいのかもしれないが……。
explorer.jpg (JPEG 画像, 640x480 px)

EmEditor Professional v6 の主な特長を見ると、TextMateと同じくSnippet機能もあるらしい。 TextMateみたいに使えるのかは未確認。

「EmEditor TextMate」で検索したら、以下を発見。

Posted in ,  | no comments | no trackbacks

TextMateでモードライン使用 (TabMate)

Posted by yatsu Tue, 06 Jun 2006 21:46:05 GMT

Emacsではファイル自体にそのファイルの編集モードを書いておくことができる。

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

このように書いておくと、Emacsでそのファイルを開いたときに自動的に以下のようなモードになる。

  • C++モード
  • タブ幅: 2
  • インデントにタブを使用しない(スペースを使用する)
  • インデントオフセット: 2

このモードラインをTextMateでも使用できるようにするプラグイン、TabMateが公開された。

・・・・・・のだが、自分の環境ではモードラインを認識してくれない。 なぜだろう・・・・・・。

追記 2006-06-13

バージョン1.0.1に上げたら認識されるようになった。

Posted in ,  | no comments | no trackbacks

Vibrant Ink

Posted by yatsu Wed, 04 Jan 2006 17:34:33 GMT

明けましておめでとうございます。 今年もまったり書いていこうと思います。


TextMatePrototypescript.aculo.usを使うときに便利なバンドルとテーマが公開された。

Textmate Vibrant Ink Theme and Prototype Bundle

JavaScriptファイルを開いてステータスバーのモードから「Prototype and Scriptaculous」を選択すると、Prototype風の文法を認識してハイライトしてくれる。

「Vibrant Ink」テーマは黒バックグラウンドで文法ハイライトが結構派手なテーマとなっている。 僕はこのテーマでバックグラウンドを90%透過にして使っている。

Posted in  | no comments | no trackbacks

TextMateでRailsのリバース・マイグレーションを簡単に

Posted by yatsu Wed, 30 Nov 2005 21:03:19 GMT

Auto-fill your reverse migrations で紹介されている Reverse_Migration.tmbundle を使うと、self.up の中身から、その逆のことをする self.down を生成してくれるらしい。

Posted in ,  | no comments | no trackbacks

TextMateがプラグインをサポート

Posted by yatsu Sun, 30 Oct 2005 07:05:53 GMT

TextMateがプラグイン機能を実装した。 どんなことができるのかは、まだ確認していない。

また、textmate-pluginsというメーリングリストも開設された。

以下、リリースノートより

[NEW] TextMate now has very rudimentary plug-in support. The plug-ins should have a .tmplugin extension and placed in either of the application support folders under TextMate/PlugIns. You can also double-click a plug-in to install it. An example plug-in is available on the bundles repository (under Tools/Clock Example PlugIn). Be warned there’s no actual API yet, but you can hack away with what Cocoa offers. Please subscribe to the plugins mailing list (http://lists.macromates.com/) if you have questions or specific requests (but be aware that the main priority ATM is 1.1 final, so the plug-in interface is really just a minor detour).

Posted in  | no comments | no trackbacks

TextMateのステータスバーが便利に

Posted by yatsu Thu, 27 Oct 2005 16:36:01 GMT

Textmate: Recent enhancements | 43 Folders にも書かれているように、TextMateのステータスバーが非常に便利になった。

→ 画像: TextMate Menu

ステータスバーから言語やタブサイズを変更でき、Bundleのコマンドを呼び出すこともできるようになった。

Posted in  | no comments | no trackbacks

mateコマンド [2]

Posted by yatsu Wed, 05 Oct 2005 16:44:46 GMT

TextMate revision 499からmateコマンドがTextMate.appに含まれるようになった(TextMate.app/Contents/Resources/mate)。

使用するには、PATHが通っているディレクトリにリンクを作っておく。

% cd ~/bin
% ln -s /Applications/TextMate.app/Contents/Resources/mate mate

また、ファイル名が _wait で終わる場合、デフォルトで mate --wait として実行されるようになった。

たとえば以下のようにmate_waitコマンドを作る。

% cd ~/bin
% ln -s /Applications/TextMate.app/Contents/Resources/mate mate_wait

引数なしの mate はファイルを開いてすぐに終了するが、mate --wait はファイルが閉じられるまでコマンドが終了しない。 mate_waitをEDITOR環境変数をセットしておくと便利だろう。

export EDITOR="mate_wait"

つまり、mate_waitコマンドはemacsclientコマンドのようなものだ。

それに対して、端末から手動でファイルを開く場合はmateの方がよい。

% mate ReleaseNotes.txt

Posted in  | no comments | no trackbacks

mateコマンド

Posted by yatsu Tue, 04 Oct 2005 02:24:00 GMT

コマンドラインからTextMateを開くコマンドが tm から mate に変更された。 tm だと間違えて rm とタイプしてファイルを消してしまうことがあるからだそうだ。

TextMateの最新版はrevision 488(TextMate changelog参照)だが、TextMate_r488.tbzには mate が付属せず、元の tm コマンドも動作しなくなっているので、 TextMate_r484.zipをダウンロードしてその中から mate コマンドをもってくる必要がある。

また、バージョンを上げたときにmateで

mate: couldn't launch TextMate (you may need to reset your LS database).

というエラーが出る場合、以下を実行する。

% /System/Library/Frameworks/ApplicationServices.framework/Frameworks/
  LaunchServices.framework/Support/lsregister -kill -r
  /System/Library/CoreServices /Applications /Developer/Applications

(上記、実際は一行)

Posted in  | no comments | no trackbacks

Older posts: 1 2 3