æè¿ã® Emacs ã®ã³ã¡ã³ãæ©è½ã«ã¤ãã¦ã®ã¾ã¨ãã
è¿½è¨ ãã®è¨äºãå ã«æ¸ç±ãåºæ¥ã¾ããï¼
æéã¨å½ãåã£ã¦ããã詳細ã«è§£èª¬ãã¾ããã®ã§ãEmacs ã«èå³ããã人ã¯ãã²ä¸åº¦æã«åã£ã¦ã¿ã¦ä¸ããã

- ä½è : 大竹æºä¹
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2012/03/07
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- è³¼å ¥: 22人 ã¯ãªãã¯: 396å
- ãã®ååãå«ãããã° (1件) ãè¦ã
ã¨ãã£ã¿ã®éè¦ãªæ©è½ã®ã²ã¨ã¤ã«ã³ã¡ã³ãã¨ã³ã¡ã³ãã¢ã¦ããããã¾ãã
Emacs ã®ã³ã¡ã³ãæ©è½ã¯ã¨ã¦ãåªç§ã§ãæ¨æºã§æ§ã ãªè¨èªããµãã¼ããã¦ãã¾ããã§ãã®ã§ãæ¡å¼µããã©ã°ã¤ã³çãªãã®ãã¤ã³ã¹ãã¼ã«ãããã¨ãªããç°¡åã«ã³ã¡ã³ããã¤ããããã³ã¡ã³ãã¢ã¦ãããããããã解é¤ãããã§ãã¾ãã
ä¾ãã°ã
a:link, a:visited { background-color: transparent; color: #c88f22; text-decoration: none; }
ã¨ãã CSS ããªã¼ã¸ã§ã³é¸æãã¦ãM-x comment-region ã¨ããã³ãã³ããå®è¡ããã ãã§
/* a:link, a:visited { */ /* background-color: transparent; */ /* color: #c88f22; */ /* text-decoration: none; */ /* } */
ãã®ããã«ä¸æ°ã«ã³ã¡ã³ãã¢ã¦ããããã¨ãã§ãã¾ãã
ã§ãã®ã§ãã½ã¼ã¹ã«è¤æ°è¡ã«æ¸¡ãã³ã¡ã³ãæãå
¥ããå ´åã¯ãããããã¨æç« ãæ¸ãã¦ãããä¸æ°ã«ã³ã¡ã³ãã¢ã¦ãããã®ãåºæ¬ã¨ãªãã¾ãã
ãã¡ãã¡ãã³ã¡ã³ãæåãã¿ã¤ããã¦ãã¦ã¯ããã¾ããã
æå¼·ã³ã¡ã³ããã¼ãã¤ã³ã M-; (comment-dwim)ã
C-u M-x comment-region ã¨ããã³ãã³ãã§ãã³ã¡ã³ãã¢ã¦ãã解é¤ã§ããã¨ãã説æãå¤ãããã¾ãããç¾å¨ã® Emacs ã«ã¯ comment-dwim ã¨ããã³ãã³ããããã¾ãã
ãã®ã³ãã³ãã¯æ¨æºã§ M-; ã«ãã¤ã³ãããã¦ããããã®èª¬æã« Call the comment command you want (Do What I Mean). ã¨ããããã«ã空æ°ãèªãã§æ§ã
ãªã³ã¡ã³ããèªåçã«ä½¿ãåãã¦ããã¾ãã
ãã«ãã«æ¸ãã¦ããå
容ãç´¹ä»ããã¨ã
- transient-mark-mode ããªã³ã§ãªã¼ã¸ã§ã³ãæå¹ã®ã¨ãã« M-; ããã¨ãã³ã¡ã³ãã¢ã¦ãããããã¯è§£é¤ã®ã³ãã³ãã«ãªã
- transient-mark-mode ããªã³ã§ãªã¼ã¸ã§ã³ãæå¹ã®ã¨ãã« C-u æ°å¤ M-; ããã¨ãã³ã¡ã³ãæååãæ°å¤åã«ãã(ä¸ã«è£è¶³èª¬æãã)
- ä½ããªãè¡ã§ M-; ããå ´åãã³ã¡ã³ãæååãæ¿å ¥ãã
- ä½ãæ¸ããã¦ããè¡ã§ M-; ããå ´åãè¡æ«ã«ã³ã¡ã³ãæååãæ¿å ¥ãã
- ã³ã¡ã³ãè¡ã§ M-; ããå ´åãã³ã¡ã³ãæã¾ã§ã¸ã£ã³ããã
- ã³ã¡ã³ãè¡ã§ãå¼æ°ãä¸ã㦠M-; ããå ´å(C-u M-; ã¨ããæã)ãã³ã¡ã³ãè¡ã§ããã°åé¤ããã
ã¨ããæãã§ãã
transient-mark-mode ã使ã£ã¦ããªã人ã®å ´åã¯ãM-; ã空æ°ãèªãã§ãããªãã®ã§ãããããã人ã¯ã
(global-set-key (kbd "C-c ;") 'comment-or-uncomment-region)
ã¨ããæãã§ãcomment-or-uncomment-region ã³ãã³ãã使ãã¨è¯ãã¨æãã¾ãã
ãããã .emacs ã®
(define-key global-map "\C-c;" 'comment-region) ; ã³ã¡ã³ãã¢ã¦ã (define-key global-map "\C-c:" 'uncomment-region) ; ã³ã¡ã³ã解é¤
ã¨ããã2ã¤ã®ãã¼ãã¤ã³ãã«ã³ã¡ã³ãã¨è§£é¤ãå²ãå½ã¦ã¦ãè¨å®ã¯å¤ãã®ã§ããããã Emacs ã使ã人ã¯ãã¾ãåèã«ããªãã»ããããã¨æãã¾ããcomment-or-uncomment-region ã使ãã¾ãããã
2. ã«ã¤ãã¦è£è¶³ãã¦ããã¨ããªã¼ã¸ã§ã³é¸æãã¦ãC-u 3 M-; ã¨ããã¨ãLisp ã®å ´åã¯ã
;;; (set-language-environment "Japanese") ;;; (set-default-coding-systems 'utf-8-unix) ;;; (set-terminal-coding-system 'utf-8) ;;; (set-keyboard-coding-system 'utf-8)
ã¨ãã風ã«ãã³ã¡ã³ãæåã3ã¤ã«ããã¨ããæå³ã§ãã
ã³ã¡ã³ãã®ã¹ã¿ã¤ã«
æåã«ä¾ã«åºãã CSS ã®ã³ã¡ã³ãã¢ã¦ãã¯ãåè¡ã«ã³ã¡ã³ãã¢ã¦ãããããªã£ã¦ãã¦ã¡ãã£ã¨ã«ãã³æªãã§ãã
Emacs ãããããããããã¨ã¯æãã¦ããããã§ãã³ã¡ã³ãã®ã¹ã¿ã¤ã«ãå¤æ´ã§ããããã«ãªã£ã¦ãã¾ãã
(defconst comment-styles '((plain . (nil nil nil nil)) (indent . (nil nil nil t)) (indent-or-triple . (nil nil nil multi-char)) (aligned . (nil t nil t)) (multi-line . (t nil nil t)) (extra-line . (t nil t t)) (box . (nil t t t)) (box-multi . (t t t t))) "Comment region styles of the form (STYLE . (MULTI ALIGN EXTRA INDENT)). STYLE should be a mnemonic symbol. MULTI specifies that comments are allowed to span multiple lines. ALIGN specifies that the `comment-end' markers should be aligned. EXTRA specifies that an extra line should be used before and after the region to comment (to put the `comment-end' and `comment-start'). INDENT specifies that the `comment-start' markers should not be put at the left margin but at the current indentation of the region to comment. If INDENT is `multi-char', that means indent multi-character comment starters, but not one-character comment starters.")
ã³ã¡ã³ãã®ã¹ã¿ã¤ã«ã¯ãæ¨æºã§ä¸è¨ã®ããã«ç¨æããã¦ãã¾ããããã©ã«ã㯠indent ã§ãã®ã§ãå¤æ´ãããå ´åã¯ã
(setq comment-style 'multi-line)
ã¨ããããã« .emacs ã«æ¸ãã¦ãC-x C-e ã§è©ä¾¡ãã¾ãããã
/* a:link, a:visited { * background-color: transparent; * color: #c88f22; * text-decoration: none; * } */
multi-line ã ã¨ããããªæãã«ãªãã¾ãã
ã¡ãªã¿ã« box ã¯ã
/* ******************************** */ /* a:link, a:visited { */ /* background-color: transparent; */ /* color: #c88f22; */ /* text-decoration: none; */ /* } */ /* ******************************** */
ãããªæãã®ã´ã¼ã¸ã£ã¹ãªã³ã¡ã³ãã¢ã¦ãã«ãªãã¾ãããã¾ã«ã½ã¼ã¹ã§è¦ã¾ãããã¿ããªæå
¥åãã¦ãªãã£ããã§ããã
ã¨ããããã§ãã¿ãªãã Emacs ã§ããè¯ãã³ã¡ã³ãã©ã¤ãããéãä¸ãã :-)