トップ «前の日記(Sun Dec 08 2002) 最新 次の日記(Sat Dec 14 2002)» 編集

よこいまさる日記



Tue Dec 10 2002 [長年日記]

[Misc] 昨日から雪が降ったり…

東京では昨日の晩から雪が降りだして… ヴーっ寒い。ということで少し写真をとってみた。

昨日の夜中、雪が積っていることに気付いたので、ベランダから一枚写真を撮ってみた。ちなみに夜中の3時ごろ。(笑)

ベランダからの風景

仕事が終わって帰宅したのはイイんだけど、エアコンを全開にしても気温が13℃ぐらいにしかならなくって寒かったのでコタツの布団をセットアップした。おかげで足元は暖い。

コタツ:

全然関係ないんだが、PHS の話をした日に PHS と iBook の写真を撮ったんだんだが載せわすれていたので、ついでにのせておこう。(ぉぃ

PHS

[Emacs] Region と括弧のハイライト

SuSE の Emacs-21 を使うと、どこをどうイジっているのか調べていないけど、指定しているリージョン (範囲) と、カーソル位置にある開き括弧とそれ対応する閉じ括弧、カーソルの前にある閉じ括弧とそれ対応する開き括弧に500ms ぐらい色を付けて強調というか highliting してくれる。使っているときには「まぁそこそこ便利やなぁ」と思っていた程度なんだけど、ふと Emacs の menubar のエントリを見てみたところ、Options の中に「Active Region Highlighting」と「Paren Match Highrighting」の2つがあるではないですか。

ということで、このメニューバーってどういう関数叩いているんだろぉと思ったので調べてみた。以下が menu-bar.el の Highlighting に関する部分みたいだ。

(define-key menu-bar-options-menu [highlight-paren-mode]
  (menu-bar-make-mm-toggle show-paren-mode
                           "Paren Match Highlighting"
                           "Highlight matching/mismatched parentheses at cursor (Show Paren mode)"))
(define-key menu-bar-options-menu [transient-mark-mode]
  (menu-bar-make-mm-toggle transient-mark-mode
                           "Active Region Highlighting"
                           "Make text in active region stand out in color (Transient Mark mode)"

どうやら、show-paren-mode を toggle すると括弧の highlighting が、transient-mark-mode を toggle するとリージョンの highlighting が行なわれるらしい。ちなみに show-paren-mode の既定値 (default) は loaddefs.el によると、以下のようになっている。

(defvar show-paren-mode nil "\
Non-nil if Show-Paren mode is enabled.
See the command `show-paren-mode' for a description of this minor-mode.
Setting this variable directly does not take effect;
use either \\[customize] or the function `show-paren-mode'.")

そんなこんなで ~/.emacs.el に以下のような内容を追加してやった。

(setq show-paren-mode t
      transient-mark-mode t)

あと term-mode-hook なんかで transient-mark-mode を nil にするとイイかもしれないと term.el の comment に書いてあった。

[Computer masaruyokoi.com] Apache の mod_rewrite を使ってみるみる

なんだかまた気がかわって、この日記の URL を http://diary.masaruyokoi.com/ から http://www.masaruyokoi.com/diary/ に戻した。で、以前使っていた diary.masaruyokoi.com の location が指定されたときに現在存在する URL に転送するためにmod_rewriteを活用することにした。diary.masaruyokoi.com の VirtualHost のところに、こんな rewrite rule を書いてやった。

<VirtualHost diary.masaruyokoi.com:80>
  ServerAdmin	webmaster@masaruyokoi.com
  ServerName	diary.masaruyokoi.com
  RewriteEngine	on
  RewriteCond	%{HTTP_HOST}	^diary\.masaruyokoi\.com$
  RewriteRule	^/(.*)$		 http://www.masaruyokoi.com/diary/$1 [L]
</VirtualHost>

これでオッケー。

あと mod_rewrite のマニュアルによると、httpd.conf の AllowOverride で FileInfo が設定されていれば .htaccess でも RewriteRule が書けるらしい。ということで試しにこんなものを書いてhttp://www.masaruyokoi.com/~masaru/rewrite-test/に置いてみた。

RewriteEngine	on
RewriteRule	^(.*)$	http://www.masaruyokoi.com/~masaru/fuga/$1	[L]

するとl rewrite-test 以下が fuga に置き代わります。


2000|10|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|