2011-10-24 2 views
2

방금 ​​쿠분투 11.10으로 업그레이드했습니다. 그 후 Emacs가 공백 부 모드에서 공백을 나타내는 방식이 변경되었습니다. 그것은 rectangulars 음영했다하지 이맥스는 공백의 위치에 점을두고 :Emacs 23.3.1 : 공백 스타일

enter image description here

그때 whitespaceM-x customize-group과를 통해 변경 시도 -하지만 점 같은 건 없다. 공백은 음영 (위의 그림 참조)으로 표시되어 있지만, 그렇지는 않습니다 (동일한 그림 참조).

여기에 공백 공간면의 값입니다 :

enter image description here

가 나는 또한 superuser에서이 질문을하지만, 내가 거기에 0 대답을 가지고 있기 때문에 - 나는 다른 커뮤니티에 문의하기로 결정했다. 편집 한

:

enter image description here

편집 2 : 루크의 솔루션에 따라

는 (잘못 I 짓을했는지하지 않는 무언가) 공간이나 탭에 어떤 색상을 제공하지

여기에 face을 추가하면 루크 솔루션이 수정됩니다. Sergey에게 감사드립니다.

(setq whitespace-style (quote 
    (face spaces tabs newline space-mark tab-mark newline-mark))) 

편집 3 : 현재

내가 사용 :

(custom-set-variables 
'(whitespace-line-column 9999999) 
'(whitespace-tab-width 4 t) 
'(whitespace-display-mappings '(
    (space-mark ?\ [?\u00B7] [?.])     ; space - centered dot 
    (space-mark ?\xA0 [?\u00A4] [?_])   ; hard space - currency 
    (newline-mark ?\n [?$ ?\n])      ; eol - dollar sign 
    (tab-mark ?\t [?\u00BB ?\t] [?\\ ?\t])  ; tab - left quote mark 
           )) 
'(whitespace-style '(face spaces tabs newline space-mark tab-mark newline-mark)) 
) 

(custom-set-faces 
'(default ((t (:inherit nil :stipple nil :background "#ffffb1" :foreground "#141312" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 125 :width normal :foundry "monotype" :family "DejaVu Sans Mono")))) 
'(whitespace-trailing ((t (:background "grey99")))) 
) 

이맥스에서 24.3.50.1

+0

'공백 공간'(세 번째 항목)의 값은 무엇입니까? –

+0

@ Luke Girvin : 스크린 샷을 업로드했습니다. – Adobe

답변

4
이 할 수있는 더 나은 방법이 거기에 아마

있지만 추가 귀하의 .emacs가 작동해야합니다 :

 
(setq whitespace-display-mappings 
     '(
    (space-mark ?\  [? ]) ;; use space not dot 
    (space-mark ?\xA0 [?\u00A4]  [?_]) 
    (space-mark ?\x8A0 [?\x8A4]  [?_]) 
    (space-mark ?\x920 [?\x924]  [?_]) 
    (space-mark ?\xE20 [?\xE24]  [?_]) 
    (space-mark ?\xF20 [?\xF24]  [?_]) 
    (newline-mark ?\n [?$ ?\n]) 
    (tab-mark  ?\t [?\u00BB ?\t] [?\\ ?\t]))) 

(custom-set-faces 
'(whitespace-space 
    ((((class color) (background dark)) (:background "red" :foreground "white")) 
    (((class color) (background light)) (:background "yellow" :foreground "black")) 
    (t (:inverse-video t))))) 

whitespace-display-mappings의 표준 값은 공백으로 '중간 점'을 사용하고 위 코드는 표준 공백을 사용합니다. 필요에 따라 whitespace-space의 색상을 변경할 수 있습니다.

+0

스크린 샷을 추가했습니다. Strange -하지만 .emacs에 코드를 추가 한 후에도 공백이나 탭이 강조 표시되지 않습니다. – Adobe

+0

-q 플래그로 Emacs를 시작한 후 코드를 평가하면 작동합니까? –

1

Luke Girvin의 조언을 사용하고 emacs-q 플래그로 시작한 후 Luke의 솔루션이 작동했습니다. 문제가 발견되었습니다.

;; make whitespace-mode use just basic coloring 
(setq whitespace-style (quote 
    (spaces tabs newline space-mark tab-mark newline-mark))) 

이 두 줄은 .emacs입니다. 그래서 customize-group 사용한 후이를 제거하고 - 사물이 방법을 만들기 위하여>whitespace을 :

enter image description here

그래서 ithe 문제가 해결된다. 감사합니다 루크!

4

공백 스타일로 다른 사람과 함께 'face'키워드를 추가하기 만하면됩니다. 예.:

(setq whitespace-style (quote 
    (face spaces tabs newline space-mark tab-mark newline-mark))) 
+0

나는 그것을 시도했다 - 당신 말이 맞다 - 실제로 얼굴을 추가하면 Luke의 해결책이 수정된다. (원래 게시물의 두 번째 스크린 샷). 감사. – Adobe

관련 문제