emacs 中文配置去掉乱码

来源:互联网 发布:相片mv制作软件 编辑:程序博客网 时间:2024/04/30 22:16
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(TeX-output-view-style (quote (("^dvi$nnnnnnn" ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$") "%(o?)dvips -t landscape %d -o && gv %f") ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "%(o?)dvips %d -o && gv %f") ("^dvi$" ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$") "%(o?)xdvi %dS -paper a4r -s 0 %d") ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "%(o?)xdvi %dS -paper a4 %d") ("^dvi$" ("^a5\\(?:comb\\|paper\\)$" "^landscape$") "%(o?)xdvi %dS -paper a5r -s 0 %d") ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d") ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d") ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d") ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d") ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d") ("^dvi$" "." "%(o?)xdvi %dS %d") ("^pdf$" "." "acroread %o %(outpage)") ("^html?$" "." "netscape %o"))))
 '(cua-mode t nil (cua-base))
 '(current-language-environment "Chinese-GB")
 '(ecb-layout-window-sizes nil)
 '(ecb-options-version "2.32")
 '(ecb-source-path (quote (("/" "/") "/home/owner/fpxl138May2011/fpx_uboot/u-boot/board/davinci/sffsdr"))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

;; Load CEDET
(load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el")
(semantic-load-enable-semantic-debugging-helpers)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/ecb")
(require 'ecb)
;; fpx exit Emacs Shell Configuraiotn
(add-hook 'shell-mode-hook 'wcy-shell-mode-hook-func)
(defun wcy-shell-mode-hook-func  ()
  (set-process-sentinel (get-buffer-process (current-buffer))
                            #'wcy-shell-mode-kill-buffer-on-exit)
      )
(defun wcy-shell-mode-kill-buffer-on-exit (process state)
  (message "%s" state)
  (if (or
       (string-match "exited abnormally with code.*" state)
       (string-match "finished" state))
      (kill-buffer (current-buffer))))

;; (require 'cc-mode)
 (load-file "/usr/share/emacs/site-lisp/xcscope.el")
 (require 'xcscope)
;;             C  mode
(add-hook 'c-mode-hook 'hs-minor-mode)
(defun my-c-mode-auto-pair ()
  (interactive)
  (make-local-variable 'skeleton-pair-alist)
  (setq skeleton-pair-alist  '(
    (?` ?` _ "''")
    (?\( ?  _ " )")
    (?\[ ?  _ " ]")
    (?{ \n > _ \n ?} >)))
  (setq skeleton-pair t)
  (local-set-key (kbd "(") 'skeleton-pair-insert-maybe)
  (local-set-key (kbd "{") 'skeleton-pair-insert-maybe)
  (local-set-key (kbd "`") 'skeleton-pair-insert-maybe)
  (local-set-key (kbd "[") 'skeleton-pair-insert-maybe))
(add-hook 'c-mode-hook 'my-c-mode-auto-pair)


    (add-hook 'LaTeX-mode-hook (lambda()
                                  (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
                                  (setq TeX-command-default "XeLaTeX")
                                     (setq TeX-save-query  nil )
                                      (setq TeX-show-compilation t)
                                                                   ))

;; AUCTeX
(defun auctex ()
  (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t; %`xelatex%(mode)%' %t" TeX-run-TeX nil t)) ;; 这里我编译了两次
    (setq TeX-command-default "XeLaTeX") ;; 设定默认编译命令为XeLaTeX
    (setq TeX-save-query nil)            ;; 保存之前不询问
    (setq TeX-show-compilation t))       ;; 在新窗口显示编译过程
(add-hook 'LaTeX-mode-hook 'auctex)




 (defun my-latex-mode-hook ()
      (add-to-list 'TeX-command-list
                   '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
      (setq TeX-command-default
            (save-excursion
              (save-restriction
                (widen)
                (goto-char (point-min))
                (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\\)?"
                                  "{.*\\<\\(?:font\\|math\\)spec\\>.*}")))
                  (if (re-search-forward re 3000 t)
                      "XeLaTeX"
                    "LaTeX"))))))



(defvar font-list '("Microsoft Yahei" "文泉驿等宽微米黑" "黑体" "新宋体" "宋体"))
(require 'cl) ;; find-if is in common list package
(find-if #'qiang-font-existsp font-list)
原创粉丝点击