anything-filelist ããã¹ã¦ã®ãã¡ã¤ã«ãç¬æã«éãæ¹æ³ã
ãEmacsæ¬ãæ¸ãã¾ããã
æ·±ããã£ã¬ã¯ããªé層ã«ãããã¡ã¤ã«ãéãã®ã¯é¢åãªãã®ã§ãã
æ¯è¼çæè¿ä½¿ã£ããã¡ã¤ã«ã»ãã使ããã¡ã¤ã«ã§ããã°recentfã使ãã°åé¡ããã¾ããã
ãããrecentfã«å
¥ã£ã¦ããªããã¡ã¤ã«ã®å ´åãé·ããã¹ãå
¥åãããªãlocateã使ããªãããªãã¨ããã¾ããã
é¢åã§ããã
recentfã¯ä¾¿å©ãªã®ã§ããåç
§
ããã§ãã·ã¹ãã ä¸ã®ãã¹ã¦ã®ãã¡ã¤ã«ããªã¹ããä½æãã¦ãããããéãæ¹æ³ã使ãã¾ãã
anything.elãã¤ã³ã¹ãã¼ã«ãã
ã¾ãã¯æºå段éã¨ãã¦ãanything.elãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãããã
ææ°æ©è½ãªã®ã§ãã§ã«å
¥ãã¦ãã人ã¯æ´æ°ãã¦ããã¾ãããã
å
·ä½çã«ã¯ M-x auto-install-batch anything ãå®è¡ããã ãã§ãã
http://d.hatena.ne.jp/rubikitch/20100718/anything
gitãªãã¸ããªã使ãæ¹æ³ãããã¾ãã
git clone git://repo.or.cz/anything-config.git
ãã¡ã¤ã«ãªã¹ããä½æãã
ã¾ãã¯ãã¡ã¤ã«ãªã¹ããä½æããå¿ è¦ãããã¾ãã
ã·ã³ãã«ãªæ¹æ³
ã¢ã«ã´ãªãºã ã¯ããããã·ã³ãã«ãªæ¹æ³ã§ãã
ãã¡ã¤ã«ãªã¹ãããè¤æ°åã®grepã§çµãè¾¼ãã§headã§å
é 200åãåãåºãã ãã§ãã
ãã®åç´ãªæ¹æ³ã§ãã£ã¦ããç¾å¨ã®ã³ã³ãã¥ã¼ã¿ã¯ä¸ç¬ã§ã¯ããã ãã¦ããã¾ãã
å¤ãPentium4ãã·ã³ã§ãã³ã³ãæ°ç§ã§ãã
anything-c-source-locateã®ç½®ãæã
ãã¨ãã¨ãã®ç®çã«ã¯ãlocateã³ãã³ãã使ãã®ãä¼çµ±çã§ãã
updatedbã³ãã³ãã§ãã¡ã¤ã«ãªã¹ããä½æããlocateã³ãã³ãã§ãã¡ã¤ã«åãåãåºãæ¹æ³ã§ãã
anything.elã§ã anything-c-source-locate æ
å ±æºã anything-locate ã³ãã³ãã使ãã¾ãã
ããããåä½ãé
ãä¸ãè¤æ°ã¯ã¨ãªã«ããçµãè¾¼ã¿ãã§ããªãã¨ããæ大ã®æ¬ ç¹ãããã¾ãã
ãã¡ã¤ã«ãªã¹ãä½æã³ãã³ã
ãã¡ã¤ã«ãªã¹ãä½æã³ãã³ã㯠find / ã®çµæãä¿åããæ¹æ³ãããã¾ãããããã ã¨ä¸è¦ãªãã¡ã¤ã«ãå«ã¾ãã¦ãã¾ãã¾ãã
ãã¡ã¤ã«ãªã¹ãã®æ¤ç´¢çµæã¯ä¸ä½200åã®ã¿ãåãåºãã®ã§ãæ¯è¼çããã¢ã¯ã»ã¹ãããã£ã¬ã¯ããªãåªå
çã«ä¸¦ã¹ã¦ããå¿
è¦ãããã¾ãã
å
¸åçã«ã¯ãã¼ã ãã£ã¬ã¯ããªãåªå
ãã¾ãã
ã¢ã¯ã»ã¹é »åº¦ãèãã¦ããªã find / ã«ããæ¹æ³ã ã¨ã欲ãããã¡ã¤ã«ãåã¾ã£ã¦ãã¾ãã¾ãã
ããã§ãè³¢ããã¡ã¤ã«ãªã¹ããä½æããRubyã¹ã¯ãªãããä½æãã¾ããã
以ä¸ãããã¦ã³ãã¼ããã¦ä¿åããããgitãªãã¸ããªä¸ã® extensions/make-filelist.rb ã使ã£ã¦ãã ããã
http://repo.or.cz/w/anything-config.git/blob_plain/master:/contrib/make-filelist.rb
以ä¸ã®ã³ãã³ãã§ãã·ã¹ãã ä¸ã®ã»ã¼ãã¹ã¦ã®ãã¡ã¤ã«åã /tmp/all.filelist ã«ä¿åãã¾ãã
ãã¼ã ãã£ã¬ã¯ããªâãã®ä»ã®ãã£ã¬ã¯ããªã®é çªã§ä¿åãã¾ãã
ã¾ãã.gitçãªã¹ãããå¿
è¦ã®ãªããã¡ã¤ã«ã¯é¤å¤ããã¾ãï¼ack-grepæºæ ï¼ã
ï¼ã»ã¼ï¼ãã¹ã¦ã®ãã¡ã¤ã«ããªã¹ããããããroot権éã§å®è¡ãã¾ãã
$ sudo ruby make-filelist.rb > /tmp/all.filelist
ãã¡ã¤ã«ãªã¹ãã®ã«ã¹ã¿ãã¤ãº
ãã¡ã¤ã«ãªã¹ãã¯ããç´°ããã«ã¹ã¿ãã¤ãºã§ãã¾ãã
make-filelist.rbã®Customize Variablesã®é¨åã ~/.make-filelist.rb ã«ã³ãã¼ãã好ã¿ã«ããããã«è¨å®ãã¦ãã ããã
~/.make-filelist.rb ãåå¨ãããªãã°ãèªã¿è¾¼ã¾ããããã©ã«ãã®è¨å®ãä¸æ¸ããã¾ãã
åã¯ä»¥ä¸ã®å
容ã«ãã¦ãã¾ãã
$EXCLUDE_PATH = %w[
. .. backup backup1 backup2 backup-system lost+found tmp temp rubikitch.lost
.cache w3mtmp proxy-cache trash proc RCS.old
autom4te.cache blib _build .bzr .cdv cover_db CVS _darcs ~.dep ~.dot .git .hg ~.nib .pc ~.plst RCS SCCS _sgbak .svn
]# Exclude regexps (backup files, core files, and so on)
$EXCLUDE_REGEXP = Regexp.union(/~$/, /\#.+\#$/, /[._].*\.swp$/, /core\.\d+$/, # from ack-grep
/\.(?:elc|o)$/, /,v$/)# Set default directories to collect
$LS_DIRS = [
"~/emacs/init.d", "~/emacs/lisp", "~/.emacs.d", "~/emacs",
"~/gdgd", "~/memo", "~/book", "~/src", "~/public_html", "~/private_html", "~",
"/m/usr/share/emacs/23.1.50", "/m/usr/share/emacs/site-lisp", "/m/log/emacswikipages",
"/m/home/local/lib/ruby19", "/m/home/local/lib/ruby", "/m/log/compile/ruby19", "/m/log/compile/ruby18",
"/m/log/compile", "/m/log", "/m/home/local", "/m/home/nobackup",
"/m/usr", "/etc", "/m/home/archives", "/m/l/var",
"/"
]
ã¾ããmake-filelist.rbã®å¼æ°ã«1ã¤ä»¥ä¸ã®ãã£ã¬ã¯ããªãæå®ãããã¨ã§ããã®ãã£ã¬ã¯ããªã®ã¿ã®ãã¡ã¤ã«ãªã¹ããä½æã§ãã¾ãã
$ ruby make-filelist.rb ~ /etc > ~/partial.filelist
è¨å®
cronã§ãã¡ã¤ã«ãªã¹ããèªåæ´æ°ãã
ãã¡ã¤ã«ãªã¹ããå¤ãã¾ã¾ã ã¨ãæ°è¦ãã¡ã¤ã«ãåæ ãããªãã®ã§ãrootã®cronã§èªåæ´æ°ãã¦ããã¾ãããã
crontabã«ä»¥ä¸ã®è¡ãå ããã¨ã1:00ã«å®è¡ãã¾ãã
0 1 * * * ruby /path/to/make-filelist.rb > /tmp/all.filelist
.emacsã«å ããè¨å®
.emacsã§ã¯ããã¡ã¤ã«ãªã¹ãã®ãã¡ã¤ã«åãæå®ãã¦ããã°ããã§ãã
é«éã«åä½ãããããã«ã¯ããã¡ã¤ã«ãªã¹ãã¯RAMãã£ã¹ã¯ãtmpfsã«ç½®ãã¦ããã¾ãããã
ãã㦠anything-grep-candidates-fast-directory-regexp ã«ãã®ãã£ã¬ã¯ããªã®æ£è¦è¡¨ç¾ãæå®ãã¦ããã¾ãããã
(require 'anything-startup)
(setq anything-c-filelist-file-name "/tmp/all.filelist")
(setq anything-grep-candidates-fast-directory-regexp "^/tmp")
^#+ENDSRC
使ãæ¹
ããã§ã¯ãã£ãã使ã£ã¦ã¿ã¾ãããã
ã³ãã³ãã¨ã㦠M-x anything-filelistã M-x anything-filelist+ ãç¨æãã¦ãã¾ãã
æ
å ±æºã®å¤æ°ã¯anything-c-source-filelistã§ãã
M-x anything-filelist
M-x anything-filelistãå®è¡ãã4æå以ä¸å
¥åããã°ããããããã¡ã¤ã«åãåãåºãã¦ããã¾ãã
ãã¡ãããã¹ãã¼ã¹åºåãã«ããçµãè¾¼ã¿ãã§ãã¾ãã
M-x anything-filelist+
anythingçã«ã¯ããã¡ã¤ã«ãªã¹ãã ãã§ã¯ãªãã¦ããããã¡ãæè¿ä½¿ã£ããã¡ã¤ã«ãããéãããã«ãã¦ããã¾ãããã
M-x anything-filelist+ ã¯ä»¥ä¸ã®æ
å ±æºã使ã£ã¦ãã¾ãã
ã«ã¼ã½ã«ä½ç½®ã®ãã¡ã¤ã«
ãããã¡
æè¿ä½¿ã£ããã¡ã¤ã«
ããã¯ãã¼ã¯
ãã¡ã¤ã«ãã£ãã·ã¥
ãã¡ã¤ã«ãªã¹ã
M-x anything-for-files ã®é«éçã§ãã
æ°è¦ãã¡ã¤ã«ãéã
å®ã¯ãããã使ã£ã¦æ°è¦ãã¡ã¤ã«ãéããã¨ãã§ãã¾ãã
ãã¾ãç¥ããã¦ãã¾ããããé¸æããåè£ããã¡ã¤ã«åã®ã¨ãã«C-x C-fãæ¼ãã¨ããã®ãã£ã¬ã¯ããªãããã¡ã¤ã«ãéãããã«ãªãã¾ãã
ãã¨ãã°ã comm ã¨ãã¿ã¼ã³ãå
¥åãã¦ã ~/emacs/lisp/sequential-command.el ã«ã«ã¼ã½ã«ãããã¨ãã«C-x C-fãæ¼ãã¨ã~/emacs/lisp/ãããã¡ã¤ã«ãéãæºåããã¾ãã
ããã«ãããç¹å®ãã¡ã¤ã«ã®åå¨ãããã£ã¬ã¯ããªã«æ°è¦ãã¡ã¤ã«ãä½æãããã¨ãç°¡åã«ã§ãã¾ãã
ããã¯ãã¡ã¤ã«ãªã¹ãã®æ©è½ã§ã¯ãªãã¦ãanything.elæ¬ä½ã®æ©è½ã§ãã