• Welcome to Valhalla Legends Archive.
 

pay no attention to the .emacs file behind the curtain

Started by K, June 21, 2005, 02:00 PM

Previous topic - Next topic

K

also pay no attention to my removed email login information.


;;; Emacs configuration file

(setq vm-imap-server-list '("imap-ssl:mail.myserver:993:index:login:mylogin:*"))
(setq smtpmail-smtp-server "mail.myserver")
(setq smtpmail-auth-credentials '(("mail.myserver" "25" "mylogin" nil)))
(setq send-mail-function 'smtpmail-send-it)

;; Visual feedback on selections
(setq-default transient-mark-mode t)

;; hitting delete will delete the highlighted region
(pending-delete-mode 1)

;; Always end a file with a newline
(setq require-final-newline t)

;; Stop at the end of the file, not just add lines
(setq next-line-add-newlines nil)

;; Enable wheelmouse support by default
(cond (window-system
       (mwheel-install)
       ))

; Make text mode the default for new buffers
(setq default-major-mode 'text-mode)

; Set my email address
(setq user-mail-address "[email protected]")


;; these customizations were made from the options menu.  To change
;; them make use the options menu.  They should be self explanatory
;; (I hope)

(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.
'(case-fold-search t)
'(current-language-environment "Latin-9")
'(default-input-method "latin-9-prefix")
'(ecb-layout-window-sizes (quote (("left6" (0.17045454545454544 . 0.18666666666666668) (0.17045454545454544 . 0.4) (0.17045454545454544 . 0.36)) ("left8" (0.1534090909090909 . 0.05333333333333334) (0.1534090909090909 . 0.05333333333333334) (0.1534090909090909 . 0.4) (0.1534090909090909 . 0.44)))))
'(ecb-options-version "2.24")
'(ecb-tip-of-the-day nil)
'(global-font-lock-mode t nil (font-lock))
'(show-paren-mode t nil (paren))
'(transient-mark-mode t))
(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.
)

;;;;;;;; Don't truncate, wrap, or fold lines of split windows ;;;
(setq truncate-partial-width-windows nil)
(setq truncate-lines nil)

;;;; The MODE Line ;;;;
(load "time") (display-time)
(column-number-mode 1)

;; title bar shows name of current buffer ;;
(setq frame-title-format '("emacs: %*%+ %b"))

;;;; use y or n instead of yes or no
(fset 'yes-or-no-p 'y-or-n-p)

;;;;; M-g does goto-line ;;;;
(global-unset-key "\M-g")
(global-set-key "\M-g" 'goto-line)

;;;;;; quick move cursor to top or bottom of screen ;;;;;
(defun point-to-top ()
  "Put point on top line of window."
  (interactive)
  (move-to-window-line 0))

(global-set-key [?\C-,] 'point-to-top)

;; load up ecb and try to activate code completion
;(add-to-list 'load-path "/home/ledbettj/.emacsd/eieio/eieio-0.17")
;(add-to-list 'load-path "/home/ledbettj/.emacsd/semantic/semantic-1.4.4")
;(add-to-list 'load-path "/home/ledbettj/.emacsd/speedbar/speedbar-0.14beta4")
;(add-to-list 'load-path "/home/ledbettj/.emacsd/ecb/ecb-2.26")
;(setq semantic-load-turn-useful-things-on t)
;(require 'semantic-load)

(defun point-to-bottom ()
  "Put point at beginning of last visible line."
  (interactive)
  (move-to-window-line -1))

(global-set-key [?\C-.] 'point-to-bottom)

(defun indent-or-complete ()
  "Complete if point is at end of a word, otherwise indent line."
  (interactive)
  (if (looking-at "\\>")
      ;;     (and
      ;;      (eq (char-syntax (preceding-char)) ?w)
      ;;      (not (eq (char-syntax (following-char)) ?w))
      ;;      )
      (dabbrev-expand nil)
    (indent-for-tab-command)
    ))

(setq global-font-lock-mode t)
(setq kill-whole-line t)                   ;;; Killing line also deletes \n
(setq next-line-add-newlines nil)          ;;; Down arrow won't add \n at end
(setq require-final-newline t)             ;;; Put \n at end of last line
(setq make-backup-files nil)               ;;; Don't make backup files
(setq scroll-step 1)                       ;;; Scroll 1 line at a time
(setq line-number-mode t)                  ;;; Put line number in display
(setq column-number-mode t)                ;;; Put column number in display
(setq fill-column 80)    ;;; Text lines limited to 80 chars
(setq inhibit-startup-message t)           ;;; Stop the startup message!
(setq font-lock-maximum-decoration t)      ;;; Use the most coloration
(setq tab-width 2)                         ;;; Set the default tab width to 3
(setq indent-tabs-mode nil)                ;;; Use spaces for indent.
(delete-selection-mode t)                  ;;; Allows you to delete highlighted text

;;; Function
;;; Definitions:        *** --------------------------------------------------
;;;  indent-all         ;;; Indents buffer (use fset because of indent-region)
;;;  open-new-line      ;;; Open a new line after the current line
;;;  c-return           ;;; In c: indent & open indented new line
;;;  split              ;;; Split window, move to other window, open new file
;;;                     *** --------------------------------------------------
(fset 'indent-all "\C-xh\C-[\C-\\")
(defun open-new-line( ) (interactive) (end-of-line) (newline-and-indent))
(defun c-return( ) (interactive) (c-indent-line-or-region) (newline-and-indent))
(defun delete-whole-line( ) (interactive) (beginning-of-line) (kill-line))

;(global-set-key [11] 'delete-whole-line)  ;;; Ctrl-k = kill whole line
(global-set-key [f3] 'indent-all)         ;;; Indent the whole file

;;; Actions taken when entering certain major modes for programming

; Turn on auto-fill mode in text files
(add-hook 'text-mode-hook 'turn-on-auto-fill)

(add-hook 'c-mode-hook
   '(lambda()
        (local-set-key [13] 'c-return)        ;;; RET with automatic indent
        (local-set-key [16] 'indent-all)      ;;; Ctrl-p pretty-prints file
(local-set-key (kbd "") 'indent-or-complete)
(c-set-style "bsd")                   ;;; Kernihan & Richie's style
        (setq c-basic-offset 3)               ;;; 3 spaces for indentations
        (c-set-offset 'substatement-open 0)   ;;; No indent for open bracket
        (show-paren-mode 1)                   ;;; Highlight matching parens
(turn-on-font-lock)           ;;; Turn on font lock mode
(c-toggle-auto-hungry-state 1)
    )
)

;;; java-mode
(add-hook 'java-mode-hook
   '(lambda()
        (local-set-key [13] 'c-return)        ;;; RET with automatic indent
        (local-set-key [16] 'indent-all)      ;;; Ctrl-p pretty-prints file
(local-set-key (kbd "") 'indent-or-complete) ;; Tab complete
(show-paren-mode 1)                   ;;; Highlight matching parens
(turn-on-font-lock)                   ;;; Turn on font lock mode
        (setq c-basic-offset 3)
        (c-set-offset 'substatement-open 0)
        (c-set-offset 'case-label '+)         ;;; Indent for switch() cases
    )
)

;; Setup Emacs to run bash as its primary shell.
(setq shell-file-name "bash")
(setq shell-command-switch "-c")
(setq explicit-shell-file-name shell-file-name)
(setenv "SHELL" shell-file-name)
(setq explicit-sh-args '("-login" "-i"))

;;;;;;;;;;;;;;; color settings ;;;;;;;;;;;;;;;;;;;;;;
(set-foreground-color "grey100" )
;;(set-background-color "#000044" )
(set-background-color "black")

(set-cursor-color "yellow")
(set-border-color "DarkSlateGray" )

(setq default-frame-alist
      (append default-frame-alist
      '((foreground-color . "grey100")
(background-color . "black")
(cursor-color . "yellow")
        ;(mouse-color . "DarkSlateGray")
)))
(set-face-foreground 'font-lock-comment-face       "orchid")
(set-face-foreground 'font-lock-string-face        "OrangeRed")
(set-face-foreground 'font-lock-doc-string-face    "gray")
(set-face-foreground 'font-lock-function-name-face "green")
(set-face-foreground 'font-lock-variable-name-face "cyan")
(set-face-foreground 'font-lock-type-face          "SandyBrown")
(set-face-foreground 'font-lock-keyword-face       "pink")
(set-face-foreground 'font-lock-builtin-face       "pink")
(set-face-foreground 'font-lock-constant-face      "yellow") ; "Wheat")

(set-face-foreground 'modeline "black")
(set-face-background 'modeline "grey100")
(set-face-background 'region "blue")
(set-face-foreground 'bold "red")
(set-face-foreground 'italic "yellow")
(set-face-background 'highlight "blue")


;;;;;;;;;;;;;;; old color settings ;;;;;;;;;;;;;;;;;;;;;;
;(set-foreground-color "black" )
;(set-background-color "grey100")

;(set-cursor-color "black")
;(set-border-color "DarkSlateGray" )

;(setq default-frame-alist
;      (append default-frame-alist
;       '((foreground-color . "Black")
; (background-color . "grey100")
; (cursor-color . "Black")
; )))
;(set-face-foreground 'font-lock-comment-face       "DarkGreen")
;(set-face-foreground 'font-lock-string-face        "Black")
;(set-face-bold-p 'font-lock-string-face "Bold")
;(set-face-foreground 'font-lock-function-name-face "Black")
;(set-face-foreground 'font-lock-variable-name-face "Black")
;(set-face-foreground 'font-lock-type-face          "Blue")
;(set-face-foreground 'font-lock-keyword-face       "DarkBlue")
;(set-face-foreground 'font-lock-builtin-face       "Blue")
;(set-face-foreground 'font-lock-constant-face      "DarkBlue") ; "Wheat")

;(set-face-foreground 'modeline "black")
;(set-face-background 'modeline "grey100")
;(set-face-background 'region "LightBlue")
;(set-face-foreground 'bold "red")
;(set-face-foreground 'italic "yellow")
;(set-face-background 'highlight "blue")

;; Xrefactory configuration part ;;
;; some Xrefactory defaults can be set here
;(defvar xref-current-project nil) ;; can be also "my_project_name"
;(defvar xref-key-binding 'global) ;; can be also 'local or 'none
;(setq load-path (cons "/home/ledbettj/xref/emacs" load-path))
;(setq exec-path (cons "/home/ledbettj/xref" exec-path))
;(load "xrefactory")
;; end of Xrefactory configuration part ;;
;(message "xrefactory loaded")