カテゴリ「Emacs」最新ページ / 前ページ 1 2 3 4 5 6 7 8 次ページ / page 4 (8)
2003-04-04 (金)
■ 文字列の置換 "hogehoge," => "hogehoge" [Emacs]
(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-09-11 (木)
■ Emacs Lisp での繰り返しの書き方 [Emacs]
繰り返しを書くときは、まず mapcar, find-if などの高階関数で書けるかどう
かを検討する。書けなければ dolist, dotimes などを使う。それでも書けなけ
れば、while, loop, 再帰を使う。
(URL: お気楽ごくらくプログラミング入門 -- Lisper への道 --)
(URL: (Scheme) (Lisp))
2003-10-02 (木)
■ Emacs 年表 [Emacs]
(URL: A History of Emacs)
(URL: Emacs Timeline)
(URL: Mule/Emacsの歴史) 右上の Mule/Emacs の歴史 -> (左上の)Historical drawing
2004-02-02 (月)
■ 16進数で色一覧を表示 [Emacs]
(defun list-hexadecimal-colors-display ()
"16進数で色一覧を表示"
(interactive)
(let ((r 0)
(g 0)
(b 0)
(delta 32)
(color-list ()))
(while (< r 256)
(setq g 0)
(while (< g 256)
(setq b 0)
(while (< b 256)
(setq color-list (append color-list (list (format "#%.2x%.2x%.2x" r g b))))
(setq b (+ b delta)))
(setq g (+ g delta)))
(setq r (+ r delta)))
(list-colors-display color-list)))
2004-02-03 (火)
■ tamago を CVS の先端から持ってくる。 [Emacs]
<http://emacs-21.ki.nu/application/tamago.html>
% cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/tamago login
% cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/tamago co tamago
emacs-20.7 では its/aynu.el の 137 行目あたりでコンパイルエラーになってしまう。
コンパイルエラーとは関係ないけど、以下のスクリプトで調べてみたら、
すでにインストールされている egg と違う部分が結構あった。
% cd ~/share/elisp
% for file in `find egg/. -name "*.el"`; do; \
> echo "[`basename $file`]"; \
> diff -c /usr/gnu/share/emacs/site-lisp/$file $file 2>&1 ; \
> done
2004-02-03 (火)
■ emacs を CVS の先端から持ってくる。 [Emacs][インストールメモ]
<http://homepage.mac.com/nand/macosx/emacs_cvs.html>
% export CVS_RSH=ssh
% cvs -z3 -d :ext:anoncvs@savannah.gnu.org:/cvsroot/emacs checkout -P emacs
# "rpm -e texinfo" して texinfo-4.6 を普通にインストール。
% mkdir emacs-work; cd emacs-work
% ../emacs/configure --without-xim
% make bootstrap # See INSTALL.CVS
2004-02-16 (月)
■ FLIM & SEMI Install [Emacs][インストールメモ]
% tar xvzf flim-1.14.6.tar.gz; cd flim-1.14.6
% make
% emacs -batch -q -no-site-file -l texinfmt -f batch-texinfo-format *.texi
# (cd /usr/local/share/emacs/site-lisp && rm flim)
# make install
# cp *.info /usr/local/info
# dir を編集する。"install-info <info> <dir>" も使えるかも知れない。
SEMI もやりかたは同じなので省略する。
2004-07-14 (水)
■ migemo の諸問題 [Emacs]
- Emacs-21.3 on Solaris9
buffer に ataS がある状態で、C-s ataS まで打つと Emacs が必ず落ちる。
(setq migemo-options '("-S" "migemo" "-t" "emacs")) したら落ちなかった。
- Emacs-21.3.50 on RedHat 7.2
[Regular expression too big] と表示される。
=> Emacs のバグだったようだ。CVS 先端では直っている。
<http://www.m17n.org/mule-ja-archive/2003-10/msg00000.html>
2004-12-22 (水)
■ 文字列の置換 [Emacs][sed]
"aaaa1234bbbb" => "aaaabbbb"
# sh % echo "aaaa1234bbbb" | sed -e 's/^\([a-z]*\)\([0-9]*\)\([a-z]*\)$/\1\3/' aaaabbbb
;; elisp(文字列の走査) (let ((str "aaaa1234bbbb")) (string-match "\\([a-z]+\\)\\([0-9]+\\)\\([a-z]+\\)" str) (concat (match-string-no-properties 1 str) (match-string-no-properties 3 str))) => "aaaabbbb"
;; elisp(バッファの走査) <= ちょっと大げさ
(with-temp-buffer
(let ((str "aaaa1234bbbb"))
(insert str)
(goto-char (point-min))
(if (re-search-forward "\\([a-z]+\\)\\([0-9]+\\)\\([a-z]+\\)" (point-max) t)
(concat
(match-string-no-properties 1)
(match-string-no-properties 3)))))
=> "aaaabbbb"
カテゴリ「Emacs」最新ページ / 前ページ 1 2 3 4 5 6 7 8 次ページ / page 4 (8)
最終更新時間: 2010-07-27 06:00


