Emacs Auto Completion Quick Note
À̸ƽº(Emacs) ÀÚµ¿¿Ï¼º ÃÊ°£´Ü »ç¿ë¹ý
¿ë¾îÀÇ ÀÏ°ü¼ºÀ» À§ÇØ
"ÀÎÅÚ¸®¼¾½º(intellisense)"´Â ¸®½ºÆ®¸¦ º¸¿©ÁÖ´Â ÀÚµ¿¿Ï¼ºÀ» ÀǹÌÇÏ°í "½Éº¼¿Ï¼º(symbol completion)"Àº ¸®½ºÆ®¸¦ ¾È º¸¿©ÁÖ´Â ÀÚµ¿¿Ï¼ºÀ» ÀǹÌÇÏ´Â °ÍÀ¸·Î ÇÏ°Ú½À´Ï´Ù. ±×¸®°í Emacs¿¡´Â ÀÚµ¿¿Ï¼ºÀ̶ó°í ÀÏÄþîÁö´Â auto completion, smart completion, intellisense µîµî
Á¾·ù°¡ ³Ê¹« ¸¹±â ¶§¹®¿¡ cedet ÆÐÅ°Áö¿¡ ÀÖ´Â semanticÀ» Áß½ÉÀ¸·Î ¼³¸íÇÕ´Ï´Ù. Emacs¿¡¼ ÀÚµ¿¿Ï¼ºÀº ¼³Á¤µµ ¾à°£ ±î´Ù·Ó°í ¸Ç óÀ½ ÀÚµ¿¿Ï¼ºÀÌ µÉ ¶§´Â ij½¬ ÆÄÀÏÀ» »ý¼ºÇØ¾ß µÇ¼
¾à°£ ´À¸®±âµµ ÇÏÁö¸¸ ´Ù¾çÇÑ Á¾·ùÀÇ ÀÚµ¿¿Ï¼º ±â´ÉÀÌ ÀÖ°í »ç¿ëÀÚ ÃëÇâ¿¡ ¸Â°Ô ¼³Á¤ ÇÒ ¼ö ÀÖ¾î¼ Á¤¸» °·ÂÇÕ´Ï´Ù. ÀÏ·Ê·Î VS¿¡¼ MFC·Î ÇÁ·Î±×·¡¹ÖÀ» ¾î´À Á¤µµ ÇÏ´Ù º¸¸é ¸â¹öÇÔ¼ö °°Àº °ÍÀ» °ÅÀÇ ±â¾ï ÇÒ ¼ö Àֱ⠶§¹®¿¡ ±× ºÐÀÌ ¿À¼Å¼ Á¤¸» ½Å³»¸° ÄÚµù(?)À» ÇÒ ¶§´Â ¿ÀÈ÷·Á ÀÎÅÚ¸®¼¾½º ±â´ÉÀÌ °ÅÄ¡Àû°Å·Á¼ ²¨³õ°í ÄÚµùÇÏ´Â °æ¿ìµµ ÀÖÀ¸½Ç °ÍÀÔ´Ï´Ù. ÀÌ·² °æ¿ì¿¡µµ Emacs´Â ¾ÆÁÖ À¯¿¬ÇÑ ´ëó°¡ °¡´ÉÇÕ´Ï´Ù. 1. Áغñ ¶1) cedet ÆÐÅ°Áö ¼³Ä¡
http://cedet.sourceforge.net/ 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¿¡ Ãß°¡Ç϶ó°í ÇÑ °Í Ãß°¡ÇØ ÁÝ´Ï´Ù. Âü°í:
µ¥ºñ¾È lenny¿¡¼´Â emacs-snapshot°ú ±âÁ¸ ÀúÀå¼ÒÀÇ cedet ÆÐÅ°Áö°¡ Ãæµ¹ÇϹǷΠÀúÀå¼Ò cedetÆÐÅ°Áö´Â Á¦°ÅÇÏ°í cvs ¹öÀü ¼öµ¿ ¼³Ä¡Çϼ¼¿ä. (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) 2.1. Á¾·ù ¶emacs ÀÎÅÚ¸®¼¾½º¿¡´Â ¿©·¯ °¡Áö°¡ ÀÖ½À´Ï´Ù.
(cedet ¹öÀü¿¡ µû¶ó ¾Æ·¡ °¢ ÇÔ¼ö°¡ ÀÚµ¿¿Ï¼ºÀ» ÇÏ´Â ¸ð¾çÀÌ ´Ù¸¦ ¼ö ÀÖ½À´Ï´Ù.) 1) semantic-ia-complete-symbol-menu
[PNG image (71.53 KB)] 2) semantic-ia-complete-symbol
[PNG image (81.94 KB)] 3) semantic-ia-complete-tip
[PNG image (64.96 KB)] 4) senator-completion-menu-popup
[PNG image (70.08 KB)] 5) semantic-complete-self-insert ("." ÀÔ·ÂÇÏ°í "sho"±îÁö ÀÔ·ÂÈÄ tab ´©¸¥ »óÅÂ)
[PNG image (76.03 KB)] 6) semantic-complete-analyze-inline
[PNG image (77.94 KB)] 7) semantic-analyze-possible-completions
[PNG image (80.02 KB)] 8) global-semantic-idle-completions-mode ("sh" ÀÔ·ÂÇÏ°í ¾à1ÃÊ ±â´Ù¸° ÈÄ tab 2¹ø ´©¸¥ »óÅÂ)
[PNG image (56.77 KB)] 2.2. Å°¹ÙÀεù ¿¹Á¦ ¶;; 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 °°Àº °æ¿ì ÀÎÅÚ¸®¼¾½º¸¦ »ç¿ëÇÒ °÷¿¡¼
C-RET ÇÏ°í C-n (¾Æ·¡), C-p (À§), C-f (¿À¸¥ÂÊ), C-b (¿ÞÂÊ) ·Î ¿òÁ÷ÀÌ°í RET·Î ¼±ÅÃÇÏ°í C-g ·Î Ãë¼ÒÇÏ¸é µË´Ï´Ù. ´õ °£´ÜÇÏ°Ô Ctrl "°è¼Ó" ´©¸¥ »óÅ¿¡¼ RET ÇÏ°í n,p,f,b ·Î À½Á÷ÀÌ°í g·Î Ãë¼ÒÇÏ´Â ¹æ¹ýµµ °¡´ÉÇÕ´Ï´Ù. Âü°í»çÇ×À¸·Î MSÀ©µµ¿ì¿¡¼´Â semantic-ia-complete-symbol-menu âÀÌ C-g ·Î »ç¶óÁöÁö ¾Ê´Âµ¥
ESC Å°³ª ÀÌ»óÇÏ°Ôµµ ¿ÞÂÊ Alt Å°¸¦ ´©¸£¸é »ç¶óÁý´Ï´Ù. 2.3. VS¿Í ºñ½ÁÇÏ°Ô ÀÎÅÚ¸®¼¾½º¸¦ "." "->" "::" ·Î »ç¿ëÇϱ⠶VSó·³ "." "->" "::" ÀԷµǸé ÀÎÅÚ¸®¼¾½º°¡ µÇµµ·Ï »ç¿ëÇÏ·Á¸é ¸í½ÃÀûÀ¸·Î Å°¹ÙÀεùÀ» Çؼ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù.
cedet ȨÆäÀÌÁö¿¡ ³ª¿Â ³»¿ëÀ¸·Î Çϸé "." ´Â µÇ´Âµ¥ "->" "::" ´Â ¿øÇÏ´Â ´ë·Î ÀÛµ¿ÀÌ ¾ÈµÇ¼ Äڵ带 ¾à°£ Ãß°¡Çؼ .emacs ÆÄÀÏ¿¡ ³Ö¾î¾ß ÇÕ´Ï´Ù.
Âü°í: 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) 3.1. Á¾·ù ¶½Éº¼¿Ï¼º¿¡µµ ÀÎÅÚ¸®¼¾½ºÃ³·³ ¿©·¯°¡Áö°¡ ÀÖ½À´Ï´Ù.
1) dabbrev-expand
emacs¿¡ ³»ÀåµÈ ±â´ÉÀÔ´Ï´Ù. ÇöÀç ¿·Á ÀÖ´Â ¹öÆÛÀÇ ½Éº¼À» °¡Áö°í ÀÚµ¿¿Ï¼ºÀ» ÇÕ´Ï´Ù. Á×, C-x C-b (list-buffers) Çؼ ³ª¿À´Â ¸®½ºÆ® Áß ÀÚ½ÅÀÌ ¸¸µç ¹öÆÛ°¡ ÇØ´çµË´Ï´Ù. (Áö¿ªº¯¼ö¸¦ ½Éº¼¿Ï¼º ÇÒ ¶§ Á¤¸» ÆíÇÕ´Ï´Ù. ÇöÀç ¹öÆÛ °Ë»öÀ» Á¦ÀÏ ¸ÕÀúÇϱ⠶§¹®¿¡...) 2) hippie-expand
dabbrev-expand ó·³ emacs¿¡ ³»ÀåµÈ ±â´ÉÀÔ´Ï´Ù. dabbrev-expand¿Í hippie-expand Áß ¼±È£ÇÏ´Â °ÍÀ» »ç¿ëÇϼ¼¿ä. (senator-minor-mode ¸¦ off ÇÏ°í »ç¿ëÇϼ¼¿ä.) 3) senator-complete-symbol
cedet ÆÐÅ°Áö¸¦ »ç¿ëÇÏ¸é ±×³É »ç¿ë ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÎÅÚ¸®¼¾½ºÃ³·³ #include ¸¦ Æ÷ÇÔÇؼ ÀÚµ¿¿Ï¼ºÀ» ÇÕ´Ï´Ù. 4) complete-symbol
etags ·Î TAGS ÆÄÀÏÀ» ¸¸µé¾î ÁÖ¾îÁÖ°í visit-tags-table À» ÇØ¾ß »ç¿ë °¡´ÉÇÕ´Ï´Ù. 5) ebrowse-tags-complete-symbol
ebrowse ·Î BROWSE ÆÄÀ»À» ¸¸µé¾î ÁÖ°í BROWSE ÆÄÀÏÀ» ´Ù¸¥ ¹öÆÛ¿¡ ¿¾î µÎ¾î¾ß »ç¿ë °¡´ÉÇÕ´Ï´Ù. ebrowseÀÇ ±â´ÉÀÌ etags¿Í ºñ½ÁÇÏÁö¸¸ ebrowse°¡ C++¿¡ ´õ Àß ÃÖÀûȵǾî ÀÖ½À´Ï´Ù.(Âü°í¹®¼) 3.2. Å°¹ÙÀεù ¿¹Á¦ ¶;;;; ½Éº¼¿Ï¼º Å°¹ÙÀεù ¿¹Á¦ ;; 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 ¸¦ ´©¸£¸é
»ç¿ë °¡´ÉÇÑ ½Éº¼ÀÌ ¿Ï¼ºÀÌ µÇ°í ´Ù½Ã M-RET´©¸£¸é ´Ù¸¥ ½Éº¼ÀÌ ¿Ï¼ºµÇ°í ÀÌ·± ½ÄÀ¸·Î »ç¿ë °¡´ÉÇÑ ½Éº¼ÀÌ µ¹¾Æ°¡¸ç ¿Ï¼ºµÇ°Ô µË´Ï´Ù. Meta(Alt)¸¦ "°è¼Ó" ´©¸¥ »óÅ¿¡¼ RET¸¸ ´©¸£´Â ¹æ¹ýµµ °¡´ÉÇÕ´Ï´Ù.
4. ÀÎÅÚ¸®¼¾½º¿Í ½Éº¼¿Ï¼º Å×½ºÆ® ¶ÀÎÅÚ¸®¼¾½º´Â ¿øÇÏ´Â ¸ðµç °ÍÀ» ÀÚµ¿¿Ï¼º½Ãų ¼ö ÀÖÁö¸¸ ´À¸®±â ¶§¹®¿¡ ½Éº¼¿Ï¼ºÀ» ÀûÀýÈ÷ »ç¿ëÇϸé ÁÁÀºµ¥
½Éº¼¿Ï¼ºÀÇ Á¾·ù¿¡ µû¶ó ÀÚµ¿¿Ï¼ºÀÌ ¿øÇÏ´Â ´ë·Î ¾È µÇ´Â °æ¿ìµµ ÀÖ½À´Ï´Ù. ±ÍÂúÀ¸½Å ºÐÀº ¼ÓÆíÈ÷ ÀÎÅÚ¸®¼¾½º¸¸ »ç¿ëÇϼŵµ µË´Ï´Ù. ¾Æ·¡¿Í °°Àº Äڵ尡 ÀÖ°í etags¿Í ebrowse·Î TAGS¿Í BROWSE ÆÄÀÏÀ» ¸¸µé¾ú°í BROWSE ÆÄÀÏÀº ´Ù¸¥ ¹öÆÛ¿¡ ¿¾î ³õ¾Ò´Ù °¡Á¤ÇÕ´Ï´Ù.
#include <iostream> 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) À§ »óÅ¿¡¼ "lo"±îÁö ŸÀÌÇÎ ÈÄ "localvalue"À» ¿Ï¼º ½ÃÅ°°íÀÚ Çϸé ÀÎÅÚ¸®¼¾½º´Â semantic-complete-self-insert¸¦ Á¦¿ÜÇÏ°í ÀüºÎ »ç¿ëÇÒ ¼ö ÀÖ°í ½Éº¼¿Ï¼ºÀº dabbrev-expand(hippie-expand)¿Í senator-complete-symbol¸¸ ¿Ï¼º ½Ãų ¼ö ÀÖ½À´Ï´Ù. ±× ÀÌÀ¯´Â TAGS¿Í EBROWSEÆÄÀÏÀ» ¿¾î º¸¸é localvalue¶ó´Â °ÍÀÌ ¾ø°í Ŭ·¡½º¸í, ÇÔ¼ö, ¸â¹öÇÔ¼ö¸¸ ű׷Π¸¸µé¾îÁ®¼ ÀÖ¾î¼ complete-symbol, ebrowse-tags-complete-symbol´Â "localvalue"¸¦ ÀÚµ¿¿Ï¼º ½Ãų ¼ö ¾ø½À´Ï´Ù. Å×½ºÆ® 2)
À§ »óÅ¿¡¼ "test.Te"±îÁö ŸÀÌÇÎ ÈÄ " test.TestClassPrint "¸¦ ¿Ï¼º ½ÃÅ°°íÀÚ Çϸé ÀÎÅÚ¸®¼¾½º´Â ÀüºÎ »ç¿ëÇÒ ¼ö ÀÖ°í½Éº¼¿Ï¼ºÀº senator-complete-symbol¿Í ebrowse-tags-complete-symbol ¸¸ ¿Ï¼º ½Ãų ¼ö ÀÖ½À´Ï´Ù. C++ ÀÇ ¸â¹öÇÔ¼öÀ̱⠶§¹®¿¡ complete-symbol´Â ¿Ï¼º ½Ãų ¼ö ¾ø½À´Ï´Ù. TAGSÆÄÀÏÀ» ¿¾î º¸¸é ¾Ë ¼ö ÀÖ½À´Ï´Ù. Âü°í:
find-file (C-x C-f)·Î BROWSE ÆÄÀÏÀ» ¿¸é Ebrowse-Tree Mode ·Î µé¾î°¡±â ¶§¹®¿¡ ³»¿ëÀ» º¸°í ½ÍÀ¸½Ã¸é M-x find-file-literally ¸¦ »ç¿ëÇϼ¼¿ä. 5. °¡»ó ½Ã³ª¶ó¿À ¶emacs¿¡´Â ÀÚµ¿¿Ï¼º Á¾·ù°¡ ³Ê¹« ¸¹±â ¶§¹®¿¡ °¡»ó ½Ã³ª¶ó¿À¸¦ Çϳª Àû¾î º¾´Ï´Ù.
¿ì¼± Áö¿ªº¯¼ö ÀÚµ¿¿Ï¼ºÀº M-/ (dabbrev-expand)¸¦ »ç¿ëÇÕ´Ï´Ù.
ÀÌ°ÍÀº ÇöÀç ¹öÆÛÀÇ ½Éº¼À» ¸ÕÀú °Ë»öÇÏ°í emacs¿¡ ³»ÀåµÇ¾î ÀÖ¾î °¡Àå ºü¸£±â ¶§¹®¿¡ ÃÖ»óÀÇ ¼±ÅÃÀ̶ó »ý°¢µË´Ï´Ù. óÀ½ Á¢ÇÏ´Â ¶óÀ̺귯¸®°¡ ÀÖ´Ù °¡Á¤ÇÏ¸é ¸â¹öÇÔ¼ö °°Àº °ÍÀÌ Àͼ÷Áö ¾Ê±â ¶§¹®¿¡
semantic-complete-self-insert¿Í semantic-ia-complete-symbol-menu¸¦ Àû´çÈ÷ ¼¯¾î »ç¿ëÇÏ´Ù°¡ Á» Àͼ÷ÇØ Áö¸é ¸â¹öÇÔ¼ö¸íÀ» »ý°¢³ª´Âµ¥ ±îÁö ŸÀÌÇÎ ÈÄ semantic-complete-analyze-inline ¸¦ »ç¿ëÇÏ°í »ý°¢ÀÌ ¾È ³ª´Â ¸Å°³º¯¼ö°¡ ÀÖÀ¸¸é semantic-analyze-possible-completions ¸¦ »ç¿ëÇÕ´Ï´Ù. ±×¸®°í ¶óÀ̺귯¸®°¡ ¿ÏÀüÈ÷ ´É¼÷ÇØÁ®¼ ¿Ø¸¸ÇÑ ¸â¹öÇÔ¼ö°¡ ´Ù ±â¾ï³ª¸é
ÀÌÁ¦ ½Å³»¸° ÄÚµù(?)À» ÇÏ¸ç °£°£È÷ ½Éº¼¿Ï¼º(senator-complete-symbol)À» »ç¿ëÇÏ¸é µË´Ï´Ù. ÀÚ½ÅÀÌ ¸¸µç Ŭ·¡½º °°Àº °æ¿ìµµ ¸â¹öÇÔ¼ö¸¦ °ÅÀÇ ±â¾ïÇÏ°í Àֱ⠶§¹®¿¡ ½Éº¼¿Ï¼º(senator-complete-symbol)À» »ç¿ëÇÏ¸é µË´Ï´Ù.
complete-symbol, ebrowse-tags-complete-symbol ´Â TAGS, BROWSE ÆÄÀÏÀ» µû·Î ¸í·É¾î¸¦ »ç¿ëÇؼ
¸¸µé¾î¾ß ÇÏ´Â ºÎ´ãÀÌ Àֱ⠶§¹®¿¡ ¼Ò½ºÄÚµå ºÐ¼® °â ¼öÁ¤ ÇÒ ¶§ »ç¿ëÇϸé ÁÁ½À´Ï´Ù. (tag·Î ÁöÁ¤µÈ °÷À» ¿Ô´Ù °¬´Ù ÇÒ ¼ö ÀÖÀ¸¹Ç·Î...) 6. Yet Another Snippet (yasnippet) ¶ÀÎÅÚ¸®¼¾½º¿Í ½Éº¼¿Ï¼ºÀÌ¸é ¿Ïº®ÇÏÁö¸¸
yasnippet ±îÁö »ç¿ëÇϸé Á¤¸» ´õÇÒ ³ªÀ§ ¾ø°Ô µË´Ï´Ù. yet another snippet extension for Emacs.
http://code.google.com/p/yasnippet/ "class" ŸÀÌÇÎ ÈÄ tab ´©¸£°í "Te"±îÁö ÀÔ·ÂÇÑ È¸é
[PNG image (41.3 KB)] ÁÖÀÇ»çÇ×:
yasnippet·Î ¿Ï¼ºµÈ ÄÚµå´Â indent°¡ space·Î »ðÀԵǰí indent levelÀÌ 4ÀÔ´Ï´Ù. ±×·¡¼ ¼³Á¤ÀÌ ´Ù¸£½Å ºÐÀº Á¤·ÄÀ» ´Ù½Ã ÇØÁÖ¾î¾ß Çϴµ¥ °¡Àå °£´ÜÇÑ ÇØ°á ¹æ¹ýÀº .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) Âü°í:
c¾ð¾î °°Àº °æ¿ì msf-abbrev°¡ °¡ ´õ ÆíÇÒ ¼ö ÀÖ½À´Ï´Ù. by »çÀÌÁ®:
msf-abbrev°¡ yasnippetº¸´Ù ´õ »¡¸® ³ª¿Â ¾à¾î(abbrevation or snippet) ¸ðµåÀÌ°í, ¿äÁò À¯ÇàÇÏ°í ÀÖ´Â °ÍÀº msf-abbrev°¡ ¾Æ´Ï¶ó yasnippetÀÔ´Ï´Ù. 7. ½Ç½Ã°£ ºÐ¼® (real-time analysis) ¶ÀÚµ¿¿Ï¼º¿¡ ¿¬°üµÈ emacsÀÇ °·ÂÇÑ ±â´ÉÀ» Çϳª ¼Ò°³ÇÏ°Ú½À´Ï´Ù.
1) semantic-speedbar-analysis
[PNG image (89.58 KB)] 2) ECB Analyse Buffer (ECB ¼³Ä¡ ÇÊ¿ä)
[PNG image (92.31 KB)] Âü°í:
analyse-buffer ¹ÝÀÀÀÌ ´À¸®´Ù¸é C-h v (M-x describe-variable) ecb-analyse-buffer-sync-delay Âü°íÇϼż Àû´çÈ÷ ¹Ù²Ù¼¼¿ä. Àú°°Àº °æ¿ì ÇÑ 0.7 Á¤µµÇÏ´Ï ÀûÀýÇß½À´Ï´Ù. - ÇöÀç(2009³â 7¿ù 4ÀÏ) Latest CVS-shapshot ¹öÀü¿¡¼´Â ¾Æ·¡ ¹®Á¦ ÇØ°áµÇ¾ú½À´Ï´Ù.
¾Æ·¡ ¸Þ¼¼Áö°¡ ³ª¿À°í ECB Analyse Buffer °¡ ÀÛµ¿ ¾ÈµÈ´Ù¸é
eieio-default-superclass: Invalid slot name: "#<semantic-analyze-context context>", localvariables Invalid slot name: "#<semantic-analyze-context context>", localvariablesecb-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))) 8.1. ÀÎÅÚ¸®¼¾½º°¡ Àß ¾ÈµÉ ¶§ ¶¾Æ·¡ ¿¡·¯°¡ ³ª¿À°í ÀÎÅÚ¸®¼¾½º°¡ Àß ¾ÈµÈ´Ù¸é
semantic-analyze-possible-completions-default: Cannot find types for `"..."'.emacs ÆÄÀÏ¿¡¼ semantic-add-system-include ÇÔ¼ö·Î Çì´õÆÄÀÏ °æ·Î¸¦ Àß ¼³Á¤Çß´ÂÁö È®ÀÎÇÏ°í C-x C-s (save-buffer) M-x revert-bufferÀÌ·¸°Ô Çϼ¼¿ä. Á» ´õ ÆíÇÏ°Ô »ç¿ëÇÏ·Á¸é ¾Æ·¡ »çÀÌÆ®¸¦ Âü°íÇؼ
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) 8.2. semanticÀº "add-hook" ¿¡ ¹Î°¨ÇÏ´Ù? ¶¿¹1)
(add-hook 'c-mode-common-hook 'folding-mode)folding-mode°¡ ·Îµå°¡ ¾È µÇ¾î ÀÖ¾î¼ "folding-mode" °¡ void-function ÀÏ °æ¿ì ¾Æ·¡ ¿¡·¯°¡ »ý±æ ¼ö ÀÖ½À´Ï´Ù. 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) Âü°í:
find-file-hook¿¡ Ãß°¡ÇÑ ÇÔ¼ö°¡ Àß ÀÛµ¿ÀÌ ¾ÈµÇ¸é c-mode-common-hook, after-change-major-mode-hookÀ¸·Î ¿Å°Ü º¸°Å³ª add-hook¿¡ ¿É¼Ç ¸Å°³º¯¼öµµ Á¶Á¤ÇØ º¸¼¼¿ä. (add-hook 'xxxxx 'xxxxx t t) 8.3. ¸ÅÅ©·Î(#define) ¶§¹®¿¡ ÀÚµ¿¿Ï¼ºÀÌ ¾ÈµÉ ¶§ ¶¿¹¸¦ µé¾î ¾Æ·¡ °°Àº mfc ÇÔ¼ö °°Àº °æ¿ì
_AFXWIN_INLINE CWinApp* AFXAPI AfxGetApp() {... AfxGetApp()-> ·Î ÀÚµ¿¿Ï¼ºÀ» ½ÃµµÇϸé CWinApp* ÇüÀÌ ¾Æ´Ï¶ó AFXAPI ÇüÀ¸·Î ÀνÄÇؼ ÀÚµ¿¿Ï¼ºÀÌ ¾È µÇ´Âµ¥¾Æ·¡¸¦ Ãß°¡Çؼ ¸ÅÅ©·Î¸¦ ¹«·ÂȽÃÅ°¸é Á¤»óÀûÀ¸·Î ÀÚµ¿¿Ï¼ºÀÌ µË´Ï´Ù.(ÀÌÀü¿¡ »ý¼ºµÈ 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 µîµîÀÇ ¶óÀ̺귯¸®Ã³·³ ¸ÅÅ©·Î°¡ ¸¹Àº °æ¿ì È°¿ë °¡´ÉÇÕ´Ï´Ù. Âü°í: CEDET wxWidgets ÀÚµ¿¿Ï¼º 8.4. MS À©µµ¿ì¿¡¼ cedet ÄÄÆÄÀÏ ¹®Á¦ ¶MS À©µµ¿ì¿¡¼ EmacsW32, msys µîµîÀÇ ¹öÀü Ư¼º ¶§¹®¿¡ cedet ÄÄÆÄÀÏÇÒ ¶§
¾Æ·¡¿Í °°Àº ¿¡·¯¸¦ ¸¸³¯ ¼ö Àִµ¥ 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¸¦ »ç¿ëÇÏ°í http://ftp.gnu.org/pub/gnu/emacs/ cedet-build.el ÆÄÀÏÀ» emacs·Î ÀÐ¾î µéÀÎ ÈÄ
M-x eval-buffer M-x cedet-build-in-default-emacsÀÌ·±½ÄÀ¸·Î emacs ³»ºÎ¿¡¼ ÄÄÆÄÀÏÇϼ¼¿ä. ÄÄÆÄÀÏÇϴµ¥ ²Ï ½Ã°£ÀÌ ¿À·¡ °É¸³´Ï´Ù. ±×¸®°í "Done"À̶ó´Â ¹®±¸°¡ ³ª¿À´ÂÁö È®ÀÎÇϼ¼¿ä.(Âü°í ½º¼¦: cedet-compile-in-mswin.png) 9. ¶Ç ´Ù¸¥ ÀÚµ¿¿Ï¼º ¶cedetÀÇ semanticÀº c,c++ ¾ð¾î´Â ¿Ïº®ÇÏ°Ô Áö¿øÇÏ´Â ¹Ý¸é¿¡ ´Ù¸¥ ¾ð¾î´Â ¹Ì¹ÌÇÑ ÆíÀÔ´Ï´Ù.
´Ù¸¥ Åø »ç¿ëµµ °í·ÁÇØ º¸¼¼¿ä. Âü°í: http://www.emacswiki.org/emacs/CategoryCompletion 1) C++ ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-gtkmm.png emacsw32gtkmm.png emacs-afxgetapp.png Âü°í: * http://kldp.org/node/96363 * http://kldp.org/node/99132 * http://kldp.org/node/104547 * auto-complete + gtags ÀÌ¿ë : auto-complete-gtags-gtkmm.png 2) Python ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-python-with-auto-complete.png Âü°í: * http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/ * http://kldp.org/node/101873 3) PHP ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-php-auto-complete.png Âü°í: * http://php-mode.sourceforge.net/html-manual/Completion.html * http://github.com/ashizawa/autocompletion-php-functions/tree/master * http://kldp.org/node/104700 4) HTML ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-tag-completion.png Âü°í: * http://www.emacswiki.org/emacs/NxhtmlMode * http://kldp.org/node/104700 * ¶Ç ´Ù¸¥ ¹æ½ÄÀÎ ZenCodingµµ ÃßõÇÕ´Ï´Ù. 6) CSS ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-css-completion.png 7) Perl ÀÚµ¿¿Ï¼º ¿¹
Screenshot : emacs-perl-auto-complete.png Âü°í: * http://www.emacswiki.org/emacs/PerlCompletion * http://kldp.org/node/105822 10) Bash ÀÚµ¿¿Ï¼º ¿¹
Screenshot : sh-mode.png 11) Debian rules ÀÚµ¿¿Ï¼º ¿¹
Screenshot : rules(makefile-mode).png primewizard 20081026 |
The attacker must vanquish; the defender need only survive. |