Emacs Chinese display and input, ECB Configuration

Source: Internet
Author: User
Tags autoload gtk dell laptop
Emacs Chinese display and input, ECB Configuration

Touch ~ /. Emacs

Add the following content to. emacs to correctly display GBK Chinese characters.
(Set-language-Environment 'Chinese-GB)
(Set-keyboard-coding-system 'euc-CN)
(Set-clipboard-coding-system 'euc-CN)
(Set-clipboard-coding-System "CN-gb-2312)
(Set-terminal-coding-system 'euc-CN)
(Set-buffer-file-coding-system 'euc-CN)
(Set-selection-coding-system 'euc-CN)
; (Set-selection-coding-system 'Chinese-iso-8bit-with-esc)
(Set-selection-coding-system 'CN-gb-2312)
(Set-default-coding-systems 'euc-CN)
(Setq locale-coding-system 'euc-CN)
(Modify-coding-system-alist 'process "*" 'euc-CN)
(Setq default-process-coding-System
'(EUC-CN. euc-CN ))
(Setq-default pathname-coding-system 'euc-CN)

You cannot enter Chinese characters, but you need to study them carefully.
Http://forum.ubuntu.org.cn/about13560-0-asc-0.html
Http://www.linuxsir.org/bbs/showthread.php? T = 275479

Follow the instructions below to try to install
Http://www.yuanma.org/data/2006/0622/article_907.htm
Before installation, delete Emacs 21 and the. emacs file. Then
Download emacs23 source code from the CVS repository in Tsinghua
CVS-D: pserver: anonymous@ftp.tsinghua.edu.cn/cvsroot co-r emacs-unicode-2-D emacs23

Cvs.savannah.gnu.org/emacs/emacs

The specific problems are as follows:
In configure emacs23, libpng cannot be found.
Found that the libpng12-0 has been installed with LibPNG,
This is used during running. Compiling the software requires the dev version,
Therefore, the libpng12-dev is installed again, configure, and it is no longer reported
Libpng cannot be found. It is reported that libgif-dev cannot be installed,
Because libgif0 needs to be installed to install libgif-Dev, the latter needs to unstall many things.
The Configure error indicates that libgif/libungif cannot be found. You can install either of them.
Libungif-Dev.
The Dell laptop is installed with libxt-Dev. libxpm libjpeg libpng libgif/libungif LibTIFF.

Make has a small error, saying that it is to be installed with make Bootstrap.
Make Bootstrap.
Installation Complete
Sudo make install
Make clean
In the command line window, enter
Emacs
The test can correctly display the GBK-Encoded chinese files, or use scim to enter Chinese characters.

Auctex available from http://www.gnu.org/software/auctex/download-for-unix.html
Download, decompress, configure, make, sudo make install, make clean
After installation ~ /. Add to Emacs
(Load "auctex. El" Nil T)
(Load "preview-latex.el" Nil T)
(Setq Tex-auto-save T)
(Setq Tex-Parse-self T)
(Setq-default Tex-master nil)
You can preview the Tex document in Emacs. Find the location where the auctex. El file is found to be
/Usr/local/share/Emacs/Site-lisp this should be the path that Emacs can find,
Any El files can be stored here in the future.
Download the color-theme.el in/usr/local/share/Emacs/Site-lisp.
The original Emacs 21 has
Tlu @ PKU-desktop:/usr/share/Emacs/Site-lisp $ ls
Autoconf cogre ECB latex-CJK-common xcs.pdf. El
Cedet-common debian-startup.el, Ede semantic
Cedet-contrib dictionaries-common eieio speedbar
You do not need to download these files.

ECB settings reference
Http://forum.ubuntu.org.cn/about18274.html&sid=224c5901e50cfa56c327c868a04fae39

Alt + X then input ECB-activate to run ECB.

. Emacs content

(Load "auctex. El" Nil T)
(Load "preview-latex.el" Nil T)
(Setq Tex-auto-save T)
(Setq Tex-Parse-self T)
(Setq-default Tex-master nil)
; Added
(Add-hook 'latex-mode-hook # 'latex-install-toolbar)
(Add-hook 'latex-mode-hook' turn-on-auto-fill)
(Add-hook 'latex-mode-call' turn-on-reftex)

; The following 10 rows are configured with cedet, which must be placed in front of the ECB Configuration
(Add-hook 'texinfo-mode-hook (lambda () (require 'SB-texinfo )))
(Load-file "/usr/share/Emacs/Site-lisp/cedet-Common/cedet. El ")
(Semantic-load-enable-code-helpers)
(Autoload 'speedbar-frame-mode "speedbar" "popup A speedbar frame" t)
(Autoload 'speedbar-get-Focus "speedbar" "Jump to speedbar frame" t)
(Define-key-after (lookup-key global-map [menu-bar tools])
[Speedbar]
'("Speedbar ".
Speedbar-frame-mode)
[Calendar])

; (Setq load-path (Cons "/usr/share/Emacs/Site-lisp/eieio" load-path ))
; (Setq load-path (Cons "/usr/share/Emacs/Site-lisp/semantic" load-path ))
; (Setq load-path (Cons "/usr/share/Emacs/Site-lisp/speedbar" load-path ))
; (Setq load-path (Cons "/usr/share/Emacs/Site-lisp/ECB" load-path ))
(Add-to-list 'Load-path "/usr/share/Emacs/Site-lisp/eieio ")
(Add-to-list 'Load-path "/usr/share/Emacs/Site-lisp/semantic ")
(Add-to-list 'Load-path "/usr/share/Emacs/Site-lisp/speedbar ")
(Add-to-list 'Load-path "/usr/share/Emacs/Site-lisp/ECB ")
(Require 'ecb)

; Disable startup information
(Setq inhibit-startup-message T)

; Disable audible alarms when an annoying error occurs
(Setq visible-bell T)

; When the cursor is near the mouse, let the mouse automatically open, do not block the line of sight
(Mouse-avoidance-mode 'animate)

; The following setting enables the cursor to display matching parentheses when pointing to a bracket. This is for the parentheses.
(Show-Paren-mode t)
(Setq show-Paren-style 'parentheses)

; Set the default mode to text instead of basic mode.
(Setq default-Major-mode 'text-mode)
(Add-hook 'text-mode-call' turn-on-auto-fill)

; Emacs color scheme. Choose tools> color theme from the menu to select the color you need.
(Require 'color-theme)
(Color-theme-dark-blue); select the color scheme of darkblue
; (Color-theme-GTK-ide)

(Defun my-indent-or-complete ()
"Hippie-expand at word end, indent otherwise"
(Interactive)
(If (looking-at "\> ")
(Hippie-expand nil)
(Indent-for-tab-command)
)
)
(Global-set-Key [(Tab)] 'my-indent-or-complete)
(Autoload 'Senator-try-expand-semantic "senator ")
(Setq hippe-expand-try-functions-list
'(Senator-try-expand-semantic
Try-expand-dabbrev
)
)

; Export to HTML highlighted
; (Require 'htmlize)

; Set the C language style to K & R
; (Add-hook 'C-mode-hook
; '(Lambda ()
; (C-set-style "K & R ")))

; Set C ++ style as stroustrup Style
(Add-hook 'C ++-mode-hook
'(Lambda ()
(C-set-style "stroustrup ")))

; ------------------------- Chinese setting --------------------------
; Setup GBK Environment
; Maybe it works for Emacs 21. Now, my notebook cannot display Chinese characters normally.
; If it doesn't work, you can set it to display my name.
; (Set-terminal-coding-system 'euc-CN)
; (Set-keyboard-coding-system 'euc-CN)
; (Set-language-Environment 'Chinese-GB)
; (Setq locale-coding-system 'utf-8)
; (Setq current-language-Environment "Chinese-GBK ")
; (Prefer-coding-system 'utf-8)

; ------------------------- Use the selection habits under Win ---------------
; Select with Shift + direction key
; (PC-selection-mode)

On the machine in the office, "hosts" is always not displayed correctly ".
Repeat
./Configure -- With-X-Toolkit = GTK
Make Bootstrap
Make install

-- With-X-Toolkit = GTK makes the menu options of Emacs much more beautiful and easy to choose.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.