2011-04-19 3 views
3

html 및 js 모드에서 emacs 들여 쓰기에 문제가 있습니다. 은 내가CSS, HTML in emacs에 대한 html 들여 쓰기

나는 또한 Smart Tab을보고이

(require 'smarttabs) 
(define-key read-expression-map [tab] 'hippie-expand) 
(define-key read-expression-map [backtab] 'unexpand) 

(smart-tabs-advice js2-indent-line js2-basic-offset) 
    (smart-tabs-advice python-indent-line-1 python-indent) 
    (add-hook 'python-mode-hook 
       (lambda() 
       (setq indent-tabs-mode t) 
       (setq tab-width (default-value 'tab-width)))) 
(smart-tabs-advice html-indent-line html-basic-offset) 

과 같은 코드를 만들 더 들여 더 나은 모드 또는 기능을 원하지만이 문제는 HTML 모드, nxhtml 모드, js2mode에, 너무 내가 좋아하는 많은 문제가 ( 특정 크기)이

<div> 
    <table> 
    <tr> 
     <td> 
     test 
     </td> 
    </tr> 
    </table> 
</div> 
  • 의 모든 공간과 내가 원하는 탭
  • 가끔 내가 더 탭 이하에 대한 tabshift tab를 사용하고 싶지만 작동하지 않습니다 ... 만이 들여 쓰기가 허용됩니다 : D

또는 같은 일도을 만들 자바 스크립트 js2mode이

function preview(img, selection) { 
    var scaleX = 64/(selection.width || 1); 
    var scaleY = 64/(selection.height || 1); 
    $('#preview').css({ 
          width: Math.round(scaleX * img.width) + 'px', 
          height: Math.round(scaleY * img.height) + 'px', 
          marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', 
          marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' 
         }); 
} 

하지만, 내가 원하는이

function preview(img, selection) { 
    var scaleX = 64/(selection.width || 1); 
    var scaleY = 64/(selection.height || 1); 
    $('#preview').css({ 
     width: Math.round(scaleX * img.width) + 'px', 
     height: Math.round(scaleY * img.height) + 'px', 
     marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', 
     marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' 
    }); 
} 

이 문제는 무엇을 할 수 있습니까?

답변