Emacs Change Colors
Emacs »ö»ó ¹Ù²Ù±â
Emacs¿¡¼ ¹è°æ »ö»ó, Àü°æ »ö»ó(ÀÏ¹Ý ±Û²Ã »ö»ó), Ä¿¼ »ö»ó, ¸¶¿ì½º Æ÷ÀÎÆ® »ö»óÀ» ¹Ù²Ù´Â ¹ýÀ» ¼³¸íÇÕ´Ï´Ù.
ÇöÀç Emacs (version 22.0 ±âÁØ)´Â Å͹̳Πȯ°æ ÀÌ¿Ü¿¡ ¿©·¯ °¡Áö window toolkitÀ» ½á¼ ÄÄÆÄÀÏÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î, 'athena', 'motif', 'gtk' Áß Çϳª¸¦ ¼±ÅÃÇÒ ¼ö Àִµ¥, ÀüÅëÀûÀ¸´Â athena widgetÀ» °¡Àå ¸¹ÀÌ ½á ¿ÔÁö¸¸, ¾ÕÀ¸·Î´Â 'gtk'°¡ °¡Àå ÀαâÀÖ´Â? window toolkitÀÌ µÉ °ÍÀÔ´Ï´Ù.
¾î¶² toolkitÀ» ¾²´À³Ä¿¡ »ó°ü¾øÀÌ, EmacsÀÇ »ö»óÀ» ¹Ù²Ü ¼ö Àִµ¥, Å©°Ô µÎ °¡Áö ¹æ¹ýÀÌ Á¸ÀçÇÕ´Ï´Ù. ù°, ÀüÅëÀûÀÎ X server resource¸¦ ¾²´Â ¹æ¹ýÀÌ ÀÖ°í, µÑ°, emacs ÀÚü¿¡¼ Á¦°øÇÏ´Â lisp ÇÔ¼ö¸¦ ½á¼ ¹Ù²Ü ¼ö ÀÖ½À´Ï´Ù. ¼¼Â°, ½±°Ô ¼³Á¤ÇÒ ¼ö ÀÖ°Ô customize buffer¸¦ ¾µ ¼ö ÀÖ½À´Ï´Ù. °¢°¢ Àå´ÜÁ¡ÀÌ Àִµ¥, ù¹ø° ¹æ¹ýÀ» ½á¼ »ö»óÀ» ÁöÁ¤Çϸé, emacs¸¦ ´Ù½Ã ½ÃÀÛÇؾ߸¸ ¹Ù²ï ³»¿ëÀ» Àû¿ëÇÒ ¼ö ÀÖ´Ù´Â ´ÜÁ¡ÀÌ ÀÖÁö¸¸, ¼³Á¤ ¹æ½ÄÀº ´õ ½±½À´Ï´Ù. µÎ¹ø° ¹æ¹ýÀ» ¾²¸é, µ¿ÀûÀ¸·Î ¾ðÁ¦µçÁö emacsÀÇ »ö»óÀ» ¹Ù²Ü ¼ö ÀÖ´Ù´Â ÀåÁ¡ÀÌ ÀÖÁö¸¸, lisp ¾ð¾î¿¡ ´ëÇØ ¾ÆÁÖ ¾à°£À̳ª¸¶ ¾Ë¾Æ¾ß ÇÑ´Ù´Â ´ÜÁ¡ÀÌ ÀÖ½À´Ï´Ù. ¼¼¹ø° ¹æ¹ýÀº °¡Àå ½±±â ¶§¹®¿¡, Ãʺ¸ÀÚµéÀÌ ¼±È£ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
¶ÇÇÑ ÀÌ ±Û¿¡ ÀÖ´Â ¹æ¹ý ¸»°í, Àü¹ÝÀûÀ¸·Î look & feelÀ» ¹Ù²Ù´Â Theme ±â´ÉÀ» ¾²´Â °ÍÀÌ ÈξÀ ´õ °£ÆíÇÏ°í Æí¸®ÇÕ´Ï´Ù. ÀÚ¼¼ÇÑ °ÍÀº EmacsColorThemeÀ» º¸±â ¹Ù¶ø´Ï´Ù.
1. X server resource¸¦ ½á¼ ¹Ù²Ù´Â ¹æ¹ý ¶ÀÌ ±ÛÀº X server resource¸¦ ¹Ù²Ù´Â ÀϹÝÀûÀÎ ¹æ¹ý¿¡ ´ëÇØ ´Ù·ç´Â ±ÛÀÌ ¾Æ´Ï±â ¶§¹®¿¡, ÀÚ¼¼ÇÑ »çÇ×Àº »ý·«ÇÕ´Ï´Ù. X server resource¿¡ ´ëÇØ Á» ´õ ÀÚ¼¼ÇÑ ±ÛÀ» ¿øÇÏ½Ã¸é µû·Î ¿¬¶ôÇϽñ⠹ٶø´Ï´Ù.
ù°, Å©°Ô ½Ã½ºÅÛ Àüü¿¡ ¿µÇâÀ» ¹ÌÄ¡µµ·Ï ¼³Á¤À» ÇÒ ¼ö°¡ ÀÖ°í, µÑ°, ÇöÀç »ç¿ëÀÚ¿¡°Ô¸¸ ¿µÇâÀ» ÁÖ°Ô ¼³Á¤ÇÒ ¼ö Àִµ¥, ¿©±â¿¡¼´Â ÇöÀç »ç¿ëÀÚ¿¡°Ô¸¸ ¼³Á¤ÇÒ ¼ö ÀÖ´Â ¹æ¹ý¿¡ ´ëÇØ ¾Ë¾Æº¸°Ú½À´Ï´Ù.
ÀÏ´Ü Emacs¸¦ óÀ½ ¼³Ä¡ÇÏ°í ½ÇÇàÇÏ¸é ´ÙÀ½°ú °°Àº ȸéÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù:
[PNG image (32.43 KB)] ¸ÕÀú, »ç¿ëÀÚÀÇ È¨ µð·ºÅ丮¿¡ ÀÖ´Â .Xdefaults ÆÄÀÏÀ» ÆíÁýÇÕ´Ï´Ù. (¾ø´Ù¸é »õ·Î ¸¸µé¸é µË´Ï´Ù.)
±×¸®°í ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù:
Emacs.Background: black
Emacs.Foreground: powder blue
Emacs.pointerColor: white
Emacs.cursorColor: white
±×¸®°í ³ª¼ ´Ù½Ã ½ÇÇàÇϸé, ´ÙÀ½°ú °°ÀÌ »ö»óÀÌ ¹Ù²ï °ÍÀ» º¼ ¼ö ÀÖ½À´Ï´Ù:
[PNG image (32.74 KB)] ¿©±â±îÁö µû¶ó¿Ô´Ù¸é, ¿©·¯ºÐÀÌ ¿øÇÏ´Â »ö»óÀ¸·Î, ¸¶À½´ë·Î ¹Ù²Ù±â¸¦ ¿øÇÒ °ÍÀÔ´Ï´Ù. ±×·¯ÀÚ¸é, ¿øÇÏ´Â »ö»óÀÇ À̸§À» ¾Ë¾Æ³»¼ ±× À̸§À¸·Î ÀûÀýÇÏ°Ô ¾Æ±î ÀÔ·ÂÇß´ø ³»¿ëÀ» ¹Ù²Ù¸é µË´Ï´Ù. ¿øÇÏ´Â »ö»óÀÇ À̸§À» ¾Ë±â À§Çؼ, °¡Àå ÀϹÝÀûÀÎ ¹æ¹ýÀº /usr/X11R6/lib/X11/rgb.txt¸¦ º¸´Â °ÍÀÔ´Ï´Ù. ÇöÀç, (Wed Dec 2 17:57:12 KST 2009) Á¦ Gentoo ½Ã½ºÅÛ¿¡¼´Â ÆÄÀÏ À§Ä¡°¡ /usr/share/X11/rgb.txt À̳׿ä.)
´ëÃæ, ´ÙÀ½°ú °°Àº Çü½ÄÀ¸·Î µÇ¾î ÀÖ½À´Ï´Ù.
$ head /usr/X11R6/lib/X11/rgb.txt
! $Xorg: rgb.txt,v 1.3 2000/08/17 19:54:00 cpqbld Exp $
255 250 250 snow
248 248 255 ghost white
248 248 255 GhostWhite
245 245 245 white smoke
245 245 245 WhiteSmoke
220 220 220 gainsboro
255 250 240 floral white
255 250 240 FloralWhite
253 245 230 old lace
$ _
Æ÷¸ËÀº °£´ÜÇÕ´Ï´Ù. "»¡°(r) ³ì»ö(g) ÆĶû(b) »ö»óÀ̸§" ÇüÅÂÀÔ´Ï´Ù. ±×·¯³ª »ö»ó¿¡ Àü¹®°¡°¡ ¾Æ´Ñ ÀÌ»ó, RGB °ª¸¸ º¸°í, ÀÌ°Ô ¾î¶² »ö»óÀÎÁö ¾Ë±â ½±Áö ¾Ê½À´Ï´Ù. ½±°Ô º¸±â À§Çؼ,
emacs¸¦ ¶ç¿î ÈÄ M-x list-colors-display¸¦ ½ÇÇàÇÏ¸é ´ÙÀ½°ú °°Àº ȸéÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù:
[PNG image (35.8 KB)] ÀÌÁ¦, ¿øÇÏ´Â ´ë·Î »ö»óÀ» ¹Ù²Ü ¼ö ÀÖ°ÚÁÒ? »ö»ó¸íÀÌ Àß ¾Èº¸ÀÌ½Ç °æ¿ì http://my.netian.com/~cajunlee/rgb.htm ¿©±â¸¦ º¸¼Åµµ µË´Ï´Ù.
¸¸¾à, ¿Ã¹Ù¸£°Ô »ö»óÀÌ ¹Ù²îÁö ¾Ê´Â´Ù¸é ¾Æ·¡ ´Ü¶ôÀ» ÀÐ¾î º¸½Ã±â ¹Ù¶ø´Ï´Ù.
¾ó¸¶ Àü±îÁö¸¸ Çصµ X server resource¸¦ ¼³Á¤ÇÏ´Â »ç¿ëÀÚ ÆÄÀÏÀÌ $HOME/.Xdefaults¿´´Âµ¥, ÃÖ½ÅÀÇ xorgÀÇ °æ¿ì $HOME/.Xdefaults-$HOSTNAMEÀ» ¾¹´Ï´Ù. µû¶ó¼ ÀÌ °æ¿ì, .Xdefaults-$HOSTNAMEÀÌ .Xdefaults¸¦ °¡¸®Å°µµ·Ï ½Éº¼¸¯ ¸µÅ©¸¦ °É¾îÁְųª:
$ cd
$ ln -s .Xdefaults .Xdefaults-$HOSTNAME
$ _
¶Ç´Â »ç¿ëÀÚ ÆÄÀÏ À̸§À» ¼³Á¤ÇÏ´Â XENVIRONMENT º¯¼ö¸¦ ¼³Á¤ÇÏ´Â script¸¦ $HOME/.bash_profileÀ̳ª $HOME/.profile¿¡ ³Ö¾îÁÖ¸é µË´Ï´Ù. (bash ±âÁØ)
if [ -f $HOME/.Xdefaults ]; then
export XENVIRONMENT=$HOME/.Xdefaults
fi
2. Emacs LispÀ» ½á¼ ¹Ù²Ù´Â ¹æ¹ý ¶LispÀ» ¸ð¸¥´Ù°í ³Ê¹« °Ì¸ÔÁö ¾ÊÀ¸¼Åµµ µË´Ï´Ù. Àúµµ Àß ¸ð¸£´Ï±ñ ½±°Ô ¼³¸íÇÏ°Ú½À´Ï´Ù. ÀÏ´Ü ´ÙÀ½°ú °°Àº ³× ÇÔ¼ö¸¦ ¾²½Ã¸é µË´Ï´Ù:
(set-background-color COLOR-NAME)
(set-foreground-color COLOR-NAME)
(set-cursor-color COLOR-NAME)
(set-mouse-color COLOR-NAME)
¿¹¸¦ µé¾î, ¾Õ ´Ü¶ô¿¡¼ ¼³Á¤ÇÑ °Í°ú ¶È°°ÀÌ ¼³Á¤ÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µË´Ï´Ù:
(set-background-color "black")
(set-foreground-color "white")
(set-cursor-color "yellow")
(set-mouse-color "yellow")
¹°·Ð ÀÌ ³»¿ëÀº $HOME/.emacs ÆÄÀÏ¿¡ ÀúÀåÇØ µÎ¾î¾ß ÇÕ´Ï´Ù.
½±ÁÒ? ¹°·Ð ´õ ¾î·Á¿î ¹æ¹ýµµ ÀÖ½À´Ï´Ù. (ÈùÆ®. Frame parameter¸¦ Á÷Á¢ ¹Ù²Ù´Â °ÍÀε¥, ÀÚ¼¼ÇÑ °ÍÀº elisp manualÀ» Âü°íÇϱ⠹ٶø´Ï´Ù.)
3. Customize Buffer¸¦ ½á¼ ¹Ù²Ù´Â ¹ý ¶emacs´Â »ç¿ëÀÚ°¡ ½±°Ô ¿©·¯°¡Áö ¼³Á¤À» ¹Ù²Ü ¼ö ÀÖµµ·Ï customize buffer¸¦ Á¦°øÇÕ´Ï´Ù. customize buffer¸¦ °£´ÜÈ÷ ¼Ò°³Çϸé, ÀÏ¹Ý GUI ÇÁ·Î±×·¥µéÀÇ Options ´ÙÀ̾ó·Î±× ¹Ú½º³ª, Preference ´ÙÀ̾ó·Î±×¸¦ »ý°¢ÇÏ¸é µË´Ï´Ù. ¸ÕÀú customize buffer¸¦ ÇÑ ¹ø º¸´Â°Ô ÀÌÇØ°¡ ºü¸¦ °Í °°½À´Ï´Ù:
[PNG image (31.55 KB)] À§ Customize buffer¸¦ ¶ç¿ì±â À§Çؼ´Â µÎ°¡Áö ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù. ù°, ¸Þ´º¿¡¼ ''''''Options->''''''Customize Emacs->''''''Toplevel Customization GroupÀ» ¼±ÅÃÇϰųª M-x customize¸¦ ½ÇÇàÇÏ¸é µË´Ï´Ù.
°¢ ¼ºê ±×·ì¸¦ ¼±ÅÃÇϱâ À§Çؼ´Â ÇØ´ç ¹öÆ°À» ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°À¸·Î ´©¸£°Å³ª, Ä¿¼¸¦ ¹öÆ° À§¿¡ À§Ä¡½ÃÅ°°í, <RET>À» ´©¸£¸é µË´Ï´Ù. ÀÏ´Ü ¼ºê ±×·ìÀ¸·Î µé¾î°£ »óÅ¿¡¼ »óÀ§ ±×·ìÀ¸·Î µ¹¾Æ°¡±â À§Çؼ´Â 'u' (upÀ» ¶æÇÔ)¸¦ ´©¸£¸é µË´Ï´Ù.
¿©±â¿¡¼ "Faces" ±×·ìÀ» ¼±ÅÃÇÏ°í (Áï, "Faces group" ¿·¿¡ ÀÖ´Â "Go to Group"À̶õ ¹öÆ°À» ¿ÞÂÊ ¹öÆ°À¸·Î ´©¸£°í), ´Ù½Ã "Basic Faces" ±×·ìÀ» ¼±ÅÃÇÕ´Ï´Ù. ±×¸®°í ³ª¼ "Default" faceÀÇ ¿·¿¡ ÀÖ´Â Show Face ¹öÆ°À» ´©¸¨´Ï´Ù. ¿©±â±îÁö ¿ÔÀ¸¸é ´ëÃæ ´ÙÀ½°ú °°Àº ȸéÀ» º¼ ¼ö ÀÖ½À´Ï´Ù:
[PNG image (31.61 KB)] Âü°í·Î, Emacs¿¡¼ face¶õ ±Û²Ã(font), ¹è°æ»ö(background), Àü°æ»ö(foreground), ¹ØÁÙ µî ¼Ó¼ºÀÇ ÁýÇÕÀ» ÀǹÌÇÕ´Ï´Ù. ÇѸ¶µð·Î ±Û²Ã¿¡ Àû¿ëµÉ ¼ö ÀÖ´Â ¸ðµç ¼Ó¼ºÀ» ¶æÇÕ´Ï´Ù.
Emacs¿¡´Â ¿©·¯°¡Áö face°¡ ¹Ì¸® Á¤ÀǵǾî Àִµ¥, ¿©±â¼ default face´Â ¸ðµç faceµéÀÇ ºÎ¸ð °ÝÀÔ´Ï´Ù. µû¶ó¼ ¸ðµç faceÀÇ ±Û²ÃÀ» Çѹø¿¡ ¹Ù²Ù·Á Çϰųª, ¸ðµç ±Û²ÃÀÇ ¹è°æ »ö»óÀ» ¹Ù²Ù°í ½Í´Ù¸é, default faceÀÇ ¼Ó¼ºÀ» ¹Ù²Ù¸é µË´Ï´Ù.
ÀÏ´Ü ¿©±â¿¡¼ ¿ì¸®°¡ °ü½ÉÀ» °¡Á®¾ß ÇÒ ºÎºÐÀº, ¹è°æ »ö»ó°ú Àü°æ »ö»óÀ̹ǷÎ, "foreground"¿Í "background" ºÎºÐÀ» ¹Ù²ãÁÝ´Ï´Ù. ¾Õ ¹æ¹ý°ú ¸¶Âù°¡Áö·Î foreground´Â "powder blue"·Î, background´Â "black"À¸·Î ¹Ù²ß´Ï´Ù. (<RET>À» Ä¡Áö ¾Êµµ·Ï Á¶½ÉÇϱ⠹ٶø´Ï´Ù.)
±× ´ÙÀ½ Default faceÀÇ ¹Ù·Î ¹Ø¿¡ ÀÖ´Â "State" ¹öÆ°À» ´©¸£¸é ¼ºê ¸Þ´º°¡ ¶å´Ï´Ù. ¿©±â¿¡¼ "Save for Future Sessions"À» ¼±ÅÃÇϸé, ÀÚµ¿À¸·Î $HOME/.emacs¿¡ ±â·ÏÀ» ÇÏ°í, ±× ³»¿ëÀÌ ¹Ý¿µµË´Ï´Ù:
[PNG image (35.26 KB)] ¾Æ·¡´Â ³»¿ë º¯°æÀÌ ¹Ý¿µµÈ ȸéÀÔ´Ï´Ù:
[PNG image (33.6 KB)] Âü°í·Î °ü½ÉÀÌ ÀÖ´Ù¸é $HOME/.emacs ÆÄÀÏÀ» ¿¾î¼ customize buffer°¡ ¾î¶² ½ÄÀ¸·Î ¼³Á¤À» ÀúÀåÇÏ´ÂÁöµµ º¸±â ¹Ù¶ø´Ï´Ù. ²À ¸ðµç lisp Äڵ带 ÀÌÇØÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "black" :foreground "powder blue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :family "adobe-courier")))))
4. ¿ì¼± ¼øÀ§ ¶X server resource¸¦ ¼³Á¤ÇÏ´Â ¹æ¹ýÀº, emacs°¡ ½ÇÇàµÇ±â Àü¿¡ ¸ÕÀú »ö»óÀ» ¼³Á¤ÇÕ´Ï´Ù. ±×¸®°í lispÀ¸·Î ¼³Á¤ÇÏ´Â ¹æ¹ýÀº, emacs°¡ ½ÃÀÛÇÑ ´ÙÀ½, ¼³Á¤ ÆÄÀÏÀ» ÀÐ¾î¼ ¼³Á¤ÇÕ´Ï´Ù. µû¶ó¼ µÎ °¡Áö ¹æ½Ä ¸ðµÎ ½è´Ù¸é ÈÄÀÚÀÎ, lispÀ¸·Î ¼³Á¤ÇÏ´Â ¹æ½ÄÀÌ ¸¶Áö¸·À¸·Î Àû¿ëµÇ°Ô µË´Ï´Ù.
³¡. -- ½Å¼º±¹
|
Show your affection, which will probably meet with pleasant response. |