Emacs config

来自 ChinaUnix Wiki

;; emacs native setup
;; for linux environment only.
(global-font-lock-mode t)
(auto-image-file-mode)
(setq-default default-directory "~")
(setq inhibit-startup-message t)
(setq column-number-mode t)
(setq default-fill-column 60)
(setq sentence-end "\\([�$)A�!##!#?�]\\|�!-!-�\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")
(setq sentence-end-double-space nil)
;;
(setq scroll-step 1
     scroll-margin 3
     scroll-conservatively 10000)
(setq default-major-mode 'text-mode)
(show-paren-mode t)
(setq show-paren-style 'parentheses)
(mouse-avoidance-mode 'animate)
(setq frame-title-format "[%b]")
;;
(set-default-font "7x13")
(set-scroll-bar-mode 'right)
(blink-cursor-mode 0)
;; chinese environment setting
(set-language-environment 'Chinese-GB)
(set-buffer-file-coding-system 'chinese-iso-8bit)
(set-keyboard-coding-system 'chinese-iso-8bit)
(set-terminal-coding-system 'chinese-iso-8bit)
(setq-default enable-multibyte-characters t)
(prefer-coding-system 'gb2312)
(set-selection-coding-system 'gb2312) 
;;
;; interface setup
;; (setq menu-bar-mode 1)
;; (setq tool-bar-mode 1)
;;
;; irc chat setup
(autoload 'irchat "irchat" "Irchat" t)
(setq irchat-name "tester")
(setq irchat-pj-use-smiley nil)
;;
(setq irchat-server-alist
      '(("freenode" . "irc.freenode.net")
	("linuxfans" . "211.92.88.40")
	("starchat" . "irc.linuxfans.org")
	("gimp"  .   "irc.gimp.org")
	("sunnet" .  "irc.sunnet.org")))
;;
;; (add-hook 'irchat-command-mode-hook
;;	  '(lambada ()
;;		    (font-lock-mode 0)))
;;
(setq irchat-server "irc.gnu.org")
(setq irchat-service 6667)
(setq irchat-pj-startup-nickname-list '("myname" "my2" "my3"))
(setq irchat-nickname "myname")
;; (setq irchat-startup-channel "linux")
;; (setq irchat-pj-cs-8bit-coding-system 'gb2312)
(setq irchat-pj-string-in-code 'auto-detect)
(setq irchat-pj-string-out-code 'auto-detect)
;; (setq irchat-pj-katakana-convert t)
(setq irchat-pj-code-verbose nil)
(setq irchat-default-freeze-local nil)
(setq irchat-signoff-msg "gone with c-x k")
;; (setq irchat-pj-cs-encode 'gb2312)
;; (setq string-to-encode 'euc-cn)
;; (setq string-to-decode 'euc-cn
;; (setq pure-cs-default-coding-system 'gb2312)
;;
;; W3m setup
(autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
(require 'mime-w3m)
;; (require 'mew-w3m)
;; (setq mew-prog-html '(mew-mime-text/html-w3m nil nil))
(require 'w3m)
(require 'octet)
(octet-mime-setup)
;;
; w3m
(setq w3m-command-arguments '("-cookie" "-F"))
(setq w3m-use-cookies t)
(setq w3m-home-page "http://www.linux.com")
(require 'mime-w3m)
(setq w3m-default-display-inline-image t)
(setq w3m-default-toggle-inline-images t)
;;
(setq url-proxy-services '( 
			   ("http" . "210.179.237.253:8080") 
			   ("no_proxy" . "://localhost")) 
      url-using-proxy t)
;; (setq w3m-arrived-file-coding-system 'cn-gb-2312)
;; (setq w3m-bookmark-file-coding-system 'cn-gb-2312)
;; (setq w3m-default-url-coding-system 'cn-gb-2312)
;; (setq w3m-output-coding-system 'cn-gb-2312)
;; (setq w3m-coding-system 'cn-gb-2312)
;; (setq w3m-input-coding-system 'cn-gb-2312)
;; (setq w3m-find-coding-system 'cn-gb-2312)
;; (setq w3m-default-coding-system 'cn-gb-2312)
;; (setq w3m-coding-system-priority-list '(cn-gb-2312))
;; (setq w3m-file-name-coding-system 'cn-gb-2312)
;; (setq w3m-bookmark-file-coding-system 'cn-gb-2312) 
;;
;; gnus setup
(setq user-mail-address "gnuisv@hotpop.com")
(setq user-full-name "gnuisv")
;;
;; pop setup
(setq mail-sources '((pop :server "pop.hotpop.com" :user "foo@hotpop.com" :password "foo")))
;;
;; smtp
(load "smtpmail")
(setq smtpmail-default-smtp-server "smtp.hotpop.com")
(setq smtpmail-smtp-service 25)
(setq smtpmail-local-domain nil)
(setq smtpmail-sendto-domain nil)
(setq smtpmail-debug-info t)
(setq smtpmail-auth-login-username "foo@hotpop.com")
(setq smtpmail-smtp-server "smtp.hotpop.com")
(setq smtp-server "smtp.hotpop.com")
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-auth-login-username "foo@hotpop.com")
(setq smtpmail-auth-credentials '(("smtp.hotpop.com" 25 "foo" "foo")))
;;
;; nntp setup
(setq gnus-select-method '(nntp "news.cn99.com"))
(setq gnus-secondary-select-methods '((nnml "")))
;;
(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 "Chinese-GB")
 '(default-input-method "chinese-py-punct")
 '(global-font-lock-mode t nil (font-lock)))
(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.
 )
;; emacs interface
(add-to-list 'default-frame-alist '(tool-bar-lines . 0))
(add-to-list 'default-frame-alist '(menu-bar-lines . 0))
;;
(setq visible-bell t)
;;
(setq display-time-24hr-format t)
;;
(display-time)
个主工具