Initial commit
[clearscm.git] / rc / xemacs / init.el
1 (if (string-match "cygwin"
2 (downcase (shell-command-to-string "uname")))
3 (progn
4  (setq exec-path (cons "C:/Cygwin/bin" exec-path))
5  (setenv "PATH" (concat "C:/Cygwin/bin;" (getenv "PATH")))))
6
7 (setenv "CVS_RSH" "ssh")
8
9 ;; NT-emacs assumes a Windows command shell, which you change here.
10 (setq process-coding-system-alist '(("bash" . undecided-unix)))
11 (setq w32-quote-process-args ?\")
12 (setq shell-file-name "bash")
13 (setenv "SHELL" shell-file-name) 
14 (setq explicit-shell-file-name shell-file-name) 
15
16 ;; This removes unsightly ^M characters that would otherwise
17 (add-hook 'comint-output-filter-functions
18           'comint-strip-ctrl-m)
19 (setq shell-command-switch "-cf")
20
21 (global-set-key "\C-x\C-c" 'kill-buffer)
22 (global-set-key "\C-x\C-n" 'save-buffers-kill-emacs)
23 (global-set-key "\C-x\C-z" 'suspend-emacs-or-iconify-frame)
24
25 (setq-default column-number-mode t)
26 (display-time)
27 (setq-default line-number-mode t)
28
29 (global-set-key 'kp-tab 'tab-to-tab-stop)
30 (set-default 'indent-tabs-mode  t)
31 (set-default 'tab-width 8)
32 (c-set-offset 'substatement-open 0)
33 (c-set-offset 'case-label '+)
34
35 ; Preload common modes
36 (load-file "/usr/share/xemacs/xemacs-packages/lisp/sh-script/sh-script.el")
37 (load-file "~/.xemacs/clearcase.el")
38 (load-file "~/.xemacs/visual-basic-mode.el")
39 (autoload 'sh-mode              "sh-mode")
40 (autoload 'perl-mode            "perl-mode")
41 (autoload 'javascript-mode      "javascript-mode")
42 (autoload 'visual-basic-mode    "visual-basic-mode")
43
44 (defvar my-c-style
45   '((c-auto-newline                 . nil)
46     (c-toggle-auto-state            . 1)
47     (c-basic-offset                 . 2)
48     (c-block-comments-indent-p      . t)
49     (c-comment-only-line-offset     . nil)
50     (c-echo-syntactic-information-p . nil)
51     (c-hanging-comment-ender-p      . t)
52     (c-recognize-knr-p              . t) ; use nil if only have ANSI prototype
53     (c-tab-always-indent            . t)
54     (comment-column                 . 40)
55     (comment-end                    . " */")
56     (comment-multi-line             . t)
57     (comment-start                  . "/* ")
58     (c-hanging-comment-ender-p      . nil)
59     (c-offsets-alist                . ((knr-argdecl-intro   . +)
60                                        (case-label          . +)
61                                        (knr-argdecl         . 0)
62                                        (label               . 0)
63                                        (statement-case-open . +)
64                                        (statement-cont      . +)
65                                        (substatement-open   . 0))))
66   "my c-style for cc-mode")
67
68 (add-hook 'c-mode-common-hook
69           '(lambda ()
70              (c-add-style "MINE" my-c-style)
71              (c-set-style "MINE")))
72 (load-default-sounds)
73
74 (load "recent-files") 
75 (recent-files-initialize) 
76
77 ;; Set ftp program to use Windows FTP. Using Cygwin's ftp is problematic for a Windows
78 ;; oriented XEmacs
79 ;(setq efs-ftp-program-name "C:/Windows/System32/Ftp")
80
81 ;; Set shell-file-name and shell-command-switch for Tramp
82 ;(setq shell-file-name "cmd.exe")
83 ;(setq shell-command-switch "/e:4096 /c")
84
85 ;; Set default tramp-default-method to ssh as well as
86 ;; insert ":" into shell-prompt-pattern
87 (setq tramp-default-method "ssh")
88 (setq shell-prompt-pattern "^[^#$%>:\n]*[#$%>:] *")
89
90 ;; Set mail server
91 (set-variable 'smtpmail-smtp-server '"defaria.com")
92
93 ;;default font and face properties. 
94 (progn
95        (set-face-foreground 'default "black")
96 ;;       (set-face-background 'default "#e4deb4")
97        (set-face-background 'default "white")
98        (set-face-font 'default "Lucida Console:Regular:10"))
99
100 ;; Startup a certain size
101 (set-frame-height (selected-frame) 50)
102 (set-frame-width (selected-frame) 90)
103
104 ;; Set background
105 ;;(set-face-background-pixmap 'default
106 ;; (expand-file-name "P:/Documents/pad.jpg")
107 ;; (get-buffer "*info*"))
108
109 ;; VC mode
110 ;;require 'vc
111
112 ;; Fix problem with Clearcase.el
113 (require 'timer)
114
115 ;; Change comment-column to 0 for perl. comment-column is used for one
116 ;; of the two types of comment lines that the perl mode supports -
117 ;; full line comments and inline comments. The comment-column is used
118 ;; for the inline comments, which I rarely use. Setting it to 0 means
119 ;; don't try to align things. So I'll just align them myself.
120 (defun perl-zero-comment-column ()
121    (setq comment-column 0)) (add-hook 'cperl-mode-hook 'perl-zero-comment-column) 
122
123 (global-set-key "\C-z" 'undo)
124 (mouse-avoidance-mode 'cat-and-mouse)