{{{#!html
À̸ƽº(Emacs) ÀÚµ¿¿Ï¼º ÃÊ°£´Ü »ç¿ë¹ý
}}}
[[TableOfContents]]
¿ë¾îÀÇ ÀÏ°ü¼ºÀ» À§ÇØ[[br]]
"ÀÎÅÚ¸®¼¾½º(intellisense)"´Â ¸®½ºÆ®¸¦ º¸¿©ÁÖ´Â ÀÚµ¿¿Ï¼ºÀ» ÀǹÌÇÏ°í[[br]]
"½Éº¼¿Ï¼º(symbol completion)"Àº ¸®½ºÆ®¸¦ ¾È º¸¿©ÁÖ´Â ÀÚµ¿¿Ï¼ºÀ» ÀǹÌÇÏ´Â °ÍÀ¸·Î ÇÏ°Ú½À´Ï´Ù.
±×¸®°í Emacs¿¡´Â ÀÚµ¿¿Ï¼ºÀ̶ó°í ÀÏÄþîÁö´Â auto completion, smart completion, intellisense µîµî[[br]]
Á¾·ù°¡ ³Ê¹« ¸¹±â ¶§¹®¿¡ cedet ÆÐÅ°Áö¿¡ ÀÖ´Â semanticÀ» Áß½ÉÀ¸·Î ¼³¸íÇÕ´Ï´Ù.
Emacs¿¡¼ ÀÚµ¿¿Ï¼ºÀº ¼³Á¤µµ ¾à°£ ±î´Ù·Ó°í ¸Ç óÀ½ ÀÚµ¿¿Ï¼ºÀÌ µÉ ¶§´Â ij½¬ ÆÄÀÏÀ» »ý¼ºÇØ¾ß µÇ¼[[br]]
¾à°£ ´À¸®±âµµ ÇÏÁö¸¸ ´Ù¾çÇÑ Á¾·ùÀÇ ÀÚµ¿¿Ï¼º ±â´ÉÀÌ ÀÖ°í »ç¿ëÀÚ ÃëÇâ¿¡ ¸Â°Ô ¼³Á¤ ÇÒ ¼ö ÀÖ¾î¼ Á¤¸» °·ÂÇÕ´Ï´Ù.[[br]]
ÀÏ·Ê·Î VS¿¡¼ MFC·Î ÇÁ·Î±×·¡¹ÖÀ» ¾î´À Á¤µµ ÇÏ´Ù º¸¸é ¸â¹öÇÔ¼ö °°Àº °ÍÀ» °ÅÀÇ ±â¾ï ÇÒ ¼ö Àֱ⠶§¹®¿¡[[br]]
±× ºÐÀÌ ¿À¼Å¼ Á¤¸» ½Å³»¸° ÄÚµù(?)À» ÇÒ ¶§´Â ¿ÀÈ÷·Á ÀÎÅÚ¸®¼¾½º ±â´ÉÀÌ °ÅÄ¡Àû°Å·Á¼ ²¨³õ°í ÄÚµùÇÏ´Â °æ¿ìµµ ÀÖÀ¸½Ç °ÍÀÔ´Ï´Ù.[[br]]
ÀÌ·² °æ¿ì¿¡µµ Emacs´Â ¾ÆÁÖ À¯¿¬ÇÑ ´ëó°¡ °¡´ÉÇÕ´Ï´Ù.
== Áغñ ==
'''1) cedet ÆÐÅ°Áö ¼³Ä¡'''[[br]]
http://cedet.sourceforge.net/ [[br]]
1.0pre4 ¹öÀü¿¡¼´Â C++ namespace¸¦ ¾µ °æ¿ì ÀÚ½ÄŬ·¡½º¿¡¼ ºÎ¸ðŬ·¡½º ¸â¹ö°¡ ÀÚµ¿¿Ï¼º¿¡ ¾È³ªÅ¸³ª¹Ç·Î cvs ¹öÀü »ç¿ëÇϼ¼¿ä.
{{{
cvs -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet login
¾ÏÈ£ ¹°¾îº¸¸é ¿£ÅÍ
cvs -z3 -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet co -P cedet
}}}
¼³Ä¡°æ·Î/INSTALL ÆÄÀÏÀ» Âü°íÇؼ ÄÄÆÄÀÏ ¹× .emacs¿¡ Ãß°¡Ç϶ó°í ÇÑ °Í Ãß°¡ÇØ ÁÝ´Ï´Ù.
Âü°í:[[br]]
µ¥ºñ¾È lenny¿¡¼´Â emacs-snapshot°ú ±âÁ¸ ÀúÀå¼ÒÀÇ cedet ÆÐÅ°Áö°¡ Ãæµ¹ÇϹǷΠÀúÀå¼Ò cedetÆÐÅ°Áö´Â Á¦°ÅÇÏ°í cvs ¹öÀü ¼öµ¿ ¼³Ä¡Çϼ¼¿ä.[[br]]
(lenny°¡ stableÀÌ µÈ ÀÌÈķδ ¹ÌÈ®ÀÎ »óÅÂ)
'''2) .emacs¿¡ ´ÙÀ½ Ãß°¡'''
{{{
;; ÇöÀç(2009³â 4¿ù 12ÀÏ) cvs ¹öÀü¿¡¼´Â ¾Æ·¡°¡ ¾ø¾îµµ ÀÚµ¿¿Ï¼ºÀÌ µÇ¾úÀ½
;; (require 'semantic-ia)
;; (global-semanticdb-minor-mode 1)
;; ij½¬ ÆÄÀÏ ¸¸µé¾î µÎ´Â °÷
;; ½Ã½ºÅÛ ¶óÀ̺귯¸®´Â °°Àº °æ¿ì °ÅÀÇ º¯°æµÉ ÀÏÀÌ ¾ø±â ¶§¹®¿¡
;; ÇÑ ¹ø ij½¬µÇ¸é ´ÙÀ½ ¹ø ÀÚµ¿¿Ï¼º¿¡¼´Â ºü¸£°Ô »ç¿ë °¡´ÉÇÕ´Ï´Ù.
;; Æú´õ "~/.emacs.d/#semanticdb.cache#" ´Â Àû´çÈ÷ ¿øÇÏ´Â °ÍÀ¸·Î ²À ¸¸µé¾î ÁÖ¾î¾ß ÇÕ´Ï´Ù.
(setq semanticdb-default-save-directory "~/.emacs.d/#semanticdb.cache#")
;; ÀÚµ¿¿Ï¼º¿¡ ¾µ Çì´õ ÆÄÀÏ °æ·Î Àû´Â ¿¹
;; ÀÌ°ÍÀÌ ÀÖ¾î¾ß #include ÇÑ Çì´õÆÄÀÏÀÇ ³»¿ëµµ ÀÚµ¿¿Ï¼º¿¡ ³ªÅ¸³³´Ï´Ù.
(semantic-add-system-include "/usr/include/gtkmm-2.4/" 'c++-mode)
}}}
== ÀÎÅÚ¸®¼¾½º (Intellisense) ==
=== Á¾·ù ===
emacs ÀÎÅÚ¸®¼¾½º¿¡´Â ¿©·¯ °¡Áö°¡ ÀÖ½À´Ï´Ù.[[br]]
(cedet ¹öÀü¿¡ µû¶ó ¾Æ·¡ °¢ ÇÔ¼ö°¡ ÀÚµ¿¿Ï¼ºÀ» ÇÏ´Â ¸ð¾çÀÌ ´Ù¸¦ ¼ö ÀÖ½À´Ï´Ù.)
'''1) semantic-ia-complete-symbol-menu'''
attachment:semantic-ia-complete-symbol-menu.png
'''2) semantic-ia-complete-symbol'''
attachment:semantic-ia-complete-symbol.png
'''3) semantic-ia-complete-tip'''
attachment:semantic-ia-complete-tip.png
'''4) senator-completion-menu-popup'''
attachment:senator-completion-menu-popup.png
'''5) semantic-complete-self-insert''' ("." ÀÔ·ÂÇÏ°í "sho"±îÁö ÀÔ·ÂÈÄ tab ´©¸¥ »óÅÂ)
attachment:semantic-complete-self-insert.png
'''6) semantic-complete-analyze-inline'''
attachment:semantic-complete-analyze-inline.png
'''7) semantic-analyze-possible-completions'''
attachment:semantic-analyze-possible-completions.png
'''8) global-semantic-idle-completions-mode''' ("sh" ÀÔ·ÂÇÏ°í ¾à1ÃÊ ±â´Ù¸° ÈÄ tab 2¹ø ´©¸¥ »óÅÂ)
attachment:global-semantic-idle-completions-mode.png
=== Å°¹ÙÀεù ¿¹Á¦ ===
{{{
;; cedet semantic ÀÎÅÚ¸®¼¾½º Å°¹ÙÀεù ¿¹Á¦
(global-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
(global-set-key [(control shift return)] 'semantic-ia-complete-tip)
(global-set-key [(control c)(control return)] 'semantic-complete-analyze-inline)
(global-set-key [(shift return)] 'semantic-analyze-possible-completions)
}}}
¿¹¸¦ µé¾î semantic-ia-complete-symbol-menu °°Àº °æ¿ì ÀÎÅÚ¸®¼¾½º¸¦ »ç¿ëÇÒ °÷¿¡¼[[br]]
C-RET ÇÏ°í C-n (¾Æ·¡), C-p (À§), C-f (¿À¸¥ÂÊ), C-b (¿ÞÂÊ) ·Î ¿òÁ÷ÀÌ°í RET·Î ¼±ÅÃÇÏ°í[[br]]
C-g ·Î Ãë¼ÒÇÏ¸é µË´Ï´Ù.
´õ °£´ÜÇÏ°Ô Ctrl "°è¼Ó" ´©¸¥ »óÅ¿¡¼ RET ÇÏ°í n,p,f,b ·Î À½Á÷ÀÌ°í g·Î Ãë¼ÒÇÏ´Â ¹æ¹ýµµ °¡´ÉÇÕ´Ï´Ù.
Âü°í»çÇ×À¸·Î MSÀ©µµ¿ì¿¡¼´Â semantic-ia-complete-symbol-menu âÀÌ C-g ·Î »ç¶óÁöÁö ¾Ê´Âµ¥[[br]]
ESC Å°³ª ÀÌ»óÇÏ°Ôµµ ¿ÞÂÊ Alt Å°¸¦ ´©¸£¸é »ç¶óÁý´Ï´Ù.
=== VS¿Í ºñ½ÁÇÏ°Ô ÀÎÅÚ¸®¼¾½º¸¦ "." "->" "::" ·Î »ç¿ëÇϱâ ===
VSó·³ "." "->" "::" ÀԷµǸé ÀÎÅÚ¸®¼¾½º°¡ µÇµµ·Ï »ç¿ëÇÏ·Á¸é ¸í½ÃÀûÀ¸·Î Å°¹ÙÀεùÀ» Çؼ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù.
cedet ȨÆäÀÌÁö¿¡ ³ª¿Â ³»¿ëÀ¸·Î Çϸé "." ´Â µÇ´Âµ¥ "->" "::" ´Â ¿øÇÏ´Â ´ë·Î ÀÛµ¿ÀÌ ¾ÈµÇ¼ Äڵ带 ¾à°£ Ãß°¡Çؼ .emacs ÆÄÀÏ¿¡ ³Ö¾î¾ß ÇÕ´Ï´Ù.[[br]]
Âü°í: http://cedet.sourceforge.net/intellisense.shtml
{{{
;; óÀ½ ºÎÅÍ . -> :: ±â´ÉÀ» »ç¿ëÇϽ÷Á¸é ¾Æ·¡ "nil" À» "t" ¹Ù²Ù¼¼¿ä.
(defvar semantic-complete-self-insert-p nil)
(defun semantic-complete-self-insert-toggle-switch ()
(interactive)
(if semantic-complete-self-insert-p
(progn (setq semantic-complete-self-insert-p nil)
(message "semantic-complete-self-insert off") )
(progn (setq semantic-complete-self-insert-p t)
(message "semantic-complete-self-insert on") ) ) )
(defun semantic-complete-self-insert-for-dot-operator (arg)
(interactive "p")
(if semantic-complete-self-insert-p
(call-interactively 'semantic-complete-self-insert)
(self-insert-command arg) ) )
(defun semantic-complete-self-insert-for-arrow-operator (arg)
(interactive "p")
(if (and semantic-complete-self-insert-p
(string= "-" (char-to-string (char-before (point)) ) ) )
(call-interactively 'semantic-complete-self-insert)
(self-insert-command arg) ) )
(defun semantic-complete-self-insert-for-scope-operator (arg)
(interactive "p")
(if (and semantic-complete-self-insert-p
(string= ":" (char-to-string (char-before (point)) ) ) )
(call-interactively 'semantic-complete-self-insert)
(self-insert-command arg) ) )
(defun c++-mode-additional-semantic-keys ()
"Key bindings to add to `c++-mode'."
(define-key c++-mode-map [(control c)(control .)] 'semantic-complete-self-insert-toggle-switch)
(define-key c++-mode-map "." 'semantic-complete-self-insert-for-dot-operator)
(define-key c++-mode-map ">" 'semantic-complete-self-insert-for-arrow-operator)
(define-key c++-mode-map ":" 'semantic-complete-self-insert-for-scope-operator)
)
(add-hook 'c++-mode-hook 'c++-mode-additional-semantic-keys)
}}}
== ½Éº¼¿Ï¼º(symbol completion) ==
=== Á¾·ù ===
½Éº¼¿Ï¼º¿¡µµ ÀÎÅÚ¸®¼¾½ºÃ³·³ ¿©·¯°¡Áö°¡ ÀÖ½À´Ï´Ù.
'''1) dabbrev-expand'''[[br]]
emacs¿¡ ³»ÀåµÈ ±â´ÉÀÔ´Ï´Ù. ÇöÀç ¿·Á ÀÖ´Â ¹öÆÛÀÇ ½Éº¼À» °¡Áö°í ÀÚµ¿¿Ï¼ºÀ» ÇÕ´Ï´Ù.[[br]]
Á×, C-x C-b (list-buffers) Çؼ ³ª¿À´Â ¸®½ºÆ® Áß ÀÚ½ÅÀÌ ¸¸µç ¹öÆÛ°¡ ÇØ´çµË´Ï´Ù.[[br]]
(Áö¿ªº¯¼ö¸¦ ½Éº¼¿Ï¼º ÇÒ ¶§ Á¤¸» ÆíÇÕ´Ï´Ù. ÇöÀç ¹öÆÛ °Ë»öÀ» Á¦ÀÏ ¸ÕÀúÇϱ⠶§¹®¿¡...)
'''2) hippie-expand'''[[br]]
dabbrev-expand ó·³ emacs¿¡ ³»ÀåµÈ ±â´ÉÀÔ´Ï´Ù.[[br]]
dabbrev-expand¿Í hippie-expand Áß ¼±È£ÇÏ´Â °ÍÀ» »ç¿ëÇϼ¼¿ä.[[br]]
(senator-minor-mode ¸¦ off ÇÏ°í »ç¿ëÇϼ¼¿ä.)
'''3) senator-complete-symbol'''[[br]]
cedet ÆÐÅ°Áö¸¦ »ç¿ëÇÏ¸é ±×³É »ç¿ë ÇÒ ¼ö ÀÖ½À´Ï´Ù.[[br]]
ÀÎÅÚ¸®¼¾½ºÃ³·³ #include ¸¦ Æ÷ÇÔÇؼ ÀÚµ¿¿Ï¼ºÀ» ÇÕ´Ï´Ù.
'''4) complete-symbol'''[[br]]
etags ·Î TAGS ÆÄÀÏÀ» ¸¸µé¾î ÁÖ¾îÁÖ°í visit-tags-table À» ÇØ¾ß »ç¿ë °¡´ÉÇÕ´Ï´Ù.
'''5) ebrowse-tags-complete-symbol'''[[br]]
ebrowse ·Î BROWSE ÆÄÀ»À» ¸¸µé¾î ÁÖ°í BROWSE ÆÄÀÏÀ» ´Ù¸¥ ¹öÆÛ¿¡ ¿¾î µÎ¾î¾ß »ç¿ë °¡´ÉÇÕ´Ï´Ù.[[br]]
ebrowseÀÇ ±â´ÉÀÌ etags¿Í ºñ½ÁÇÏÁö¸¸ ebrowse°¡ C++¿¡ ´õ Àß ÃÖÀûȵǾî ÀÖ½À´Ï´Ù.([http://www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html#Tags Âü°í¹®¼])
=== Å°¹ÙÀεù ¿¹Á¦ ===
{{{
;;;; ½Éº¼¿Ï¼º Å°¹ÙÀεù ¿¹Á¦
;; M-/ (dabbrev-expand) - emacs¿¡ ±âº» ¼³Á¤ µÇ¾î ÀÖÀ½
;;senator-complete-symbol ±âº» Å°¹ÙÀεùÀº C-c , TAB ÀÌ°í ¾Æ·¡´Â Ãß°¡ ÁöÁ¤ÇÑ °ÍÀÓ
(global-set-key [(meta return)] 'senator-complete-symbol)
(global-set-key [(meta shift return)] 'complete-symbol)
;; ebrowse-tags-complete-symbol ±âº» Å°¹ÙÀεùÀº C-c RET TAB ÀÌ°í ¾Æ·¡´Â Ãß°¡ ÁöÁ¤ÇÑ °ÍÀÓ
(global-set-key [(control meta return)] 'ebrowse-tags-complete-symbol)
}}}
¿¹¸¦ µé¾î senator-complete-symbol ¸¦ »ç¿ëÇÒ °÷¿¡¼ M-RET ¸¦ ´©¸£¸é[[br]]
»ç¿ë °¡´ÉÇÑ ½Éº¼ÀÌ ¿Ï¼ºÀÌ µÇ°í ´Ù½Ã M-RET´©¸£¸é ´Ù¸¥ ½Éº¼ÀÌ ¿Ï¼ºµÇ°í[[br]]
ÀÌ·± ½ÄÀ¸·Î »ç¿ë °¡´ÉÇÑ ½Éº¼ÀÌ µ¹¾Æ°¡¸ç ¿Ï¼ºµÇ°Ô µË´Ï´Ù.
Meta(Alt)¸¦ "°è¼Ó" ´©¸¥ »óÅ¿¡¼ RET¸¸ ´©¸£´Â ¹æ¹ýµµ °¡´ÉÇÕ´Ï´Ù.
== ÀÎÅÚ¸®¼¾½º¿Í ½Éº¼¿Ï¼º Å×½ºÆ® ==
ÀÎÅÚ¸®¼¾½º´Â ¿øÇÏ´Â ¸ðµç °ÍÀ» ÀÚµ¿¿Ï¼º½Ãų ¼ö ÀÖÁö¸¸ ´À¸®±â ¶§¹®¿¡ ½Éº¼¿Ï¼ºÀ» ÀûÀýÈ÷ »ç¿ëÇϸé ÁÁÀºµ¥[[br]]
½Éº¼¿Ï¼ºÀÇ Á¾·ù¿¡ µû¶ó ÀÚµ¿¿Ï¼ºÀÌ ¿øÇÏ´Â ´ë·Î ¾È µÇ´Â °æ¿ìµµ ÀÖ½À´Ï´Ù.[[br]]
±ÍÂúÀ¸½Å ºÐÀº ¼ÓÆíÈ÷ ÀÎÅÚ¸®¼¾½º¸¸ »ç¿ëÇϼŵµ µË´Ï´Ù.
¾Æ·¡¿Í °°Àº Äڵ尡 ÀÖ°í etags¿Í ebrowse·Î TAGS¿Í BROWSE ÆÄÀÏÀ» ¸¸µé¾ú°í BROWSE ÆÄÀÏÀº ´Ù¸¥ ¹öÆÛ¿¡ ¿¾î ³õ¾Ò´Ù °¡Á¤ÇÕ´Ï´Ù.
{{{
#include
class Test
{
public:
Test();
virtual ~Test();
public:
void TestClassPrint () = 0;
void TestClassPrint2 () = 0;
};
void TestFunctionPrint()
{
printf("hello emacs");
}
int main(int argc, char *argv[])
{
int localvalue = 4;
Test test;
printf("print localvalue : %d", localvalue);
_ <-- ¿©±â Ä¿¼
return 0;
}
}}}
'''Å×½ºÆ® 1)'''[[br]]
À§ »óÅ¿¡¼[[br]]
"lo"±îÁö ŸÀÌÇÎ ÈÄ "localvalue"À» ¿Ï¼º ½ÃÅ°°íÀÚ Çϸé ÀÎÅÚ¸®¼¾½º´Â semantic-complete-self-insert¸¦ Á¦¿ÜÇÏ°í ÀüºÎ »ç¿ëÇÒ ¼ö ÀÖ°í[[br]]
½Éº¼¿Ï¼ºÀº dabbrev-expand(hippie-expand)¿Í senator-complete-symbol¸¸ ¿Ï¼º ½Ãų ¼ö ÀÖ½À´Ï´Ù.[[br]]
±× ÀÌÀ¯´Â TAGS¿Í EBROWSEÆÄÀÏÀ» ¿¾î º¸¸é localvalue¶ó´Â °ÍÀÌ ¾ø°í Ŭ·¡½º¸í, ÇÔ¼ö, ¸â¹öÇÔ¼ö¸¸ ű׷Π¸¸µé¾îÁ®¼ ÀÖ¾î¼[[br]]
complete-symbol, ebrowse-tags-complete-symbol´Â "localvalue"¸¦ ÀÚµ¿¿Ï¼º ½Ãų ¼ö ¾ø½À´Ï´Ù.
'''Å×½ºÆ® 2)'''[[br]]
À§ »óÅ¿¡¼
"test.Te"±îÁö ŸÀÌÇÎ ÈÄ "{{{test.TestClassPrint}}}"¸¦ ¿Ï¼º ½ÃÅ°°íÀÚ Çϸé ÀÎÅÚ¸®¼¾½º´Â ÀüºÎ »ç¿ëÇÒ ¼ö ÀÖ°í[[br]]
½Éº¼¿Ï¼ºÀº senator-complete-symbol¿Í ebrowse-tags-complete-symbol ¸¸ ¿Ï¼º ½Ãų ¼ö ÀÖ½À´Ï´Ù.[[br]]
C++ ÀÇ ¸â¹öÇÔ¼öÀ̱⠶§¹®¿¡ complete-symbol´Â ¿Ï¼º ½Ãų ¼ö ¾ø½À´Ï´Ù. TAGSÆÄÀÏÀ» ¿¾î º¸¸é ¾Ë ¼ö ÀÖ½À´Ï´Ù.
Âü°í:[[br]]
find-file (C-x C-f)·Î BROWSE ÆÄÀÏÀ» ¿¸é Ebrowse-Tree Mode ·Î µé¾î°¡±â ¶§¹®¿¡[[br]]
³»¿ëÀ» º¸°í ½ÍÀ¸½Ã¸é M-x find-file-literally ¸¦ »ç¿ëÇϼ¼¿ä.
== °¡»ó ½Ã³ª¶ó¿À ==
emacs¿¡´Â ÀÚµ¿¿Ï¼º Á¾·ù°¡ ³Ê¹« ¸¹±â ¶§¹®¿¡ °¡»ó ½Ã³ª¶ó¿À¸¦ Çϳª Àû¾î º¾´Ï´Ù.
¿ì¼± Áö¿ªº¯¼ö ÀÚµ¿¿Ï¼ºÀº M-/ (dabbrev-expand)¸¦ »ç¿ëÇÕ´Ï´Ù.[[br]]
ÀÌ°ÍÀº ÇöÀç ¹öÆÛÀÇ ½Éº¼À» ¸ÕÀú °Ë»öÇÏ°í emacs¿¡ ³»ÀåµÇ¾î ÀÖ¾î °¡Àå ºü¸£±â ¶§¹®¿¡ ÃÖ»óÀÇ ¼±ÅÃÀ̶ó »ý°¢µË´Ï´Ù.
óÀ½ Á¢ÇÏ´Â ¶óÀ̺귯¸®°¡ ÀÖ´Ù °¡Á¤ÇÏ¸é ¸â¹öÇÔ¼ö °°Àº °ÍÀÌ Àͼ÷Áö ¾Ê±â ¶§¹®¿¡[[br]]
semantic-complete-self-insert¿Í semantic-ia-complete-symbol-menu¸¦ Àû´çÈ÷ ¼¯¾î »ç¿ëÇÏ´Ù°¡[[br]]
Á» Àͼ÷ÇØ Áö¸é ¸â¹öÇÔ¼ö¸íÀ» »ý°¢³ª´Âµ¥ ±îÁö ŸÀÌÇÎ ÈÄ semantic-complete-analyze-inline ¸¦ »ç¿ëÇÏ°í[[br]]
»ý°¢ÀÌ ¾È ³ª´Â ¸Å°³º¯¼ö°¡ ÀÖÀ¸¸é semantic-analyze-possible-completions ¸¦ »ç¿ëÇÕ´Ï´Ù.
±×¸®°í ¶óÀ̺귯¸®°¡ ¿ÏÀüÈ÷ ´É¼÷ÇØÁ®¼ ¿Ø¸¸ÇÑ ¸â¹öÇÔ¼ö°¡ ´Ù ±â¾ï³ª¸é[[br]]
ÀÌÁ¦ ½Å³»¸° ÄÚµù(?)À» ÇÏ¸ç °£°£È÷ ½Éº¼¿Ï¼º(senator-complete-symbol)À» »ç¿ëÇÏ¸é µË´Ï´Ù.
ÀÚ½ÅÀÌ ¸¸µç Ŭ·¡½º °°Àº °æ¿ìµµ ¸â¹öÇÔ¼ö¸¦ °ÅÀÇ ±â¾ïÇÏ°í Àֱ⠶§¹®¿¡ ½Éº¼¿Ï¼º(senator-complete-symbol)À» »ç¿ëÇÏ¸é µË´Ï´Ù.
complete-symbol, ebrowse-tags-complete-symbol ´Â TAGS, BROWSE ÆÄÀÏÀ» µû·Î ¸í·É¾î¸¦ »ç¿ëÇؼ[[br]]
¸¸µé¾î¾ß ÇÏ´Â ºÎ´ãÀÌ Àֱ⠶§¹®¿¡ ¼Ò½ºÄÚµå ºÐ¼® °â ¼öÁ¤ ÇÒ ¶§ »ç¿ëÇϸé ÁÁ½À´Ï´Ù.
(tag·Î ÁöÁ¤µÈ °÷À» ¿Ô´Ù °¬´Ù ÇÒ ¼ö ÀÖÀ¸¹Ç·Î...)
== Yet Another Snippet (yasnippet) ==
ÀÎÅÚ¸®¼¾½º¿Í ½Éº¼¿Ï¼ºÀÌ¸é ¿Ïº®ÇÏÁö¸¸[[br]]
yasnippet ±îÁö »ç¿ëÇϸé Á¤¸» ´õÇÒ ³ªÀ§ ¾ø°Ô µË´Ï´Ù.
yet another snippet extension for Emacs.[[br]]
http://code.google.com/p/yasnippet/
"class" ŸÀÌÇÎ ÈÄ tab ´©¸£°í "Te"±îÁö ÀÔ·ÂÇÑ È¸é
attachment:yasnippet.png
ÁÖÀÇ»çÇ×:[[br]]
yasnippet·Î ¿Ï¼ºµÈ ÄÚµå´Â indent°¡ space·Î »ðÀԵǰí indent levelÀÌ 4ÀÔ´Ï´Ù.[[br]]
±×·¡¼ ¼³Á¤ÀÌ ´Ù¸£½Å ºÐÀº Á¤·ÄÀ» ´Ù½Ã ÇØÁÖ¾î¾ß Çϴµ¥[[br]]
°¡Àå °£´ÜÇÑ ÇØ°á ¹æ¹ýÀº .emacs¿¡ ¾Æ·¡¸¦ Ãß°¡ÇÏ´Â °ÍÀÔ´Ï´Ù.
{{{
(add-hook 'yas/after-exit-snippet-hook
'(lambda ()
(indent-region yas/snippet-beg
yas/snippet-end)))
}}}
(Ãâó: http://code.google.com/p/yasnippet/wiki/Tips)
Âü°í:[[br]]
c¾ð¾î °°Àº °æ¿ì [http://www.emacswiki.org/emacs/MsfAbbrev msf-abbrev]°¡ °¡ ´õ ÆíÇÒ ¼ö ÀÖ½À´Ï´Ù.
by »çÀÌÁ®:[[br]]
msf-abbrev°¡ yasnippetº¸´Ù ´õ »¡¸® ³ª¿Â ¾à¾î(abbrevation or snippet) ¸ðµåÀÌ°í, ¿äÁò À¯ÇàÇÏ°í ÀÖ´Â °ÍÀº msf-abbrev°¡ ¾Æ´Ï¶ó yasnippetÀÔ´Ï´Ù.[[br]]
== ½Ç½Ã°£ ºÐ¼® (real-time analysis) ==
ÀÚµ¿¿Ï¼º¿¡ ¿¬°üµÈ emacsÀÇ °·ÂÇÑ ±â´ÉÀ» Çϳª ¼Ò°³ÇÏ°Ú½À´Ï´Ù.
'''1) semantic-speedbar-analysis'''
attachment:semantic-speedbar-analysis.png
'''2) ECB Analyse Buffer''' (ECB ¼³Ä¡ ÇÊ¿ä)
attachment:ecb-analyse-buffer.png
Âü°í:[[br]]
analyse-buffer ¹ÝÀÀÀÌ ´À¸®´Ù¸é[[br]]
C-h v (M-x describe-variable)[[br]]
ecb-analyse-buffer-sync-delay Âü°íÇϼż Àû´çÈ÷ ¹Ù²Ù¼¼¿ä.[[br]]
Àú°°Àº °æ¿ì ÇÑ 0.7 Á¤µµÇÏ´Ï ÀûÀýÇß½À´Ï´Ù.
- ÇöÀç(2009³â 7¿ù 4ÀÏ) [http://ecb.sourceforge.net/cvs_snapshots/ecb.tar.gz Latest CVS-shapshot] ¹öÀü¿¡¼´Â ¾Æ·¡ ¹®Á¦ ÇØ°áµÇ¾ú½À´Ï´Ù.[[br]]
¾Æ·¡ ¸Þ¼¼Áö°¡ ³ª¿À°í ECB Analyse Buffer °¡ ÀÛµ¿ ¾ÈµÈ´Ù¸é
{{{
eieio-default-superclass: Invalid slot name: "#", localvariables
Invalid slot name: "#", localvariables
}}}
ecb-analyse.el ÆÄÀÏ¿¡ ¾Æ·¡¸¦ Àû¿ëÇØ º¸¼¼¿ä.
{{{
***************
*** 270,276 ****
(defmethod ecb-analyse-more-nodes ((context semantic-analyze-context))
"Show a set of ecb-nodes specific to CONTEXT."
! (let ((localvars (oref context localvariables)))
(when localvars
(ecb-analyse-add-nodes "Local Variables" "Local Variables" localvars
ecb-analyse-nodetype-localvars)))
--- 270,278 ----
(defmethod ecb-analyse-more-nodes ((context semantic-analyze-context))
"Show a set of ecb-nodes specific to CONTEXT."
! (let* ((scope (oref context scope))
! (localvars (when scope
! (oref scope localvar))))
(when localvars
(ecb-analyse-add-nodes "Local Variables" "Local Variables" localvars
ecb-analyse-nodetype-localvars)))
}}}
== ¹®Á¦ÇØ°á ¹× À̽´ ==
=== ÀÎÅÚ¸®¼¾½º°¡ Àß ¾ÈµÉ ¶§ ===
¾Æ·¡ ¿¡·¯°¡ ³ª¿À°í ÀÎÅÚ¸®¼¾½º°¡ Àß ¾ÈµÈ´Ù¸é
{{{
semantic-analyze-possible-completions-default:
Cannot find types for `"..."'
}}}
.emacs ÆÄÀÏ¿¡¼ semantic-add-system-include ÇÔ¼ö·Î Çì´õÆÄÀÏ °æ·Î¸¦ Àß ¼³Á¤Çß´ÂÁö È®ÀÎÇÏ°í[[br]]
{{{
C-x C-s (save-buffer)
M-x revert-buffer
}}}
ÀÌ·¸°Ô Çϼ¼¿ä.
Á» ´õ ÆíÇÏ°Ô »ç¿ëÇÏ·Á¸é ¾Æ·¡ »çÀÌÆ®¸¦ Âü°íÇؼ[[br]]
http://www.stokebloke.com/wordpress/2008/04/17/emacs-refresh-f5-key/
¾Æ·¡¸¦ .emacs ÆÄÀÏ¿¡ Ãß°¡Çϼ¼¿ä.
{{{
(defun refresh-file-after-save-buffer ()
"refresh file after save buffer"
(interactive)
(save-buffer)
(revert-buffer t t t) )
(global-set-key [(control c)(control R)] 'refresh-file-after-save-buffer)
}}}
=== semanticÀº "add-hook" ¿¡ ¹Î°¨ÇÏ´Ù? ===
¿¹1)
{{{
(add-hook 'c-mode-common-hook 'folding-mode)
}}}
folding-mode°¡ ·Îµå°¡ ¾È µÇ¾î ÀÖ¾î¼ "folding-mode" °¡ void-function ÀÏ °æ¿ì
¾Æ·¡ ¿¡·¯°¡ »ý±æ ¼ö ÀÖ½À´Ï´Ù.[[br]]
{{{
Wrong type argument: syntax-table-p,nil
}}}
¿¹2)
choose-header-file-mode (http://han9kin.doesntexist.com/28) ÇÔ¼ö°°Àº °æ¿ì ¾Æ·¡Ã³·³ ¼öÁ¤ÇØ¾ß Á¤»ó ÀÛµ¿ÇÕ´Ï´Ù.
{{{
(defun choose-header-file-mode ()
(if (and buffer-file-name (string= (file-name-extension buffer-file-name) "h"))
(let ((filebase (file-name-sans-extension buffer-file-name)))
(cond
((and (file-exists-p (concat filebase ".c"))
(not (string= major-mode "c-mode")))
(c-mode) )
((and (file-exists-p (concat filebase ".cpp"))
(not (string= major-mode "c++-mode")))
(c++-mode) )
((and (file-exists-p (concat filebase ".cc"))
(not (string= major-mode "c++-mode")))
(c++-mode) )
((and (file-exists-p (concat filebase ".m"))
(not (string= major-mode "objc-mode")))
(objc-mode) )
((and (file-exists-p (concat filebase ".mm"))
(not (string= major-mode "objc-mode")))
(objc-mode) )
((and t
(not (string= major-mode "c++-mode")))
(c++-mode) ) ) )
) )
(add-hook 'c-mode-common-hook 'choose-header-file-mode)
}}}
±×·¸Áö ¾ÊÀ¸¸é ¾Æ·¡°°Àº ¿¡·¯°¡ »ý±æ ¼ö ÀÖ½À´Ï´Ù.
{{{
semantic-analyze-current-context: Wrong type argument: syntax-table-p, nil
eieio-generic-call: No method definition: semantic-analyze-type-constraint, (nil)
}}}
Âü°í:[[br]]
find-file-hook¿¡ Ãß°¡ÇÑ ÇÔ¼ö°¡ Àß ÀÛµ¿ÀÌ ¾ÈµÇ¸é c-mode-common-hook, after-change-major-mode-hookÀ¸·Î ¿Å°Ü º¸°Å³ª [[br]]
add-hook¿¡ ¿É¼Ç ¸Å°³º¯¼öµµ Á¶Á¤ÇØ º¸¼¼¿ä.
{{{
(add-hook 'xxxxx 'xxxxx t t)
}}}
=== ¸ÅÅ©·Î(#define) ¶§¹®¿¡ ÀÚµ¿¿Ï¼ºÀÌ ¾ÈµÉ ¶§ ===
¿¹¸¦ µé¾î ¾Æ·¡ °°Àº mfc ÇÔ¼ö °°Àº °æ¿ì
{{{
_AFXWIN_INLINE CWinApp* AFXAPI AfxGetApp() {...
}}}
{{{AfxGetApp()->}}}·Î ÀÚµ¿¿Ï¼ºÀ» ½ÃµµÇϸé {{{CWinApp*}}}ÇüÀÌ ¾Æ´Ï¶ó {{{AFXAPI}}}ÇüÀ¸·Î ÀνÄÇؼ ÀÚµ¿¿Ï¼ºÀÌ ¾È µÇ´Âµ¥[[br]]
¾Æ·¡¸¦ Ãß°¡Çؼ ¸ÅÅ©·Î¸¦ ¹«·ÂȽÃÅ°¸é Á¤»óÀûÀ¸·Î ÀÚµ¿¿Ï¼ºÀÌ µË´Ï´Ù.(ÀÌÀü¿¡ »ý¼ºµÈ ij½¬ ÆÄÀÏ »èÁ¦ ÇÊ¿ä)
{{{
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("_AFXWIN_INLINE" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("AFXAPI" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("AFX_CDECL" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("PASCAL" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CALLBACK" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__cdecl" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__stdcal" . ""))
}}}
mfc¿Ü¿¡µµ wxWidget µîµîÀÇ ¶óÀ̺귯¸®Ã³·³ ¸ÅÅ©·Î°¡ ¸¹Àº °æ¿ì È°¿ë °¡´ÉÇÕ´Ï´Ù.[[br]]
Âü°í:[[br]]
[wiki:CedetWxWidgets CEDET wxWidgets ÀÚµ¿¿Ï¼º]
=== MS À©µµ¿ì¿¡¼ cedet ÄÄÆÄÀÏ ¹®Á¦ ===
MS À©µµ¿ì¿¡¼ EmacsW32, msys µîµîÀÇ ¹öÀü Ư¼º ¶§¹®¿¡ cedet ÄÄÆÄÀÏÇÒ ¶§[[br]]
¾Æ·¡¿Í °°Àº ¿¡·¯¸¦ ¸¸³¯ ¼ö Àִµ¥
{{{
Symbol's value as variable is void: outbuffer
Symbol's value as variable is void: filename
Cannot open load file: srecode-fields
Cannot open load file: eieio-load
Cannot open load file: semantic-load
Cannot open load file: srecode-load
Cannot open load file: ede-load
Cannot open load file: cogre-loaddefs
Cannot open load file: contrib-loaddefs
}}}
ÀÏ´Ü °ø½Ä GNU Emacs¸¦ »ç¿ëÇÏ°í[[br]]
http://ftp.gnu.org/pub/gnu/emacs/
cedet-build.el ÆÄÀÏÀ» emacs·Î ÀÐ¾î µéÀÎ ÈÄ
{{{
M-x eval-buffer
M-x cedet-build-in-default-emacs
}}}
ÀÌ·±½ÄÀ¸·Î emacs ³»ºÎ¿¡¼ ÄÄÆÄÀÏÇϼ¼¿ä.[[br]]
ÄÄÆÄÀÏÇϴµ¥ ²Ï ½Ã°£ÀÌ ¿À·¡ °É¸³´Ï´Ù.[[br]]
±×¸®°í "Done"À̶ó´Â ¹®±¸°¡ ³ª¿À´ÂÁö È®ÀÎÇϼ¼¿ä.(Âü°í ½º¼¦: [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/cedet-compile-in-mswin.png cedet-compile-in-mswin.png])
== ¶Ç ´Ù¸¥ ÀÚµ¿¿Ï¼º ==
cedetÀÇ semanticÀº c,c++ ¾ð¾î´Â ¿Ïº®ÇÏ°Ô Áö¿øÇÏ´Â ¹Ý¸é¿¡ ´Ù¸¥ ¾ð¾î´Â ¹Ì¹ÌÇÑ ÆíÀÔ´Ï´Ù.[[br]]
´Ù¸¥ Åø »ç¿ëµµ °í·ÁÇØ º¸¼¼¿ä.[[br]]
Âü°í:[[br]]
http://www.emacswiki.org/emacs/CategoryCompletion
1) C++ ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://kldp.org/files/emacs-gtkmm.png emacs-gtkmm.png] [http://kldp.org/files/emacsw32gtkmm.png emacsw32gtkmm.png] [http://kldp.org/files/emacs-afxgetapp.png emacs-afxgetapp.png][[br]]
Âü°í:[[br]]
* http://kldp.org/node/96363 [[br]]
* http://kldp.org/node/99132 [[br]]
* http://kldp.org/node/104547 [[br]]
* auto-complete + gtags ÀÌ¿ë : [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/auto-complete-gtags-gtkmm.png auto-complete-gtags-gtkmm.png]
2) Python ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://kldp.org/files/emacs-python-with-auto-complete.png emacs-python-with-auto-complete.png][[br]]
Âü°í:[[br]]
* http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/ [[br]]
* http://kldp.org/node/101873
3) PHP ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://kldp.org/files/emacs-php-auto-complete.png emacs-php-auto-complete.png][[br]]
Âü°í:[[br]]
* http://php-mode.sourceforge.net/html-manual/Completion.html [[br]]
* http://github.com/ashizawa/autocompletion-php-functions/tree/master [[br]]
* http://kldp.org/node/104700
4) HTML ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://kldp.org/files/emacs-tag-completion.png emacs-tag-completion.png][[br]]
Âü°í:[[br]]
* http://www.emacswiki.org/emacs/NxhtmlMode [[br]]
* http://kldp.org/node/104700 [[br]]
* ¶Ç ´Ù¸¥ ¹æ½ÄÀÎ [http://www.emacswiki.org/emacs/ZenCoding ZenCoding]µµ ÃßõÇÕ´Ï´Ù.
5) JavaScript ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/emacs-javascript-completion.png emacs-javascript-completion.png]
6) CSS ÀÚµ¿¿Ï¼º ¿¹[[br]]
Screenshot : [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/emacs-css-completion.png emacs-css-completion.png]
7) Perl ÀÚµ¿¿Ï¼º ¿¹ [[br]]
Screenshot : [http://kldp.org/files/emacs-perl-auto-complete.png emacs-perl-auto-complete.png][[br]]
Âü°í:[[br]]
* http://www.emacswiki.org/emacs/PerlCompletion [[br]]
* http://kldp.org/node/105822
8) Ruby ÀÚµ¿¿Ï¼º ¿¹ [[br]]
Screenshot : [http://kldp.org/files/auto-complete-ruby.png auto-complete-ruby.png][[br]]
Âü°í:[[br]]
* http://kldp.org/node/110632
9) Java ÀÚµ¿¿Ï¼º ¿¹ [[br]]
Screenshot : [http://kldp.org/files/jde-complete.png jde-complete.png][[br]]
Âü°í:[[br]]
* http://kldp.org/node/110967
10) Bash ÀÚµ¿¿Ï¼º ¿¹ [[br]]
Screenshot : [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/sh-mode.png sh-mode.png]
11) Debian rules ÀÚµ¿¿Ï¼º ¿¹ [[br]]
Screenshot : [http://wiki.kldp.org/pds/EmacsAutoCompletionQuickNote/rules(makefile-mode).png rules(makefile-mode).png]
[[br]]
(!) [wiki:primewizard] 20081026