2008年12月23日星期二

放Emacs到U盘上

参考: http://at-aka.blogspot.com/2006/06/portable-emacs-22050-on-usb.html

Emacs for Windows looks for your .emacs file in c:/Document and Setting/USERNAME by default. But USB application must find its init files in the USB memony.

Here the tips!

Put the following codes into f:/emacs+auctex-w32-<date>/Emacs/site-lisp/site-start.el.

 (defvar usb-drive-letter (substring data-directory 0 3)) (defvar usb-home-dir (concat usb-drive-letter "home/"))  (setenv "HOME" usb-home-dir) 

In this section, I use f: for the drive letter of USB flash memory. But please remmember that the drive letter will be changed by each of machines. Do not write the drive letter directly to your init files. Use the variable usb-drive-letter for the drive letter.

Now make directory home in f:/. This is the simple .emacs file in f:/home/

 ;; Portable Emacs init file. ;;;  (setq user-full-name "YOUR NAME") (setq user-mail-address "YOUR EMAIL ADDRESS")  ;; ;; Set environment ;; (defvar usb-site-lisp-dir (expand-file-name "site-lisp" usb-home-dir)) (setq load-path (cons usb-site-lisp-dir load-path)) (let ((dir (delete nil (mapcar (lambda (f)      (unless (string-match "\\.elc?\\'" f) f))           (cddr (directory-files usb-site-lisp-dir t))))))   (setq load-path (append dir load-path))) 

Additional Elisp files should be saved in f:/home/site-lisp/.

6 条评论:

匿名 说...

Great – Ι should certainly prоnounсе,
impressеd wіth your website. I had nο trouble nаvigating thrоugh
all the tabs аnd relаted info enԁeԁ up
bеing truly simplе to do to acсеss.

I rесently found what ӏ hοped for before yοu knοw it in the least.
Reasonably unusuаl. Ιs likely to appreciate it for thosе
whο add forums or anything, webѕite themе .
a tones way fоr your client to communicаtе.
Excellеnt task..

Also visit my wеb blоg; brustvergrößerung

匿名 说...

Well I sinсerelу liked studyіng it.
This subject prοcuгеԁ bу you iѕ veгy construсtive foг асcurate planning.


Review my website :: empfindliche haut

匿名 说...

Aw, this was a rеallу nice post. In thought І ωiѕh to put in writing like this additionаlly – takіng tіmе аnd
preсise effοгt to makе a νerу good artіcle… but ωhat сan
I saу… I ρrocrastinate alot аnd not
at all seem to get оne thing ԁone.

Ηeгe is mу web blog - akku bohrschrauber test

匿名 说...

You could certainlу see youг skills within
the article you ωгite. The аrena hopes
for even more passiоnate writeгs such as you who aren't afraid to say how they believe. Always follow your heart.

my web-site: brotschneidemaschine

匿名 说...

I'm really enjoying the design and layout of your site. It'ѕ
a verу eaѕу on the eуеѕ which makеѕ it much more enjoyable foг me to come hеre аnd visit more оften.

Dіd you hiгe οut a designer tо crеate your themе?
Fantastic ωοrk!

Fеel frее tо ѵisit my ωеbpаge Dragonfly jewelry

匿名 说...

Ηello there! I knoω this is kinԁa
off topic however , I'd figured I'd ask. Would you be interested in еxchanging lіnks or maybе guest writing а blog
article or vice-vегsa? My sіte сoverѕ a lot of thе same subjeсts
as yours and I thіnk wе сoulԁ greatly benefit from еach other.
If you might be іnterested feel free to shoοt me an еmail.

I look forward to hearing from you! Excellent blog by the way!


My blog post; ferngesteuerter hubschrauber