Download - C-x C-f のなかのひと
![Page 1: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/1.jpg)
files.el : C-x C-fのなかのひと
はやみず
2008/6/28
1 / 17
![Page 2: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/2.jpg)
Emacsを開いてまずすることといえば
2 / 17
![Page 3: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/3.jpg)
C-x C-f
3 / 17
![Page 4: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/4.jpg)
C-x C-f を実行したとき、何がおこっているのか
4 / 17
![Page 5: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/5.jpg)
C-x C-f (find-file) はEmacs Lispで実装されている→ ソースが読める!
5 / 17
![Page 6: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/6.jpg)
C-x C-f
ファイルを開いてるだけでしょ?
そんな難しいことしてないんじゃないの?
6 / 17
![Page 7: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/7.jpg)
C-x C-f
ファイルを開いてるだけでしょ?そんな難しいことしてないんじゃないの?
7 / 17
![Page 8: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/8.jpg)
ファイル処理を司る elisp: files.el
約1600行 いろいろ面白いものが埋まっていそうだ
8 / 17
![Page 9: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/9.jpg)
ファイル処理を司る elisp: files.el
約1600行
いろいろ面白いものが埋まっていそうだ
9 / 17
![Page 10: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/10.jpg)
ファイル処理を司る elisp: files.el
約1600行 いろいろ面白いものが埋まっていそうだ
10 / 17
![Page 11: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/11.jpg)
読みはじめるときは
C-h C-k C-x C-fあるいは M-x help k C-x C-f ※ apt-get install emacs22-el などが必要
11 / 17
![Page 12: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/12.jpg)
find-file
(defun find-file (filename &optional wildcards)(interactive (find-file-read-args "Find file: " nil))(let ((value (find-file-noselect filename nil nil wildcards)))(if (listp value)
(mapcar ’switch-to-buffer (nreverse value))(switch-to-buffer value))))
find-file-noselect がキモ
12 / 17
![Page 13: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/13.jpg)
C-h C-f find-file-noselect してみる
Read file FILENAME into a buffer and returnthe buffer. If a buffer exists visiting FILENAME,return that one, but verify that the file has notchanged since visited or saved. The buffer is notselected, just returned to the caller. Optionalsecond arg NOWARN non-nil means suppress anywarning messages. Optional third arg RAWFILEnon-nil means the file is read literally. Optionalfourth arg WILDCARDS non-nil means do wildcardprocessing and visit all the matching files. Whenwildcards are actually used and expanded, return alist of buffers that are visiting the various files.
13 / 17
![Page 14: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/14.jpg)
self-documenting
14 / 17
![Page 15: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/15.jpg)
組み込みドキュメント
Emacs Lispは関数にドキュメントを書けるEmacs標準添付の elispは、ドキュメントが充実
ソース (実装)の前にドキュメント (意図)を読もう
15 / 17
![Page 16: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/16.jpg)
組み込みドキュメント
Emacs Lispは関数にドキュメントを書けるEmacs標準添付の elispは、ドキュメントが充実 ソース (実装)の前にドキュメント (意図)を読もう
16 / 17
![Page 17: C-x C-f のなかのひと](https://reader036.vdocuments.net/reader036/viewer/2022081805/556a3d4ed8b42a4a1e8b479a/html5/thumbnails/17.jpg)
find-file-noselect
17 / 17