ラベル Emacs の投稿を表示しています。 すべての投稿を表示
ラベル Emacs の投稿を表示しています。 すべての投稿を表示

3.10.2010

ちくちくと環境整備。

openSUSE 11.2 にしたものの、やっぱりある程度は自分で整えないといけない。
以下、ざっと整えたもののメモ

Opera:YaSTから10.10が放り込めるのでこれを入れておく。
検索窓で日本語入力できないとか、日本語打ち込んでる最中にscimがOperaに対してだけ落ちるとか、相変わらずFlashとの相性が悪いとか色々問題はあるけど、一回使ったら離れられないよね。
導入後、Speed Dialやらログインの必要なサイトの設定やらをしておく。

MyPaint:最近お気に入りのコイツ。
オフィシャルでは存在しなかったが、こちらでアンオフィシャルなパッケージを見つけたので導入。
# ペンタブは、差し込むだけで普通に使えた。以前は、ペンタブの利用にちょっと苦労した気がしてたんだけどナァ。

Sylpheed:メーラをThunderbirdからSylpheedに乗り換えることに。理由は簡単。なんか3.x系の雷鳥が使いにくいから。
公式サイトを見たら、つい先日3.x系のSylpheedがリリースされてたってのもデカイ。
SUSEのレポジトリにSylpheedが見当たらなかったので、ソースから入れる。
glib2-develとかgtk2のdevelパッケージとか、多少追加してやる必要があったけど、普通に./configure make && sudo make installで行けた。
(起動時にlibsylpeed-plugin〜がみあたらないよ!ってなエラーが吐かれて起動できないときは、$LD_LIBRALY_PATHに/usr/local/libを追加してやればいいらしい。)

ビルドサービスでパッケージを見つけたので、それに乗り換える。
やっぱりRPMで管理できるといいよね。
スパムフィルタには、とりあえずYaSTにあったbogofilterを入れて指定してある。
今後不具合が出てきたら、日本語に完全対応していると噂のbsfilterも含めて検討しようと思う。

AmaroK:デフォルトではmp3やらwmaやらが再生できないので、いつもどおりpackmanを使う。
はじめに
http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/11.2/
をYaSTでインストールソースに追加。(GPG鍵で怒られるけど認証しておく。)
続いて、YaSTでlibxine1-codecsとかw32codec-allとかを放り込む。(警告はYaSTの提案を受け入れて再試行。)
いつもどおり、これだけでAmaroKからmp3が再生できるようになった。

V2C:2ch専用ブラウザ。
tarボールを持ってきて適当に展開した後、binディレクトリにシンボリックリンクをはっておく。
いくつかパーミッションエラーで怒られたけど、適当に権限を与えてやって解決。

Anthy:顔文字辞書を入れる。
こちらから顔文字辞書をとってきて展開後、./install-shでインストール。
# 変換効率を向上させるパッチも配布されているけど、とりあえず見送り。

Skype:SUSE向けrpmパッケージが公式から配布されているので、それをゲットしてきて放り込む。
rpm -iUvh Skype〜なんてコマンド、何年かぶりに打ち込んだワ(笑)

zsh:ログインシェルをzshにして、.zshrcを持ってきて微調整。
ページャに使っていたlvが無いと怒られたので、普通にlessを使うことに。まだ日本語テキストをコンソールで出していないから分からないけど、多分問題ないと思う。

Emacs:openSUSEのemacsは、設定を.emacsではなく、.gnu-emacs-customに書くようになってるので、バックアップしてあった.emacsをリネームして微調整。

newLISP:公式サイトからtarボールを持ってきて、./configure; make && sudo make installする。
readlineを要求するから、そのdevelパッケージを放り込んでおくのを忘れずに。

とりあえずざっくりやったのはこんなところか。
SteelBank Common Lispも入れようと思ったけど、YaSTからは見つからなかった。
(LISPで見つかったのはCLISPのみ。)
LISPまわりの品揃えが悪いってどういうことだ。

それでも、ソースから構築したのはnewLISPとSylpheedのみ。(SteelBankが加わりそうだけど。)
この辺は、大手ディストリビューションならでは充実度といったところかな。

6.12.2009

Debianでdiredが使えない…。

gnuplotとか使うし、いろいろと便利化なぁ。と思って、Xmingを導入。
coLinux上にX周りのごくごく基本的なもの(といっても入れたのはcommonまわりとxtermぐらい)を揃え、快適に使っております。

とはいえ、やはり作業の中心はEmacsになるわけで、あちらこちらとファイルを渡り歩く作業が合ったために、diredを使ってディレクトリを参照しようとしたところ…。
"Autoloading failed to define function ede-dired-minor-mode"
とか言い出すんですよ。

いろいろ調べたけれども、どうにも解決策が見つからない。
というか、いつから使えなかったんだろうか?(しばらくdiredを使っていなかった証拠か?)

あれこれ考えたんだけれども、edeは導入できているし、問題という問題も見つからない。
となると、やることは一つ。そう、再インストールだ。

というわけで、
$ sudo aptitude install emacs22-nox
とかやって、とりあえずemacs22パッケージを消してから、
$ sudo aptitude install emacs22
としてemacs22を再インストール。

んでもってチェックすると、無事にdiredが起動した。
原因不明だけど解決できましたというのはどうにも気持ちが悪いものだけれど、とりあえず使えてるので今のところはヨシとする。

4.25.2009

私の.zshrcと.emacs―― 一番大切なファイル。

coLinuxを起動しようとしたら、どういう訳かブルースクリーンに。
ものすごく久しぶりに遭遇した青一面の画面だっただけに少々驚いたが、そういえばcoLinuxはこういうリスクもはらんでいるんだったと再確認。

そんでもって、やっぱりバックアップしておいた方が良さそうだと思うファイルをブログに貼り付けて保存しておこうと決意したワケ。
以前のソフトサポート用ブログは既に削除してしまったので、あちらに取ってあったバックアップが無いのだということに気づいたってのも一つの理由だけれども。

まずは.zshrc。
環境変数は.zprofileで設定してあるけど、それほど複雑じゃないから省略。

autoload -U compinit
compinit
bindkey -e
setopt auto_cd
setopt auto_pushd
setopt correct
setopt list_packed
setopt nolist_beep
setopt hist_ignore_dups
setopt share_history
export LSCOLORS=ExFxCxdxBxegedabagacad
export LS_COLORS='di=01;34:ln=01;35:so=01;32:ex=01;31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:o
w=43;30'
zstyle ':completion:*' list-colors 'di=;34;1' 'ln=;35;1' 'so=;32;1' 'ex=31;1' 'bd=46;34' 'cd=43;34'

# Lines configured by zsh-newuser-install
HISTFILE='/home/hogehoge/.histfile'
HISTSIZE=10000
SAVEHIST=10000
PROMPT='[%D{%Y/%m/%d(%a)} %T <%(5~,%-2~/.../%2~,%~)>]
[%n@%m]%# '

# command aliases
alias ls='ls -B --color=auto'
alias ll='ls -ABl --color=auto'
alias la='ls -al --color=auto'
alias less='lv'
alias rm='rm -rf'


つづいて.emacs
(setq inhibit-startup-message t)
(setq scroll-step 1)

(set-locale-environment nil)
(coding-system-put 'utf-8 'category 'utf-8)
(set-language-info
"Japanese"
'coding-priority (cons 'utf-8
(get-language-info "Japanese" 'coding-priority)))
(set-language-environment "Japanese")
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(global-font-lock-mode t)
(setq backup-inhibited t)
(setq delete-auto-save-file t)

;;Anthy
(load-library "anthy")

;;uim
(setq default-input-method "japanese-anthy-uim")
(setq uim-default-im-prop '("action_anthy_hiragana"))
(setq uim-candidate-display-inline t)

;;slime
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(add-hook 'lisp-mode-hook (lambda ()
(slime-mode t)
(show-paren-mode)))

(require 'slime)
(setq inferior-lisp-program "clisp")
(slime-autodoc-mode)

;; scheme-mode
(autoload 'scheme-mode "scheme-mode" "scheme" t)
(setq auto-mode-alist (cons '("\.ss$" . scheme-mode) auto-mode-alist))

;; html-helper-mode
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\.html$" . html-helper-mode) auto-mode-alist))

;; css-mode
(autoload 'css-mode "css-mode" "Editing CSS" t)
(setq auto-mode-alist (cons '("\.css$" . css-mode) auto-mode-alist))

;;cedet
(require 'cedet)
(global-ede-mode t)
(semantic-load-enable-code-helpers)
;; region
(setq transient-mark-mode t)

;; show clock
(display-time)

;; show column number
(column-number-mode t)

;; scheme
(setq process-coding-system-alist
(cons '("gosh" utf-8 . utf-8) process-coding-system-alist))

;; gosh interpriter path. -i option is interactive mode
(setq gosh-program-name "/usr/bin/gosh -i")

;; scheme-mode and run-scheme-mode use to cmuscheme.el
(autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t)
(autoload 'run-scheme "cmuscheme" "Run an inferior Scheme process." t)

;; pair of brace
(show-paren-mode)

;; indent
(put 'and-let* 'scheme-indent-function 1)
(put 'begin0 'scheme-indent-function 0)
(put 'call-with-client-socket 'scheme-indent-function 1)
(put 'call-with-input-conversion 'scheme-indent-function 1)
(put 'call-with-input-file 'scheme-indent-function 1)
(put 'call-with-input-process 'scheme-indent-function 1)
(put 'call-with-input-string 'scheme-indent-function 1)
(put 'call-with-iterator 'scheme-indent-function 1)
(put 'call-with-output-conversion 'scheme-indent-function 1)
(put 'call-with-output-file 'scheme-indent-function 1)
(put 'call-with-output-string 'scheme-indent-function 0)
(put 'call-with-temporary-file 'scheme-indent-function 1)
(put 'call-with-values 'scheme-indent-function 1)
(put 'dolist 'scheme-indent-function 1)
(put 'dotimes 'scheme-indent-function 1)
(put 'if-match 'scheme-indent-function 2)
(put 'let*-values 'scheme-indent-function 1)
(put 'let-args 'scheme-indent-function 2)
(put 'let-keywords* 'scheme-indent-function 2)
(put 'let-match 'scheme-indent-function 2)
(put 'let-optionals* 'scheme-indent-function 2)
(put 'let-syntax 'scheme-indent-function 1)
(put 'let-values 'scheme-indent-function 1)
(put 'let/cc 'scheme-indent-function 1)
(put 'let1 'scheme-indent-function 2)
(put 'letrec-syntax 'scheme-indent-function 1)
(put 'make 'scheme-indent-function 1)
(put 'multiple-value-bind 'scheme-indent-function 2)
(put 'match 'scheme-indent-function 1)
(put 'parameterize 'scheme-indent-function 1)
(put 'parse-options 'scheme-indent-function 1)
(put 'receive 'scheme-indent-function 2)
(put 'rxmatch-case 'scheme-indent-function 1)
(put 'rxmatch-cond 'scheme-indent-function 0)
(put 'rxmatch-if 'scheme-indent-function 2)
(put 'rxmatch-let 'scheme-indent-function 2)
(put 'syntax-rules 'scheme-indent-function 1)
(put 'unless 'scheme-indent-function 1)
(put 'until 'scheme-indent-function 1)
(put 'when 'scheme-indent-function 1)
(put 'while 'scheme-indent-function 1)
(put 'with-builder 'scheme-indent-function 1)
(put 'with-error-handler 'scheme-indent-function 0)
(put 'with-error-to-port 'scheme-indent-function 1)
(put 'with-input-conversion 'scheme-indent-function 1)
(put 'with-input-from-port 'scheme-indent-function 1)
(put 'with-input-from-process 'scheme-indent-function 1)
(put 'with-input-from-string 'scheme-indent-function 1)
(put 'with-iterator 'scheme-indent-function 1)
(put 'with-module 'scheme-indent-function 1)
(put 'with-output-conversion 'scheme-indent-function 1)
(put 'with-output-to-port 'scheme-indent-function 1)
(put 'with-output-to-process 'scheme-indent-function 1)
(put 'with-output-to-string 'scheme-indent-function 1)
(put 'with-port-locking 'scheme-indent-function 1)
(put 'with-string-io 'scheme-indent-function 1)
(put 'with-time-counter 'scheme-indent-function 1)
(put 'with-signal-handlers 'scheme-indent-function 1)
(put 'with-locking-mutex 'scheme-indent-function 1)
(put 'guard 'scheme-indent-function 1)

;; memo
(setq user-full-name "hogehoge")
(setq user-mail-address "e-mail@example.jp")
(defun memo ()
(interactive)
(add-change-log-entry
nil
(expand-file-name "~/.memo/memo.txt")))
(define-key ctl-x-map "M" 'memo)

;; password hide
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt)

;; c-mode hook
(add-hook 'c-mode-hook
'(lambda ()
(c-set-style "BSD")))

(add-hook 'c++-mode-hook
'(lambda ()
(c-set-style "BSD")))
;; ls color mode off
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

;; w3m
(require 'w3m-load)

;; wget-el
(load "w3m-wget")


.emacsが長いのはご愛敬。

# ブルースクリーンになった原因が、昨日のお引っ越しじゃなきゃいいんだけど……。

8.13.2008

わたしの.emacs

暑さにバテながらいろいろ考えてみたところ、私にとって最も重要なファイルがこれであろうという結論に達した。

さて、そんな悟りはおいとき、実は以前からemacs22にして以来(というかLennyにして以来)、Shellモードで日本語がうまく表示されないという不具合に悩まされていた。

今回も、以前にサポートブログで紹介したようなやり方でemacs環境をUTF-8に整え、環境変数$LANGもja_JP.UTF-8にしてあるから、当然の如くshellモードでも日本語が表示されるんだと思っていた。

けれど、実際使ってみるとそうではなく、ここしばらく、特にSDLを使ったプログラムをコンパイルするときに、頻繁にShellモードを呼び出さなくちゃいけなくなってから、この問題をなんとか解決できないものかと悩んでいたのだ。

で、今日一応の解決を見たのでその結果とともに.emacsを張り付けておこうと思う。

まずは.emacsから。

;;.emacs
(setq inhibit-startup-message t)

(set-locale-environment nil)
(coding-system-put 'utf-8 'category 'utf-8)
(set-language-info
"Japanese"
'coding-priority (cons 'utf-8
(get-language-info "Japanese" 'coding-priority)))
(set-language-environment "Japanese")
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(global-font-lock-mode t)
(setq backup-inhibited t)
(setq delete-auto-save-file t)

;; scheme-mode
(autoload 'scheme-mode "scheme-mode" "scheme" t)
(setq auto-mode-alist (cons '("\.ss$" . scheme-mode) auto-mode-alist))

;; html-helper-mode
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\.html$" . html-helper-mode) auto-mode-alist))

;; css-mode
(autoload 'css-mode "css-mode" "Editing CSS" t)
(setq auto-mode-alist (cons '("\.css$" . css-mode) auto-mode-alist))

;; region
(setq transient-mark-mode t)

;; show clock
(display-time)

;; show column number
(column-number-mode t)

;; anthy
(push "/usr/local/share/emacs/site-lisp/anthy/" load-path)
(load-library "leim-list")
(load-library "anthy")

;; uim
(push "/usr/local/share/emacs/site-lisp/uim-el/" load-path)
(require 'uim-leim)
(setq default-input-method "japanese-anthy-uim")
(setq uim-default-im-prop '("action_anthy_hiragana"))
(setq uim-candidate-display-inline t)

(show-paren-mode t)
(setq show-paren-style 'mixed)

;; scheme
(setq process-coding-system-alist
(cons '("gosh" utf-8 . utf-8) process-coding-system-alist))

;; gosh interpriter path. -i option is interactive mode
(setq gosh-program-name "/usr/bin/gosh -i")

;; scheme-mode and run-scheme-mode use to cmuscheme.el
(autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t)
(autoload 'run-scheme "cmuscheme" "Run an inferior Scheme process." t)

;; pair of brace
(show-paren-mode)

;; indent
(put 'and-let* 'scheme-indent-function 1)
(put 'begin0 'scheme-indent-function 0)
(put 'call-with-client-socket 'scheme-indent-function 1)
(put 'call-with-input-conversion 'scheme-indent-function 1)
(put 'call-with-input-file 'scheme-indent-function 1)
(put 'call-with-input-process 'scheme-indent-function 1)
(put 'call-with-input-string 'scheme-indent-function 1)
(put 'call-with-iterator 'scheme-indent-function 1)
(put 'call-with-output-conversion 'scheme-indent-function 1)
(put 'call-with-output-file 'scheme-indent-function 1)
(put 'call-with-output-string 'scheme-indent-function 0)
(put 'call-with-temporary-file 'scheme-indent-function 1)
(put 'call-with-values 'scheme-indent-function 1)
(put 'dolist 'scheme-indent-function 1)
(put 'dotimes 'scheme-indent-function 1)
(put 'if-match 'scheme-indent-function 2)
(put 'let*-values 'scheme-indent-function 1)
(put 'let-args 'scheme-indent-function 2)
(put 'let-keywords* 'scheme-indent-function 2)
(put 'let-match 'scheme-indent-function 2)
(put 'let-optionals* 'scheme-indent-function 2)
(put 'let-syntax 'scheme-indent-function 1)
(put 'let-values 'scheme-indent-function 1)
(put 'let/cc 'scheme-indent-function 1)
(put 'let1 'scheme-indent-function 2)
(put 'letrec-syntax 'scheme-indent-function 1)
(put 'make 'scheme-indent-function 1)
(put 'multiple-value-bind 'scheme-indent-function 2)
(put 'match 'scheme-indent-function 1)
(put 'parameterize 'scheme-indent-function 1)
(put 'parse-options 'scheme-indent-function 1)
(put 'receive 'scheme-indent-function 2)
(put 'rxmatch-case 'scheme-indent-function 1)
(put 'rxmatch-cond 'scheme-indent-function 0)
(put 'rxmatch-if 'scheme-indent-function 2)
(put 'rxmatch-let 'scheme-indent-function 2)
(put 'syntax-rules 'scheme-indent-function 1)
(put 'unless 'scheme-indent-function 1)
(put 'until 'scheme-indent-function 1)
(put 'when 'scheme-indent-function 1)
(put 'while 'scheme-indent-function 1)
(put 'with-builder 'scheme-indent-function 1)
(put 'with-error-handler 'scheme-indent-function 0)
(put 'with-error-to-port 'scheme-indent-function 1)
(put 'with-input-conversion 'scheme-indent-function 1)
(put 'with-input-from-port 'scheme-indent-function 1)
(put 'with-input-from-process 'scheme-indent-function 1)
(put 'with-input-from-string 'scheme-indent-function 1)
(put 'with-iterator 'scheme-indent-function 1)
(put 'with-module 'scheme-indent-function 1)
(put 'with-output-conversion 'scheme-indent-function 1)
(put 'with-output-to-port 'scheme-indent-function 1)
(put 'with-output-to-process 'scheme-indent-function 1)
(put 'with-output-to-string 'scheme-indent-function 1)
(put 'with-port-locking 'scheme-indent-function 1)
(put 'with-string-io 'scheme-indent-function 1)
(put 'with-time-counter 'scheme-indent-function 1)
(put 'with-signal-handlers 'scheme-indent-function 1)
(put 'with-locking-mutex 'scheme-indent-function 1)
(put 'guard 'scheme-indent-function 1)

;; memo
(setq user-full-name "My Name")
(setq user-mail-address "email@post.com")
(defun memo ()
(interactive)
(add-change-log-entry
nil
(expand-file-name "~/.memo/memo.txt")))
(define-key ctl-x-map "M" 'memo)

;; password hide
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt)

;; c-mode hook
(add-hook 'c-mode-hook
'(lambda ()
(c-set-style "BSD")))

(add-hook 'c++-mode-hook
'(lambda ()
(c-set-style "BSD")))

;; ls color mode off
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

;; w3m
(require 'w3m-load)

;; wget-el
(load "w3m-wget")


ポイントは、太字で示したところと斜体で示したところ。
どうやら、太字部分斜体部分よりも前に定義されていないと、正常にエンコしてくれない様子。
(いろいろと順序を変えて試行錯誤しながらやった結果なので、外しているかもしれないけど。)

もし同様の症状でお困りなら、試してみるといいかもですよ。

3.05.2008

Changelog日記

こちらのブログは基本的に技術的なことに関するメモとか、そんな「私じゃない人にも必要かもしれない」情報を書くようにしているんだけれども、これとは別に、個人的な行動のログ(勝手に今日ログなどと読んでいる)を付けている。要するに日記だ。

んで、これを付ける時に便利なのがChangelogのフォーマット。
あの、日付と、何に関するアップデートかっていうのと、ちょっとしたメモが書ける、テキストベースのログ形式だ。

私はEmacsを愛用しているので、自分の.emacsに
;; memo
(setq user-full-name "my name")
(setq user-mail-address "my@e-mailaddress.com")
(defun memo ()
(interactive)
(add-change-log-entry
nil
(expand-file-name "~/.memo/memo.txt")))
(define-key ctl-x-map "M" 'memo)
なんてのを書いておいて、Ctrl-x Mキーでメモを呼び出せるようにしている。
このログは、昨年の11月中ごろから付けているんだけれども、このほどそのファイルサイズが38KBに達した。
ファイルサイズが徐々に増加していくのをみると、なんだか自分の人生を記録したファイルみたいでうれしいなって。そんな風に感じたわけでした。

# Chanlog形式の簡単な日記を付けられるソフトをWindowsで作ったら、受けるだろうか?
# またアイディアだけ出てきました病が (笑)