summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs68
-rw-r--r--emacs-win322
-rw-r--r--emacs.d/lisp/setup-erc.el90
3 files changed, 153 insertions, 7 deletions
diff --git a/emacs b/emacs
index 63b030c..ab0575f 100644
--- a/emacs
+++ b/emacs
@@ -8,7 +8,7 @@
;; font setting
(set-frame-font "Bitstream Vera Sans Mono-9")
(set-fontset-font (frame-parameter nil 'font)
- 'han '("Microsfot Yahei" . "unicode-bmp"))
+ 'han '("Microsoft Yahei" . "unicode-bmp"))
;; window positioning
(setq default-frame-alist '((top . 0) (left . 0)
@@ -28,14 +28,67 @@
(require 'cedet)
(require 'ecb)
(semantic-load-enable-code-helpers)
-(require 'semanticdb)
-;;(global-semanticdb-minor-mode 1)
(require 'semantic-ia)
(global-set-key [(control p)] 'semantic-ia-complete-symbol-menu)
(global-semantic-show-unmatched-syntax-mode -1)
-(require 'semantic-load)
-;;(global-semantic-idle-completions-mode 1)
-
+(require 'ede)
+(global-ede-mode t)
+
+;; c & c++
+(semantic-add-system-include "/usr/include" 'c-mode)
+(semantic-add-system-include "/usr/include" 'c++-mode)
+
+;; qt4
+(setq qt4-base-dir "/usr/include/qt4")
+(setq qt4-gui-dir (concat qt4-base-dir "/QtGui"))
+(semantic-add-system-include qt4-base-dir 'c++-mode)
+(semantic-add-system-include qt4-gui-dir 'c++-mode)
+(add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode))
+(add-to-list 'semantic-lex-c-preprocessor-symbol-file
+ (concat qt4-base-dir "/Qt/qconfig.h"))
+(add-to-list 'semantic-lex-c-preprocessor-symbol-file
+ (concat qt4-base-dir "/Qt/qconfig-large.h"))
+(add-to-list 'semantic-lex-c-preprocessor-symbol-file
+ (concat qt4-base-dir "/Qt/qglobal.h"))
+
+;; sexy app framework
+(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("SEXY_EXPORT" . ""))
+
+;; cairo
+(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("cairo_public" . ""))
+(setq cairo-basedir "/usr/include/cairo")
+(semantic-add-system-include cairo-basedir 'c-mode)
+(semantic-add-system-include cairo-basedir 'c++-mode)
+
+;; glib-2.0
+(setq glib2-basedir "/usr/include/glib-2.0")
+(setq glib2-config "/usr/lib/glib-2.0/include/glibconfig.h")
+(add-to-list 'semantic-lex-c-preprocessor-symbol-file glib2-config)
+(semantic-add-system-include glib2-basedir 'c-mode)
+(semantic-add-system-include glib2-basedir 'c++-mode)
+
+;; pango-1.0
+(setq pango-basedir "/usr/include/pango-1.0")
+(semantic-add-system-include pango-basedir 'c-mode)
+(semantic-add-system-include pango-basedir 'c++-mode)
+
+;; gtk-2.0
+(setq gtk2-basedir "/usr/include/gtk-2.0")
+(setq gtk2-config "/usr/lib/gtk-2.0/include/gdkconfig.h")
+(add-to-list 'semantic-lex-c-preprocessor-symbol-file gtk2-config)
+(semantic-add-system-include gtk2-basedir 'c-mode)
+(semantic-add-system-include gtk2-basedir 'c++-mode)
+
+;; vala
+(autoload 'vala-mode "vala-mode" "Major mode for editing Vala code." t)
+(require 'vala-mode)
+(add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
+(add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
+(add-to-list 'file-coding-system-alist '("\\.vala$" . utf-8))
+(add-to-list 'file-coding-system-alist '("\\.vapi$" . utf-8))
+
+;; for ecb
+(add-hook 'vala-mode-hook #'wisent-csharp-default-setup)
;; set color theme if emacs is windowed
(require 'color-theme)
@@ -129,6 +182,9 @@
;; setup auto-complete-mode
(require 'setup-auto-complete)
+;; erc
+(require 'setup-erc)
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/emacs-win32 b/emacs-win32
index e11c3d4..2343bc2 100644
--- a/emacs-win32
+++ b/emacs-win32
@@ -8,7 +8,7 @@
;; font setting
(set-frame-font "Bitstream Vera Sans Mono-9")
(set-fontset-font (frame-parameter nil 'font)
- 'han '("Microsfot Yahei" . "unicode-bmp"))
+ 'han '("Microsoft Yahei" . "unicode-bmp"))
;; window positioning
(setq default-frame-alist '((top . 0) (left . 0)
diff --git a/emacs.d/lisp/setup-erc.el b/emacs.d/lisp/setup-erc.el
new file mode 100644
index 0000000..1bfcc97
--- /dev/null
+++ b/emacs.d/lisp/setup-erc.el
@@ -0,0 +1,90 @@
+;;; setup-erc.el --- setup-erc
+
+;; Copyright (C) 2010 Luo Jinghua <sunmoon1997@gmail.com>
+
+;; Author: Luo Jinghua <sunmoon1997@gmail.com>
+;; Keywords: erc
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(custom-set-variables
+ '(erc-modules (quote (autojoin button completion
+ fill irccontrols match menu netsplit noncommands readonly ring
+ services smiley sound stamp spelling track))))
+(custom-set-faces)
+
+(server-start)
+(erc :server "irc.freenode.net" :port 6667 :nick "sunmoon1997" :full-name "Luo.Jinghua" )
+
+(require 'erc-services)
+(erc-services-mode 1)
+(setq erc-prompt-for-nickserv-password nil)
+(setq erc-nickserv-passwords
+ '((freenode (("sunmoon1997" . "")))))
+
+
+(require 'erc-join)
+(erc-autojoin-mode t)
+(setq erc-autojoin-channels-alist
+ '( ("freenode.net" "#ppmm" "#cairo" "#dri-devel" "#ubuntu-cn")))
+
+;;(setq erc-sound-path '("~/.emacs.d/sound"))
+;;(setq erc-play-command "aplay")
+
+;;(add-hook 'erc-text-matched-hook
+;;(lambda (match-type nickuserhost message)
+;; (cond
+;; ((eq match-type 'current-nick)
+;; (play-sound-file "~/.emacs.d/sound/receive.wav"))
+;; ((eq match-type 'keyword)
+;; (play-sound-file "~/.emacs.d/sound/send.wav")))))
+
+(defun erc-cmd-OPME ()
+ "request a chanop op to me"
+ (erc-message "PRIVMSG"
+ (format "chanserv op %s"
+ (erc-default-target)
+ (erc-current-nick)) nil))
+
+(defun erc-cmd-UNOPME ()
+ "Deop myself from current channel"
+ (erc-cmd-DEOP (format "%s" (erc-current-nick))))
+
+;;;enable spelling check
+(erc-spelling-mode 1)
+
+;;;enable emotion symbol
+(require 'smiley)
+ (add-to-list 'smiley-regexp-alist '("\\(:-?]\\)\\W" 1 "forced"))
+ (add-to-list 'smiley-regexp-alist '("\\s-\\(:-?/\\)\\W" 1 "wry"))
+ (add-to-list 'smiley-regexp-alist '("\\(:-?(\\)\\W" 1 "sad"))
+ (add-to-list 'smiley-regexp-alist '("\\((-?:\\)\\W" 1 "reverse-smile"))
+ (add-to-list 'smiley-regexp-alist '("\\(:-?D\\)\\W" 1 "grin"))
+ (add-to-list 'smiley-regexp-alist '("\\(:-?P\\)\\W" 1 "poke"))
+
+(setq erc-auto-query 'buffer)
+
+(add-hook 'erc-after-connect
+ (lambda (server nick)
+ (add-hook 'erc-server-NOTICE-hook 'erc-auto-query)))
+
+
+(provide 'setup-erc)
+;;; setup-erc.el ends here