;; (width . 108) (height . 65) ;; ;; Emacs startup File ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Miscellaneous variables ;; key bindings that work well with Dvorak keyboard (global-set-key "\C-f" 'previous-line) (global-set-key "\C-b" 'next-line) (global-set-key "\C-t" 'backward-char) (global-set-key "\C-n" 'forward-char) (global-set-key "\M-t" 'backward-word) (global-set-key "\M-n" 'forward-word) (global-set-key "\M-u" 'upcase-prev-word) (global-set-key "\M--" 'goto-line) ;(global-set-key "\M-c" 'end-of-buffer-other-window) (global-set-key [M-up] '(lambda () (interactive) (scroll-other-window-down 1))) (global-set-key [M-down] '(lambda () (interactive) (scroll-other-window 1))) (global-set-key "\M-c" 'next-error) (global-set-key [home] 'beginning-of-buffer) (global-set-key [end] 'end-of-buffer) ;; Scroll buffer without moving the cursor (global-set-key "\M-f" '(lambda () (interactive) (scroll-down 1))) (global-set-key "\M-b" '(lambda () (interactive) (scroll-up 1))) ;; Record the position of the cursor to register 't' and then find-tag (global-set-key "\M-." '(lambda () (interactive) (point-to-register t) (find-tag (find-tag-default)))) ;; Go to the next definition of a tag ;; This overrides 'forward-sentence' (global-set-key "\M-p" '(lambda () (interactive) (find-tag nil t))) ;; Go to the last recorded position of the cursor in register 't' (global-set-key "\C-p" '(lambda () (interactive) (register-to-point t))) (global-set-key "\M-\C-t" 'toggle-truncate-lines) (global-set-key "\M-\C-f" 'backward-sexp) (global-set-key "\M-\C-b" 'forward-sexp) ;;(global-set-key "\C-x\M-e" 'svn-file-show-svn-ediff) (global-set-key "\C-x\M-e" 'ediff-revision) (global-set-key [C-return] 'open-line) (global-set-key [?\C-\;] '(lambda () (interactive) (insert-char ?\; 1))) ;; (global-set-key "\C-p" '(lambda () (interactive) (insert &rest \;) ;; (open-line))) ;;(global-set-key [menu] 'beginning-of-line) ;; \M-n works the same for Ali even in the minibuffer (define-key minibuffer-local-completion-map "\M-n" 'forward-word) (define-key minibuffer-local-isearch-map "\M-n" 'forward-word) (define-key minibuffer-local-map "\M-n" 'forward-word) (define-key minibuffer-local-must-match-map "\M-n" 'forward-word) (define-key minibuffer-local-ns-map "\M-n" 'forward-word) ;; This variable is not present at startup: (require 'make-mode) (define-key makefile-mode-map "\M-n" 'forward-word) ;; don't center when point moves out of view (setq scroll-step 20) ;; Mode line setup (setq display-time-24hr-format t) (display-time) (setq line-number-mode t) (setq column-number-mode t) (setq visible-bell t) (setq inhibit-startup-message t) (put 'narrow-to-region 'disabled nil) (modify-frame-parameters nil '((wait-for-wm . nil))) ; (defvar default-load-path load-path ; "Standard places to look for lisp files. See load-path.") ; (setq load-path (append (list ; "/usr/local/share/emacs/site-lisp" ; "~/lisp" ; "~/lisp/emacs-lisp" ; "~/lisp/emulation" ; "~/lisp/gnus" ; "~/lisp/international" ; "~/lisp/language" ; "~/lisp/mail" ; "~/lisp/play" ; "~/lisp/progmodes" ; "~/lisp/term" ; "~/lisp/textmodes" ; ) ; default-load-path)) (setq auto-mode-alist '(("[-\\.]info$" . info-mode) ("\\.c\\'" . c-mode) ("\\.cpp\\'" . c++-mode) ("\\.cxx\\'" . c++-mode) ("\\.h\\'" . c-mode) ("\\.hpp\\'" . c++-mode) ("\\.tex\\'" . TeX-mode) ("\\.el\\'" . emacs-lisp-mode) ("\\.pl\\'" . perl-mode) ("\\.sty\\'" . LaTeX-mode) ("\\.bbl\\'" . LaTeX-mode) ("\\.bib\\'" . bibtex-mode) ("\\.texinfo\\'" . texinfo-mode) ("\\.texi\\'" . texinfo-mode) ("\\.awk\\'" . awk-mode) ("\\.tar\\'" . tar-mode) ("\\.y\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.m$" . objc-mode) ("\\.C$" . c++-mode) ("\\.cc$" . c++-mode) ("\\.hh$" . c++-mode) ("[]>:/]\\..*emacs\\'" . emacs-lisp-mode) ("Makefile" . makefile-mode) ("makefile" . makefile-mode) ("\\.mk\\'" . makefile-mode) ("\\.mak\\'" . makefile-mode) ("\\.scm\\'" . scheme-mode) ("\\.py$" . python-mode) ("\\.diff" . diff-mode) ("\\.sgml" . sgml-mode) ("\\.xml" . xml-mode) ("\\.sh" . shell-script-mode) )) (setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist)) ;; Customize auto-save interval (setq auto-save-interval 2000) (setq auto-save-timeout 120) ;; Save last location in all files between sessions (load "saveplace") (setq-default save-place t) ;; The ID database functions (autoload 'gid "gid" "ID Database functions" t) ;; C Mode stuff (autoload 'c++-mode "cc-mode" "C++ Editing Mode" t) (autoload 'c-mode "cc-mode" "C Editing Mode" t) (autoload 'python-mode "python-mode" "Python Editing Mode" t) (defconst my-c-style '((c-tab-always-indent . nil) (c-comment-only-line-offset . 4) ; (c-hanging-braces-alist . ((brace-list-open))) (c-hanging-colons-alist . ((member-init-intro before) (inher-intro) (case-label after) (label after) (access-label after))) (c-cleanup-list . (scope-operator empty-defun-braces brace-else-brace brace-elseif-brace defun-close-semi)) (c-basic-offset . 4) (c-hanging-comment-ender-p . nil) (c-offsets-alist . ((arglist-close . c-lineup-arglist) (inline-open . 0) (substatement-open . 0) (comment-intro . 0) (block-open . 0) (label . -1000) (statement-cont . c-lineup-math) (knr-argdecl-intro . -))) (c-echo-syntactic-information-p . t) ) "My C Programming Style") ;; Customizations for all of c-mode, c++-mode, and objc-mode (defun my-c-mode-common-hook () ;; add my personal style and set it for the current buffer (c-add-style "PERSONAL" my-c-style t) ;; offset customizations not in my-c-style (c-set-offset 'member-init-intro '+) (c-set-offset 'innamespace -1) (c-set-offset 'func-decl-cont 0) ;; other customizations (setq ; Commenting out per Riverbed coding standards ; tab-width 4 ;; this will make sure spaces are used instead of tabs indent-tabs-mode nil) ;; we like auto-newline and hungry-delete (c-toggle-auto-hungry-state 1) ;; keybindings for all supported languages. We can put these in ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map, ;; java-mode-map, and idl-mode-map inherit from it. (define-key c-mode-base-map "\C-m" 'newline-and-indent) ) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (set-default `indent-tabs-mode nil) ;;(setq-default case-fold-search nil) (setq dabbrev-case-fold-search nil) (mouse-avoidance-mode 'animate) (show-paren-mode t) (setq search-highlight t) ;; Compilation Stuff ;(global-set-key "\C-c\C-c" 'compile) ;(global-set-key "\C-c\C-g" 'grep) (setq grep-command "grep -n -r -e ") ;(setq compile-command '("make -C " . 9)) (setq compilation-ask-about-save nil) ;(setq compilation-finish-function 'compilation-buffer-goto-end) ;(setq compilation-finish-function 'next-error) (require 'compile) (add-to-list 'compilation-error-regexp-alist '("^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|.\\|warnin\\(g\\)\\|remar\\(k\\)\\)" 1 2 nil (3 . 4))) (setq calendar-week-start-day 1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Dired (setq dired-keep-marker-copy) (setq dired-listing-switches "-alR") (setq dired-auto-shell-command-alist (list ;; '("\\.[Tt][Aa][Rr]\\.*[Gg]*[Zz]$" "zcat * | tar tvf -") '("\\.shar.g*[Zz]$" "zcat * | unshar") '("\\.ps$" "gv * &") '("\\.ps[.gZz]*$" "zxdvi") '("\\.dvi[.gZz]*$" "zxdvi") '("\\.au$" "play") '("\\.tar$" "tar tvf") '("\\.u*e*$" "uudecode") '("\\.gif$" "xv * &") ; view gif pictures '("\.tex$" "latex") '("\\.g*[Zz]$" "gunzip") '("[Aa]rc" "spark -tv") ; Acorn Archimedes archive '("\\.shar$" "unshar") '("^![Rr][Uu][Nn][Ii][Mm]" "baslist -n") ; Tokenised BASIC program '("\\.defaults$" "xrdb") '("\\.gopher_menu$" "mkcache") '("^a\\.out$" "*") )) (defun dired-mouse (event) "Visit a file clicked on in a Dired buffer. If there is a filename on the current line, visit the file else re-read the directory." (interactive "e") (let ((opoint (point))) (mouse-set-point event) (cond ((dired-move-to-filename) (sit-for 0) (dired-find-file)) (t (dired-revert) (goto-char opoint))))) ;; A version of dired-mark-read-file-name which inserts the name of ;; the single current file as the intial minibuffer contents. (defun my-dired-mark-read-file-name (prompt dir op-symbol arg files) (dired-mark-pop-up nil op-symbol files (function read-file-name) ;; Args for read-file-name: (format prompt (dired-mark-prompt arg files)) dir nil nil ; completion dir, no default, needn't match (and (null (cdr files)) (car files)))) ; initial contents if single file (defun upcase-prev-word () (interactive) (upcase-word -1)) ;(defun compilation-buffer-goto-end (buffer result) ; (end-of-buffer-other-window 0)) (put 'upcase-region 'disabled nil) (transient-mark-mode t) ;; Turn the menu bar off (menu-bar-mode 0) (add-to-list 'auto-mode-alist '("\\.e\\'" . eiffel-mode)) (autoload 'eiffel-mode "eiffel-mode" "Major mode for Eiffel programs" t) (global-font-lock-mode t) (setq font-lock-maximum-decoration '((c-mode . 3) (c++-mode . 3))) (setq font-lock-maximum-size `((c-mode . 524288) (c++-mode . 524288))) ;; 22.3 ;;(setq font-lock-support-mode 'fast-lock-mode) (add-hook 'c-mode-common-hook 'turn-on-font-lock) ; (setq Info-directory-list ; '("/usr/local/info/" ; "/hw/cad/gnu/guile-doc/ref" ; "/cad/local/info/" ; )) ;; Stop at the end of the file, not just add lines (setq next-line-add-newlines nil) (server-start) ;(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) ;(autoload 'xml-mode "psgml" "Major mode to edit XML files." t) (autoload 'html-mode "xxml" "Major mode to edit HTML files." t) (autoload 'xxml-mode-routine "xxml") (add-hook 'sgml-mode-hook 'xxml-mode-routine) (setq sgml-indent-step 4) (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. '(blink-cursor-mode nil) '(blink-matching-paren nil) '(blink-matching-paren-distance 65536) '(blink-matching-paren-on-screen nil) '(browse-url-browser-function (quote browse-url-netscape)) '(compilation-error-screen-columns t) '(compilation-scroll-output t) '(compilation-window-height nil) '(compile-auto-highlight t) '(compile-command "enter_chroot.sh my_make_mgmt -C $mgmt/") '(cursor-in-non-selected-windows nil) '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 0) (cursor-color . "yellow") (cursor-type . box) (foreground-color . "gray90") (background-color . "gray10") (vertical-scroll-bars . right) (font . "9x15") (top . 4) (left . 350) (height . 68) (width . 80)))) '(fill-column 75) '(indent-tabs-mode nil) '(initial-frame-alist nil) '(minibuffer-auto-raise nil) '(printer-name "transporter") '(ps-footer-font-size (quote (7 . 8.5))) '(ps-footer-frame-alist (quote ((fore-color . 0.0) (back-color . 0.9) (border-width . 0.4) (border-color . 0.0) (shadow-color . 0.0)))) '(ps-footer-lines 1) '(ps-header-font-size (quote (7 . 8.5))) '(ps-header-lines 1) '(ps-header-title-font-size (quote (7 . 8.5))) '(ps-print-footer t) '(ps-print-footer-frame nil) '(ps-print-header nil) '(ps-print-header-frame nil) '(ps-spool-duplex t) '(scroll-bar-mode (quote right)) '(show-paren-delay 0.25) '(show-paren-mode t nil (paren)) '(show-paren-style (quote mixed)) '(show-trailing-whitespace t) '(tool-bar-mode nil nil (tool-bar))) (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. '(custom-group-tag-face ((((class color) (background light)) (:underline t :foreground "cyan"))) t) '(custom-state-face ((((class color) (background light)) (:foreground "greenyellow"))) t) '(custom-variable-tag-face ((((class color) (background light)) (:underline t :foreground "cyan"))) t) '(diff-added-face ((t (:foreground "green3")))) '(diff-changed-face ((t (:foreground "yellow")))) '(diff-context-face ((t (:foreground "gray80")))) '(diff-removed-face ((t (:foreground "red3")))) '(font-lock-builtin-face ((((class color) (background light)) (:foreground "pink")))) '(font-lock-comment-face ((t (:foreground "darkseagreen")))) '(font-lock-constant-face ((((class color) (background light)) (:foreground "orange")))) '(font-lock-doc-face ((t (:inherit font-lock-comment-face)))) '(font-lock-function-name-face ((t (:foreground "turquoise")))) '(font-lock-keyword-face ((t (:foreground "bisque")))) '(font-lock-string-face ((t (:foreground "gold")))) '(font-lock-type-face ((t (:foreground "bisque")))) '(font-lock-variable-name-face ((t (:foreground "bisque")))) '(font-lock-warning-face ((t (:foreground "tomato")))) '(highlight ((((class color) (background light)) (:background "darkgreen")))) '(mode-line ((t (:foreground "black" :background "gray80")))) '(region ((t (:background "gray50")))) '(secondary-selection ((((class color) (background light)) (:background "turquoise")))) '(show-paren-match ((((class color)) (:background "lightcyan4")))) '(trailing-whitespace ((((class color) (background dark)) (:background "orange4")))) '(vhdl-font-lock-prompt-face ((((class color) (background light)) (:bold t :foreground "aquamarine"))))) ; (load "br-start") ; (global-set-key "\C-c\C-o" 'oo-browser) (setq default-fill-column 75) (setq fill-column 75) ;; 22.3 ;; (load "psvn") (setq grep-find-command "find $mgmt \\( -wholename \"*\\.diff\" -prune \\) -o \\( -wholename \"*/.svn*\" -prune \\) -o \\( -wholename \"*/build/*\" -prune \\) -o \\( -wholename \"*/install/*\" -prune \\) -o \\( -wholename \"*\.diff\" -prune \\) -o \\( -wholename \"*~\" -prune \\) -o \\( -wholename \"*/TAGS\" -prune \\) -o -print0 | xargs -0 -e grep -n -e ") ;;(add-to-list 'compilation-nomessage-regexp-alist '("Success:")) ;;(add-to-list 'compilation-nomessage-regexp-alist nil) (require 'quail) (quail-define-package "turkish-ali" "UTF-8" "TRa<" t "Turkish input method by Ali " nil t nil nil nil nil nil nil nil nil t) (quail-define-rules ("A^" ?Â) ("a^" ?â) ("CC" ?Ç) ("cc" ?ç) ("GG" ?Ğ) ("gg" ?ğ) ("II" ?İ) ("ii" ?ı) ("I^" ?Î) ("i^" ?î) ("OO" ?Ö) ("oo" ?ö) ("SS" ?Ş) ("ss" ?ş) ("UU" ?Ü) ("uu" ?ü) ("U^" ?Û) ("u^" ?û) ("A^/" ["A^"]) ("a^/" ["a^"]) ("CC/" ["CC"]) ("cc/" ["cc"]) ("GG/" ["GG"]) ("gg/" ["gg"]) ("II/" ["II"]) ("ii/" ["ii"]) ("i^/" ["i^"]) ("OO/" ["OO"]) ("oo/" ["oo"]) ("SS/" ["SS"]) ("ss/" ["ss"]) ("UU/" ["UU"]) ("uu/" ["uu"]) ("U^/" ["U^"]) ("u^/" ["u^"]) ) ;; (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) (add-to-list 'auto-mode-alist '("\\.d\\'" . d-mode)) (add-to-list 'auto-mode-alist '("\\.di\\'" . d-mode)) (autoload 'd-mode "d-mode" "Major mode for D programs" t)