;; -*- coding: utf-8 -*- ;; A collection of generic Emacs settings ;; 2007-06, 2011-06-12 ;; Xah Lee ;; ∑ http://xahlee.org/ ;; § ---------------------------------------- ;; set Unicode data file location. (used by what-cursor-position and describe-char) (let ((x "~/web/xahlee_org/emacs/UnicodeData.txt")) (when (file-exists-p x) (setq describe-char-unicodedata-file x))) ;; § ---------------------------------------- ;; ; make backup to a designated dir, mirroring the full path ;; (defun my-backup-file-name (fpath) ;; "Return a new file path of a given file path. ;; If the new path's directories does not exist, create them." ;; (let (backup-root bpath) ;; (setq backup-root "~/.emacs.d/emacs-backup") ;; (setq bpath (concat backup-root fpath "~")) ;; (make-directory (file-name-directory bpath) bpath) ;; bpath ;; ) ;; ) ;; (setq make-backup-file-name-function 'my-backup-file-name) ;; § ---------------------------------------- ;; (defun turn-spell-checking-on () ;; "Turn speck-mode or flyspell-mode on." ;; (speck-mode 1) ;; ; (flyspell-mode 1) ;; ) ;; (add-hook 'text-mode-hook 'turn-spell-checking-on) ;; (remove-hook 'text-mode-hook 'turn-spell-checking-on) ;; § ---------------------------------------- ;; 2009-09-29 see http://groups.google.com/group/ergoemacs/msg/9eec3b455cab3ff1 and http://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start ; (and (= emacs-major-version 23) (defun server-ensure-safe-dir (dir) "Noop" t)) ;; (add-hook 'emacs-lisp-mode-hook ;; (lambda () ;; (modify-syntax-entry ?- "w" emacs-lisp-mode-syntax-table ) ;; ) ;; ) ;; by Nikolaj Schumacher. http://www.emacswiki.org/emacs/HexColour (defvar hexcolor-keywords '(("#[abcdef[:digit:]]\\{6\\}" (0 (put-text-property (match-beginning 0) (match-end 0) 'face (list :background (match-string-no-properties 0))))))) (defun hexcolor-add-to-font-lock () (interactive) (font-lock-add-keywords nil hexcolor-keywords)) (add-hook 'css-mode-hook 'hexcolor-add-to-font-lock) ;; § ---------------------------------------- ;; things that needs special modules ; tabbar mode problems ; (autoload 'tabbar-mode "tabbar" "Show tab bars." t) ; (tabbar-mode 1) ; (remove-hook 'kill-buffer-hook 'tabbar-buffer-track-killed) ;; make all buffers show as tabs ;;(setq tabbar-buffer-groups-function (lambda (buffer) (list "All buffers"))) ;; (defun xah-tabbar-buffer-groups () ;; "Return the list of group names the current buffer belongs to. ;; This function is a custom function for tabbar-mode's tabbar-buffer-groups. ;; This function group all buffers into 3 groups: ;; Those Dired, those user buffer, and those emacs buffer. ;; Emacs buffer are those starting with “*”." ;; (list ;; (cond ;; ((string-equal "*" (substring (buffer-name) 0 1)) ;; "Emacs Buffer" ;; ) ;; ((eq major-mode 'dired-mode) ;; "Dired" ;; ) ;; (t ;; "User Buffer" ;; ) ;; ))) ;; (setq tabbar-buffer-groups-function (quote xah-tabbar-buffer-groups)) ;; when closing a tab, show the last opened buffer, instead of the neighboring tab. ; (remove-hook 'kill-buffer-hook 'tabbar-buffer-track-killed) ; '(tabbar-default-face ((t (:inherit variable-pitch :background "gray72" :foreground "blue" :height 0.8)))) ; '(tabbar-selected-face ((t (:inherit tabbar-default-face :background "bisque" :foreground "blue" :box (:line-width 2 :color "white" :style released-button))))) ;; '(tabbar-cycle-scope (quote tabs)) ;; '(tabbar-mode t nil (tabbar)) ;; § ---------------------------------------- ;; (setq word-wrap t) ;; (setq line-moveline-move-visual t) ;; § ---------------------------------------- ;; spacing (setq-default indent-tabs-mode nil) ; emacs 23.1 default is t (setq tab-width 2) ; width for display tabs. emacs 23.1 default is 8 ;; § ---------------------------------------- (put 'narrow-to-region 'disabled nil) (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) (put 'erase-buffer 'disabled nil) (put 'scroll-left 'disabled nil) (put 'dired-find-alternate-file 'disabled nil) ;; § ---------------------------------------- (when (boundp 'tabbar-mode) (tabbar-mode 0)) (cua-mode 0) (delete-selection-mode 1) (setq org-startup-folded nil) (set-default-coding-systems 'utf-8-unix) ;; § ---------------------------------------- ;; default frame (setq default-frame-alist '((menu-bar-lines . 1) (left-fringe) (right-fringe) (tool-bar-lines . 0) (width . 100) (height . 50) )) ;; (setcdr (assq 'continuation fringe-indicator-alist) '(nil right-curly-arrow)) (setq initial-frame-alist '((width . 100) (height . 50))) (set-background-color "honeydew") ;; § ---------------------------------------- (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. '(abbrev-mode t) '(ange-ftp-try-passive-mode nil) '(auto-save-default nil) '(blink-cursor-mode nil) '(case-fold-search t) '(comment-column 2) '(describe-char-unidata-list (quote (name old-name general-category canonical-combining-class bidi-class decomposition decimal-digit-value digit-value numeric-value mirrored iso-10646-comment uppercase lowercase titlecase))) '(dictionary-default-dictionary "web1913") '(dictionary-default-popup-strategy "lev") '(dictionary-use-single-buffer t) '(ffap-newfile-prompt t) '(font-lock-maximum-decoration 2) '(fringe-mode nil nil (fringe)) '(indicate-empty-lines nil) '(initial-major-mode (quote text-mode)) '(initial-scratch-message "") '(line-number-display-limit-width 500) '(menu-bar-mode t) '(minibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))) '(mode-require-final-newline nil) '(mouse-buffer-menu-mode-mult 4) '(pov-run-high "+R2 +A0.1 +J1.2 +Am2 +Q9 +H480 +W640 +i%s") '(recentf-exclude (quote ("/ftp"))) '(recentf-max-menu-items 11) '(recentf-max-saved-items 31) '(report-emacs-bug-no-confirmation t) '(report-emacs-bug-no-explanations t) '(scalable-fonts-allowed t) '(show-paren-mode t) '(speck-engine (quote Hunspell)) '(speck-hunspell-language-options (quote (("da" utf-8 nil t nil) ("de" iso-8859-1 nil t nil) ("en" utf-8 nil nil nil) ("fr" iso-8859-1 nil nil nil) ("it" iso-8859-1 nil nil nil) ("ru" koi8-r nil nil nil)))) '(tool-bar-mode nil nil (tool-bar)) '(user-full-name "Xah Lee") '(user-mail-address "xah@xahlee.org") '(w32shell-add-emacs-to-path t) '(w32shell-cygwin-bin "C:\\cygwin\\bin") '(w32shell-msys-bin "C:\\msys\\1.0\\bin") '(w32shell-shell (quote cygwin)) '(w3m-user-agent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6") '(weblogger-server-password "") '(weblogger-server-url "http://www.blogger.com/") '(weblogger-weblog-id -1) '(xlsl-mode-format-style 1) '(xlsl-reference-url "http://lslwiki.net/lslwiki/wakka.php?wakka="))