文字列の置換 "hogehoge," => "hogehoge"

(let ((str "hogehoge,") (regexp ",$") (newstr "")) (cond ((eq emacs-major-version 21) (replace-regexp-in-string regexp newstr str)) ((eq emacs-major-version 20) (progn (string-match regexp str) (replace-match newstr nil nil str))) ((eq emacs-major-version 19) (progn (require 'dired) (dired-replace-in-string regexp newstr str)))))

2003-04-04 (金) · masutaka

M-x list-load-path-shadows

ファイル名がかぶっていて、loadされないファイルを表示する。

2003-03-31 (月) · masutaka

関数の実体を表示する。

(symbol-function 'MEW-TO) => (lambda nil (aref mew-vec 5))

2003-03-12 (水) · masutaka

play-sound()

GNU-Emacs 21.2.93 だと音を鳴らせるようだ。 (play-sound '(sound :file "~/Mail/email.wav"))

2003-03-02 (日) · masutaka

call-process()

call-process()でファイル名等を渡す時は expand-file-name()しなければならない。

2003-03-02 (日) · masutaka

edebug-def-mark

*scratch* バッファで edebug-defun() すると、edebug-def-mark がないと言われるときがある。

2003-02-28 (金) · masutaka

「このいいソフト。」 => 「このソフトはいい。」

(query-replace-regexp "\\(いい\\|わるい\\)\\(.+?\\)。" "\\2は\\1。")

2003-02-19 (水) · masutaka

shell-mode でパスワードが丸見えになってしまう

プロンプトが出たら M-x send-invisible してパスワードを打つ。

2003-02-16 (日) · masutaka

animate.el

M-x animate-birthday-present [Enter] マスタカ [Enter] ;; *scratch* バッファで、以下をコピペ。最後の ")" の後ろで Ctrl-j (animate-string "キタ━━━━━━(゜∀゜)━━━━━━ !!!!!" 13 0)

2003-02-08 (土) · masutaka

apropos-*

M-x apropos-variable C-uをつけないと、全部の変数を見てくれないんだ。知らなかった。 今まで、M-x describe-variable [RET] [TAB] して、C-sで検索していたよ..。 M-x apropos-value ところで、M-x apropos-value っていうのも見つけた。 どうやら、変数の値を探してくれるようだ。スゲー

2003-02-07 (金) · masutaka