(setenv "HOME" "c:/emacs")
(setq load-path (append
'("~/lisp/elisp"
"~/lisp/elisp/oo-browser"
"~/lisp/elisp/oo-browser/hypb")
load-path))
(which-func-mode 1)
(custom-set-variables
'(rmail-mail-new-frame t t)
'(inhibit-startup-message t)
'(transient-mark-mode t)
'(which-func-mode-global t nil (which-func))
'(scroll-step 1)
'(scroll-conservatively 1 t)
'(find-file-run-dired t)
'(tab-width 4)
'(fast-lock-save-events nil)
'(global-font-lock-mode t nil (font-lock))
'(global-auto-revert-mode t nil (autorevert))
'(c-font-lock-extra-types (quote ("FILE" "\\sw+_t" "LPCTSTR" "WORD" "DWORD" "BYTE" "FIXME")))
'(c++-font-lock-extra-types (quote ("\\sw+_t" "\\([iof]\\|str\\)+stream\\(buf\\)?" "ios" "string" "rope" "list" "slist" "deque" "vector" "bit_vector" "set" "multiset" "map" "multimap" "hash\\(_\\(m\\(ap\\|ulti\\(map\\|set\\)\\)\\|set\\)\\)?" "stack" "queue" "priority_queue" "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator" "reference" "const_reference" "LPCTSTR" "BYTE" "WORD" "DWORD" "FIXME" "true" "false" "private" "protected" "public" "__forceinline")))
'(font-lock-global-modes t))
(custom-set-faces
'(vhdl-font-lock-attribute-face ((((class color) (background light)) nil)))
'(font-lock-comment-face ((t (:foreground "ForestGreen" (background light)))))
'(font-lock-string-face ((((class color) (background light)) (:bold nil :foreground "magenta"))))
'(font-lock-keyword-face ((((class color) (background light)) (:bold nil :foreground "Blue"))))
'(vhdl-font-lock-value-face ((((class color) (background light)) (:bold nil :foreground "Blue"))))
'(font-lock-warning-face ((((class color) (background light)) (:bold nil :foreground "Black"))))
'(font-lock-constant-face ((((class color) (background light)) (:bold nil :foreground "Black"))))
'(vhdl-font-lock-control-signal-face ((((class color) (background light)) (:foreground "Blue"))))
'(vhdl-font-lock-data-signal-face ((((class color) (background light)) (:foreground "Blue"))))
'(font-lock-type-face ((((class color) (background light)) (:bold nil :foreground "Blue"))))
'(vhdl-font-lock-clock-signal-face ((((class color) (background light)) (:foreground "Blue"))))
'(vhdl-font-lock-reset-signal-face ((((class color) (background light)) (:foreground "Blue"))))
'(font-lock-variable-name-face ((((class color) (background light)) (:bold nil))))
'(vhdl-font-lock-prompt-face ((((class color) (background light)) (:foreground "Blue"))))
'(font-lock-function-name-face ((((class color) (background light)) (:bold nil :foreground "Black"))))
'(vhdl-font-lock-test-signal-face ((((class color) (background light)) (:foreground "Blue"))))
'(font-lock-builtin-face ((((class color) (background light)) (:bold nil :foreground "Blue")))))
(require 'gnuserv)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))
(setq-default
frame-title-format
(list '((buffer-file-name " %f" (dired-directory
dired-directory
(revert-buffer-function " %b"
("%b - Dir: " default-directory)))))))
(setq-default
icon-title-format
(list '((buffer-file-name " %f" (dired-directory
dired-directory
(revert-buffer-function " %b"
("%b - Dir: " default-directory)))))))
(set-message-beep 'silent)
(require 'bs)
(setq next-line-add-newlines nil)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(setq diary-file "~/diary/.diary")
(defun yes-or-no-p (arg)
"An alias for y-or-n-p, because I hate having to type 'yes' or 'no'."
(y-or-n-p arg))
(setq backup-directory "~/backups")
(require 'backups)
(move-backups t)
(hscroll-global-mode t)
(autoload 'nuke-trailing-whitespace "whitespace" nil t)
(add-hook 'mail-send-hook 'nuke-trailing-whitespace)
(add-hook 'write-file-hooks 'nuke-trailing-whitespace)
(set-frame-height (selected-frame) 45)
(set-frame-width (selected-frame) 120)
(setq default-frame-alist
'((font . "-*-Courier New-normal-r-*-*-11-82-96-96-c-*-iso8859-1")
))
(setq kill-emacs-query-functions
(cons (lambda () (yes-or-no-p "Really kill Emacs?"))
kill-emacs-query-functions))
(setq delete-old-versions t)
(setq w32-allow-system-shell t)
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
(defun my-comint-init ()
(setq comint-process-echoes t))
(add-hook 'comint-mode-hook 'my-comint-init)
(setq auto-mode-alist
(append '(("\\.C$" . c++-mode)
("\\.cc$" . c++-mode)
("\\.cpp$" . c++-mode)
("\\.cxx$" . c++-mode)
("\\.hxx$" . c++-mode)
("\\.h$" . c++-mode)
("\\.hh$" . c++-mode)
("\\.idl$" . c++-mode)
("\\.ipp$" . c++-mode)
("\\.c$" . c-mode)
("\\.pl$" . perl-mode)
("\\.pm$" . perl-mode)
("\\.java$" . java-mode)
("\\.txt$" . text-mode))
auto-mode-alist))
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)
(setq column-number-mode t)
(load "hl-line")
(load "setnu")
(setq ps-printer-name "~/spool/printme.ps")
(define-key global-map "\C-cp" 'ps-print-buffer)
(setq compile-command "NMAKE /f \"datetimepp.mak\" CFG=\"datetimepp - Win32 Release\"")
(require 'tinylibm)
(autoload 'tisw-search-word-forward "tinysword" t t)
(autoload 'tisw-search-word-backward "tinysword" t t)
(global-set-key [f2] 'tisw-search-word-forward)
(global-set-key [S-f2] 'tisw-search-word-backward)
(autoload 'c-comment-edit "c-comment-edit2"
"No information available. See lisp file c-comment-edit2 for full documentation" t)
(autoload 'c-comment-edit-end "c-comment-edit2"
"No information available. See lisp file c-comment-edit2 for full documentation" t)
(defun dired-execute-file (&optional arg)
(interactive "P")
(mapcar #'(lambda (file) (w32-shell-execute "open" file))
(dired-get-marked-files nil arg)))
(defun dired-mouse-execute-file (event)
"In dired, execute the file or goto directory name you click on."
(interactive "e")
(set-buffer (window-buffer (posn-window (event-end event))))
(goto-char (posn-point (event-end event)))
(if (dired-is-dir)
(dired-find-file)
(dired-execute-file)))
(defun my-dired-mode-hook ()
"Hook run when entering dired-mode."
(define-key dired-mode-map "X" 'dired-execute-file)
(define-key dired-mode-map [double-down-mouse-1] 'dired-mouse-execute-file))
(add-hook 'dired-mode-hook 'my-dired-mode-hook)
(set-default 'case-fold-search t)
(defvar grep-null-device null-device)
(setq igrep-expression-quote-char ?')
(setq igrep-parenthesis-escape-char ?\\)
(autoload (function igrep) "igrep"
"*Run `grep` PROGRAM to match EXPRESSION in FILES..." t)
(autoload (function igrep-find) "igrep"
"*Run `grep` via `find`..." t)
(autoload (function dired-do-igrep) "igrep"
"*Run `grep` on the marked (or next prefix ARG) files." t)
(autoload (function dired-do-igrep-find) "igrep"
"*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
(setq igrep-options "-i")
(setq igrep-find t)
(global-set-key (quote [f9]) (quote font-lock-fontify-buffer))
(load "br-start")
(global-set-key "\C-c\C-o" 'oo-browser)
(load "hmouse-tag")
(defconst my-c-style
'(
(c-echo-syntactic-information-p . t)
(c-basic-offset . 4)
(c-toggle-auto-state . t)
(c-offsets-alist .
((string . +)
(c . +)
(defun-open . 0)
(defun-close . 0)
(defun-block-intro . +)
(class-open . 0)
(class-close . 0)
(inline-open . 0)
(inline-close . 0)
(extern-lang-open . 0)
(extern-lang-close . 0)
(func-decl-cont . +)
(knr-argdecl-intro . +)
(knr-argdecl . +)
(topmost-intro . 0)
(topmost-intro-cont . +)
(member-init-intro . +)
(member-init-cont . +)
(inher-intro . +)
(inher-cont . +)
(block-open . 0)
(block-close . 0)
(brace-list-open . 0)
(brace-list-close . 0)
(brace-list-intro . +)
(brace-list-entry . 0)
(statement . 0)
(statement-cont . +)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-case-open . 0)
(substatement . +)
(substatement-open . 0)
(case-label . +)
(access-label . -)
(label . 0)
(do-while-closure . 0)
(else-clause . 0)
(catch-clause . 0)
(comment-intro . 0)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-cont . c-lineup-arglist)
(arglist-cont-nonempty . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist)
(stream-op . +)
(inclass . +)
(inextern-lang . +)
(cpp-macro . 0)
(friend . 0)
(objc-method-intro . +)
(objc-method-args-cont . +)
(objc-method-call-cont . +)
))
(c-comment-only-line-offset . (0 . -1000))
(c-hanging-braces-alist . ((substatement-open after)
(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
defun-close-semi)))
)
"Gallucci C++ Programming Style")
(defun my-c-mode-common-hook ()
(c-add-style "gallucci" my-c-style t)
(c-set-offset 'member-init-intro '+)
(setq tab-width 4
indent-tabs-mode nil)
(c-toggle-auto-hungry-state t)
(define-key c-mode-base-map "\C-m" 'newline-and-indent)
(modify-syntax-entry ?_ "w" c++-mode-syntax-table)
(modify-syntax-entry ?_ "w" c-mode-syntax-table)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(setq speedbar-frame-parameters (quote
((minibuffer)
(width . 45)
(border-width . 0)
(menu-bar-lines . 0)
(unsplittable . t))))
(show-paren-mode 1)
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching parenthesis if on parenthesis otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
(global-set-key (read-kbd-macro "M-*") 'tags-return)
(defvar tags-stack nil)
(defun tags-stack-push (el)
(setq tags-stack (cons el tags-stack)))
(defun tags-stack-pop ()
(let ((el (car tags-stack)))
(setq tags-stack (cdr tags-stack))
el))
(defadvice find-tag (before push-tag activate)
(or (ad-get-arg 1)
(tags-stack-push (cons (current-buffer) (point)))))
(defadvice tags-search (before push-tag activate)
(tags-stack-push (cons (current-buffer) (point))))
(defun tags-return ()
(interactive)
(let* ((el (tags-stack-pop))
(buffer (car el))
(point (cdr el)))
(if buffer (switch-to-buffer buffer))
(if point (goto-char point))))
(setq font-lock-support-mode 'lazy-lock-mode)
(setq lazy-lock-defer-on-scrolling nil)
(setq lazy-lock-defer-time 1)
(setq lazy-lock-stealth-time 20)
(setq lazy-lock-stealth-lines 25)
(setq lazy-lock-stealth-verbose nil)
(require 'font-lock)
(require 'lazy-lock)
(setq user-mail-address "dgall812@concentric.net")
(setq smtpmail-default-smtp-server "smtp.concentric.net")
(setq smtpmail-local-domain nil)
(setq user-full-name "David Gallucci")
(setq send-mail-function 'smtpmail-send-it)
(load-library "smtpmail")
(load-library "supercite")
(setq sc-nested-citation-p t)
(setq gnus-cache-directory "~/news/cache/")
(setq gnus-home-directory "~/news/")
(setq gnus-startup-file "~/news/.newsrc")
(setq gnus-default-nntp-server "news.concentric.net")
(setq gnus-user-full-name "David Gallucci")
(setq gnus-user-from-line "dgall812@concentric.net")
(setq gnus-use-generic-from "David Gallucci")
(setq mail-host-address "concentric.net")
(setq gnus-local-organization "Not Listed")
(setq gnus-secondary-select-methods '((nnml "")))
(setq nnmail-pop-password-required t)
(setq gnus-use-cache t)
(setq message-yank-prefix ">")
(require 'pc-bufsw)
(pc-bufsw::bind-keys [C-tab] [C-S-tab])
(global-set-key "\C-cg" 'goto-line)
(global-set-key "\C-ce" 'fixup-whitespace)
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(global-set-key [\C-home] 'beginning-of-buffer)
(global-set-key [\C-end] 'end-of-buffer)
(global-set-key [f4] 'speedbar-get-focus)
(global-set-key "\C-xk" 'kill-current-buffer)
(defun kill-current-buffer ()
"Kill the current buffer, without confirmation."
(interactive)
(kill-buffer (current-buffer)))
(global-set-key [f12] 'kill-buffer-other-window)
(defun kill-buffer-other-window (arg)
"Kill the buffer in the other window, and make the current buffer full size. If no
other window, kills current buffer."
(interactive "p")
(let ((buf (save-window-excursion
(other-window arg)
(current-buffer))))
(delete-windows-on buf)
(kill-buffer buf)) )
(global-set-key [f11] 'kill-buffer-jump-other-window)
(defun kill-buffer-jump-other-window (arg)
"Kill this buffer and jump to other window."
(interactive "p")
(other-window arg)
(kill-buffer-other-window arg) )
(global-set-key "\C-cf" 'open-file-under-cursor)
(fset 'open-file-under-cursor
[?\C-\M-b ?\C- ?\C-\M-f ?\C-\M-f ?\M-w ?\C-x ?\C-f ?\C-y return])
(global-set-key "\C-ct" 'scroll-cursor-to-top)
(fset 'scroll-cursor-to-top
"\C-u1\C-l")
(global-set-key "\C-cx" 'box-region)
(fset 'box-region
[?\C-u ?\M-| ?c ?o ?m ?m ?e ?n ?t return])
(global-set-key "\C-cc" 'copy-word-under-cursor)
(fset 'copy-word-under-cursor
[?\C-\M-b ?\C- ?\C-\M-f ?\C-x ?r ?s ?l ?\M-x ?t ?i ?: ?: ?t ?- ?u ?n ?m ?a ?r ?k ?- ?r ?e ?g ?i ?o ?n return])
(defun stamp (arg)
"Insert current date followed \"user-full-name\".
This function assumes that the emacs variable \"user-full-name\" is defined
by ones .emacs file.
With non-nil argument omit the time from the date.
"
(interactive "*P")
(set-mark-command nil)
(let (my-time (current-time-string))
(if arg
(insert (concat
(format-time-string "%a %d-%b-%Y %T ")
user-full-name
)
)
(insert (concat
(format-time-string "%a %d-%b-%Y %T ")
user-full-name
)
)
)
)
(setq last-command "")
)
(global-set-key "\C-cd" 'stamp)
(global-set-key "\C-cy" 'do-smart-yank)
(fset 'do-smart-yank
"\C-y\C-c\C-q")
(global-set-key "\C-cv" 'replace-word-under-cursor)
(fset 'replace-word-under-cursor
[?\C-\M-b ?\C- ?\C-\M-f ?\C-w ?\C-x ?r ?i ?l])
(global-set-key "\C-cb" 'scroll-cursor-to-bottom)
(fset 'scroll-cursor-to-bottom
"\C-u-1\C-l")
(global-set-key "\C-co" 'dired-open-in-current-buffer)
(defun dired-open-in-current-buffer ()
"Open the currently selected file / directory in
the same buffer as this one."
(interactive)
(find-alternate-file (dired-get-filename)))
(defun insert-header-skeleton ()
"Insert skeleton header file"
(interactive)
(insert-file-contents "~/templates/header.h"))
(global-set-key [f5] 'insert-header-skeleton)
(defun insert-cpp-skeleton ()
"Insert skeleton cpp file"
(interactive)
(insert-file-contents "~/templates/cpp.cpp"))
(global-set-key [f6] 'insert-cpp-skeleton)
(defun insert-function-comment ()
"Insert function comment"
(interactive)
(insert-file-contents "~/templates/function.cpp"))
(global-set-key [f7] 'insert-function-comment)
(defun ewd-classname ()
"If the point is in a class definition, gets the name of the class.
Return nil otherwise."
(save-excursion
(let ((brace (assoc 'inclass (c-guess-basic-syntax))))
(if (null brace) '()
(goto-char (cdr brace))
(let ((class-open (assoc 'class-open (c-guess-basic-syntax))))
(if class-open (goto-char (cdr class-open)))
(if (looking-at "^class[ \t]+\\([A-Za-z_][^ \t:{]*\\)")
(buffer-substring (match-beginning 1) (match-end 1))
(error "Error parsing class definition!")))))))
(defun ewd-insert-new-method (rettype proto)
"Insert a function declaration into the current class header file at
point, along with matching function definition in the corresponding
implementation file, complete with class name and scope resolution
operator. This function expects the implementation file to be named
foo.cpp and in the same directory as the current header file, foo.h."
(interactive "sReturn type:\nsPrototype: ")
(let ((classname (ewd-classname))
(c-tab-always-indent t))
(if (null classname) (message "Not in class definition!")
(unless (string-equal rettype "") (setq rettype (concat rettype " ")))
(insert rettype proto ";")
(c-indent-command)
(save-window-excursion
(find-file (concat (file-name-sans-extension (buffer-file-name))
".cpp"))
(end-of-buffer)
(insert "\n\n")
(insert-function-comment)
(end-of-buffer)
(insert rettype classname "::" proto "\n{\n}\n")))))
(global-set-key "\C-ci" 'ewd-insert-new-method)
(save-excursion
(set-buffer (get-buffer-create "*scratch*"))
(lisp-interaction-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer))
(defun kill-scratch-buffer ()
(remove-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
(kill-buffer (current-buffer))
(set-buffer (get-buffer-create "*scratch*"))
(lisp-interaction-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
nil)
(save-excursion
(set-buffer (get-buffer-create "*Messages*"))
(lisp-interaction-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer))
(defun kill-scratch-buffer ()
(remove-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
(kill-buffer (current-buffer))
(set-buffer (get-buffer-create "*Messages*"))
(lisp-interaction-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
nil)
(load "desktop")
(desktop-load-default)
(desktop-read)
|