;-*- coding: utf-8 -*- ; A collection of generic Emacs settings ; 2007-06 ; Xah Lee ; ∑ http://xahlee.org/ ;----------------------------------- ;; (add-hook 'emacs-lisp-mode-hook ;; (lambda () ;; (modify-syntax-entry ?- "w" emacs-lisp-mode-syntax-table ) ;; ) ;; ) ;; (setq initial-frame-alist '((top . 0))) (setq initial-frame-alist '((top . 1) (right . 1) (width . 80) (height . 45))) (show-paren-mode t) (setq show-paren-style 'expression) ;(setq line-spacing 3) ;(blink-cursor-mode 1) (set-cursor-color "red") (setq cursor-type 'bar) (set-background-color "honeydew") ;;; ------------------- ;;;; backup ; 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) (setq backup-by-copying t) (setq-default indent-tabs-mode nil) (setq default-tab-width 2) ; (defalias 'perl-mode 'cperl-mode) ; always use cperl mode ;(add-to-list 'auto-mode-alist '("\\.cgi\\'" . cperl-mode)) (add-to-list 'auto-mode-alist '("\\.JPG\\'" . image-mode)) ; turn on some modes by default ;(add-hook 'text-mode-hook (lambda () (flyspell-mode 1) (longlines-mode 1) )) ;(add-hook 'before-save-hook 'time-stamp) ;;;; ------------------------- ; things that needs special modules ; make a Open Recent menu under File menu (require 'recentf) (recentf-mode 1) ; for htmlize.el (setq htmlize-convert-nonascii-to-entities nil) (setq htmlize-html-charset "utf-8") ; desktop is preinstalled on on Carbon Emacs ; save opened files every 10 min. So in case of system crash... (run-with-timer 600 600 'desktop-save "~/") ;(add-hook 'find-file-hook (lambda () (run-with-timer 5 nil 'desktop-save "~/"))) ; 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)) (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) (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) '(case-fold-search t) '(current-language-environment "UTF-8") '(custom-file "~/web/emacs/xah_emacs_settings.el") '(default-input-method "latin-1-prefix") '(delete-selection-mode t) '(desktop-load-locked-desktop t) '(desktop-save t) '(desktop-save-mode t) '(dictionary-default-dictionary "web1913") '(dictionary-default-popup-strategy "lev") '(dictionary-use-single-buffer t) '(dired-dwim-target t) '(dired-recursive-copies (quote always)) '(dired-recursive-deletes (quote top)) '(ffap-newfile-prompt t) '(font-lock-maximum-decoration 2) '(indicate-empty-lines t) '(inhibit-startup-screen t) '(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 t) '(mouse-buffer-menu-mode-mult 4) '(mouse-scroll-min-lines 1) '(mouse-wheel-progressive-speed nil) '(mouse-wheel-scroll-amount (quote (2 ((shift) . 1) ((control))))) '(pov-run-high "+R2 +A0.1 +J1.2 +Am2 +Q9 +H480 +W640 +i%s") '(rcirc-default-nick "hiff") '(rcirc-default-user-full-name "hiff") '(rcirc-default-user-name "hiff") '(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) '(tool-bar-mode nil nil (tool-bar)) '(transient-mark-mode t) '(user-full-name "Xah Lee") '(user-mail-address "xah@xahlee.org") '(xlsl-lslint-path "/Users/xah/bin/lslint") '(xlsl-reference-url "http://lslwiki.net/lslwiki/wakka.php?wakka=")) (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. '(show-paren-match ((((class color) (background light)) (:background "azure2"))))) ;; for compatibility with older Aquamacs versions (defvar aquamacs-140-custom-file-upgraded t) (unless (fboundp 'auto-detect-longlines) (defun auto-detect-longlines () t))