terminal 에서 emacs 실행시 한글 폰트 문제 및 한글 입출력 문제.

arecibo의 이미지

안녕하세요?

Kubuntu 6.10을 계산용 서버로 설정해서 사용하고 있습니다. (이 서버를 통상 A라고 칭하겠습니다.)

Mac OSX에서 A에 ssh로 접속을 해서 emacs (version 21.4.1) 를 터미널에서 구동시키고 emacs 내에서 계산용 프로그램(R-2.4.1)을 사용하고 있습니다.

지금 문제는 두가지가 발생했습니다.

1. 터미널에서는 한글입출력이 되지만, emacs에서 한글 입출력이 제대로 되지 않는다. (terminal 에서도, X에서도 제대로 되지 않습니다.) -> 이게 emacs에서 사용하는 한글 폰트를 설정하지 않아서 그런건지요? 그렇다면 어떻게 설정을 할 수 있습니까?

2. TeX 문서를 mac에서 사용하는 Aquamacs emacs에서 읽어들였을 때는 메뉴에 LaTeX, TeX 등등이 떠서 C-c C-c 등의 명령으로 TeX문서를 컴파일 할 수 있었는데, 터미널로 A에 접속해서 emacs로 TeX 문서를 열었을 때는 이러한 메뉴가 뜨지 않아서 문서 컴파일이 약간 번거롭습니다. -> A 서버의 site-lisp 디렉토리에 mac 에서 쓰고 있는 Aquamacs emacs 의 site-lisp 디렉토리 이하의 모든 파일을 복사해 놓으면 이 문제가 해결이 될까요?

터미널에 접속해서 몇몇 설정파일은 다음과 같습니다.

$ echo $TERM
xterm-color

$ echo $LANG
ko_KR.UTF-8

~/.emacs 파일은 다음과 같습니다.
-------------------------------------------------------------------------------------------
(require 'paren)
(setq-default auto-fill-hook 'do-auto-fill)
(setq auto-mode-alist (cons '("\\.r\\'" . R-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.tex\\'" . tex-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.c\\'" . c-mode) auto-mode-alist))

(global-font-lock-mode 1)
(setq font-lock-maximum-decoration '((R-mode . 3)))
(setq font-lock-maximum-decoration '((tex-mode . 3)))
(setq font-lock-maximum-decoration '((c-mode . 3)))
(transient-mark-mode 1)

(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(case-fold-search t)
'(current-language-environment "UTF-8")
'(default-input-method "rfc1345")
'(global-font-lock-mode t nil (font-lock))
'(show-paren-mode t nil (paren))
'(transient-mark-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)

;; line number
(load-library "setnu.el")
(add-hook 'c-mode-hook 'turn-on-setnu-mode)
(add-hook 'text-mode-hook 'turn-on-setnu-mode)
(add-hook 'tex-mode-hook 'turn-on-setnu-mode)
(add-hook 'R-mode-hook 'turn-on-setnu-mode)

(setq make-backup-files t)
(setq version-control t)
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))
--------------------------------------------------------------------------------------

바쁘시겠지만 짬을 내주시면 고맙겠습니다.

sangu의 이미지

(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

참고 : http://www.emacswiki.org/cgi-bin/wiki/EmacsForMacOS#EmacsForMacOS9

arecibo의 이미지

(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

를 ~/.emacs에 추가했는데도 여전히 한글 입출력이 되지 않습니다.

어디가 문제인 건가요?

arecibo의 이미지

emacs-snapshot 을 설치했더니 모든 문제가 깔끔하게 해결이 되는군요.

감사합니다.

cinsk의 이미지

입출력이 깨져 보이는 buffer를 열고, M-x describe-coding-system 한 다음, 나오는 내용을 보여주시기 바랍니다.

아울러 emacs를 실행시키기 전 터미널에서 locale(1) 명령 실행 결과도 보여주시기 바랍니다.

--
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://www.cinsk.org/cfaqs/

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.