emacs
2010年06月16日
Lucid Lynxのemacsのwarningがウザい件
Lucid Lynxでemacs起動すると
** (emacs:2209): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed
と出まくるのでコンソールがどんどん汚染されてしまう。というわけで対策。
$ cat > /tmp/gtkrc.patch <<EOF --- gtkrc.orig 2010-04-16 00:43:11.000000000 +0900 +++ gtkrc 2010-06-16 12:00:42.000000000 +0900 @@ -38,7 +38,7 @@ GtkRange::trough-border = 0 GtkRange::slider-width = 16 GtkRange::stepper-size = 20 - GtkRange::trough-under-steppers = 0 + GtkRange::trough-under-steppers = 1 GtkScale::slider-length = 28 GtkScale::trough-side-details = 1 EOF $ cd /usr/share/themes/Ambiance/gtk-2.0 $ sudo patch < /tmp/gtkrc.patch
あとはemacsを再起動するだけ。
2010年01月28日
mmm-modeでgccのMD(machine description)ファイルを編集する
事前準備
mmm-mode を http://sourceforge.net/projects/mmm-mode/ からダウンロードし、configure & make install しておく
.emacsに以下の設定
(setq auto-mode-alist (append (list
'(".md" . emacs-lisp-mode)
auto-mode-alist)))
;; mmm-mode
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
;; md mode
(mmm-add-classes
'((md
:submode asm-mode
:front "\"@"
:back "\""
:insert ((?t md nil @ "\"@"
@ "\n" _ "\n" @ "\"" @))
)))
(mmm-add-mode-ext-class nil "\\.md?\\'" 'md))
"@改行 〜 "はアセンブラ複数行だからいいが、
"{ 〜 }"でC++-modeもやりたいのだが…だれか追記する方法教えてくださいm(._.)m おねがい
2009年09月25日
EmacsMuse(2) : LaTeX publishの時まともなfigure環境を使いたい
タイトル通りなんだけどσ(^◇^;)
期末で報告書の作成でどーしても細かい設定しないとはみ出して困ったチャンになっちゃったので作ってみた。本当は生LaTeXで書くのが筋なんだろーけど、締めまでもう一週間もない。・゜゜・(≧◯≦)・゜゜・。
(defun muse-publish-figure-tag (beg end &optional attr)
(let* (
(position (cdr (assoc "position" attrs)))
(caption (cdr (assoc "caption" attrs)))
(label (cdr (assoc "label" attrs)))
(center (cdr (assoc "center" attrs)))
(centerp (and (stringp center) (string= center "t")))
)
(if (muse-style-derived-p 'latex)
(progn
(muse-publish-ensure-block beg end)
(goto-char beg)
(insert (concat "\\begin{figure}"
(if (stringp position)
(concat "[" position "]\n") "\n")))
(if centerp (insert "\\begin{center}\n"))
(goto-char end)
(if (stringp label)
(insert (concat "\\label{" label "}\n")))
(if (stringp caption)
(insert (concat "\\caption{" caption "}\n")))
(if centerp (insert "\\end{center}\n"))
(insert "\\end{figure}")
(muse-publish-mark-read-only beg (point))))))
(add-to-list 'muse-publish-markup-tags
'("figure" t t nil muse-publish-figure-tag))
EmacsMuse : LaTeX publishのとき”要旨”を使いたい
タイトル通りなんだけどカスタムタグ
<abstract>で囲みたかったので
以下のようにやってみた。
(setq muse-latex-markup-strings
(acons
'begin-abstract "\\begin{abstract}"
muse-latex-markup-strings))
(setq muse-latex-markup-strings
(acons
'end-abstract "\\end{abstract}"
muse-latex-markup-strings))
(defun muse-publish-abstract-tag (beg end)
(muse-publish-ensure-block beg end)
(goto-char beg)
(insert (muse-markup-text 'begin-abstract))
(goto-char end)
(insert (muse-markup-text 'end-abstract))
(muse-publish-mark-read-only beg (point)))
(add-to-list 'muse-publish-markup-tags
'("abstract" t nil nil muse-publish-abstract-tag))
appendixも同様にして作れる。
EmacsMuseを今日始めて使ったんで本来のやり方知らないんだけど(汗
2009年09月24日
wl-biffを設定した
GMailのメールをoffileimapでMaildirで取り込んでいるのでbiffの設定を以下のようにした。
;; WL-BIFF
(setq wl-biff-check-folder-list
'(
"./data/Maildir/XXX/root"
"./data/Maildir/YYY/root"
"./data/Maildir/ZZZ/INBOX"
))
(setq wl-modeline-biff-state-on
(propertize "[〒]" 'face display-time-mail-face))
(add-to-list 'global-mode-string
'(wl-modeline-biff-status wl-modeline-biff-state-on
wl-modeline-biff-state-off))
(defadvice wl-mode-line-buffer-identification (around dont-show-biff activate)
(let ((wl-biff-check-folder-list nil))
ad-do-it))anthy.elで個別キーにON/OFFを割り当てる
anthy.elでトグルじゃなく変換のON/OFFがしたかったので以下のようにしてみた。
(defun anthy-mode-force-on (&optional arg) "Force Start Anthy conversion system." (interactive "P") (anthy-check-agent) (anthy-mode-on)) (defun anthy-mode-force-off (&optional arg) "Force End Anthy conversion system." (interactive "P") (anthy-check-agent) (anthy-mode-off)) (global-set-key [henkan] 'anthy-mode-force-on) (global-set-key [muhenkan] 'anthy-mode-force-off)



