;; ;; $Id: .emacs,v 1.4 2004/05/16 08:32:31 dheeraj Exp $ ;; (tooltip-mode -1) ;(tool-bar-mode -1) ;(scroll-bar-mode -1) (global-font-lock-mode t) (fset 'yes-or-no-p 'y-or-n-p) (fset 'perl-mode 'cperl-mode) (setq message-log-max 100 default-fill-column 75 visible-bell nil gnus-use-full-window nil ps-paper-type 'a4 focus-follows-mouse t mark-even-if-inactive t truncate-partial-width-windows nil pop-up-windows t scroll-step 1 pending-delete-mode 1 windmove-wrap-around t window-size-fixed nil inhibit-startup-message t truncate-lines t font-lock-mode t european-calendar-style t calendar-week-start-day 1 message-directory "~/Mail-News" frame-title-format '("emacs@" system-name ":: %b") icon-title-format '("emacs@" system-name ":: %b") lpr-command "lpr" visible-bell t tex-directory "/tmp/" backup-directory-alist '(("." . "~/.backups")) mouse-yank-at-point t delete-key-deletes-forward t load-path (cons "/home/dheeraj/.emacs.d/" load-path) dired-recursive-deletes 'top ) (setq-default search-highlight t show-trailing-whitespace t ) (require 'font-lock) ;(load-library "nesc") (show-paren-mode) (copy-face 'highlight 'isearch) ;; Seems to cause more problems than required. ;(add-hook `write-file-hooks `delete-trailing-whitespace) ; (add-to-list 'auto-mode-alist '("\\.dn$" . LaTeX-mode)) ;(add-to-list 'auto-mode-alist '("\\.nc$" . nesc-mode)) (global-set-key [f9] 'compile) (global-set-key "\M-g" 'goto-line) ;(global-set-key "\C-m" 'newline-and-indent) (global-set-key "\C-z" 'undo) ;;== My lisp functions ;; get the font desc (defun customize-face-at-point () "Customize face which point is at." (interactive) (let ((face (get-text-property (point) 'face))) (if face (customize-face face) (message "No face defined at point")) ) ) ;; Invoke gv while in dired (defun dsr-gv (file-name) "Invoke Ghostview" (interactive "fPostScript file: ") (call-process "gv" nil 0 nil (expand-file-name file-name)) ) ;; switch to the 'screen' with title 'emacs' (defun dsr-server-switch-hook () (local-set-key "\C-x\C-c" 'server-edit) (cond ((eq window-system 'x) (let ((server-buf (current-buffer))) (bury-buffer) (switch-to-buffer-other-frame server-buf) ) ) ((getenv "STY") (shell-command "screen -X select emacs")) ) ) ;; get back to the 'mutt' window when we are done editing (defun dsr-server-done-hook () (cond ((eq window-system 'x) (delete-frame)) (t (shell-command "screen -X select mutt")) ) ) ;; Insert a common header when we open a new C program file (defun dsr-insert-template () (cond ((not (file-exists-p (buffer-file-name))) (progn (let ((beg (point))) (insert-string (concat "/*\n" " * "(buffer-name)"\n" " * Created:"(current-time-string)"\n" " * Comment:""\n" " */\n\n" "#include \n#include \n\n" "int main (int argc, char *argv[])\n{\n")) ))) (t nil)) ) (defun text-mode-hook () 'turn-on-auto-fill) (if (fboundp 'blink-cursor-mode) (blink-cursor-mode 0)) (if (boundp 'transient-mark-mode) (setq transient-mark-mode t)) (cond ((eq window-system 'x) (global-set-key [f7] 'gnus-other-frame)) (t (menu-bar-mode -1) (global-set-key "\C-h" 'backward-delete-char-untabify)) ) ;; ;;;; Play nicely with screen/mutt ===== ;; (add-hook 'server-switch-hook 'dsr-server-switch-hook) (add-hook 'server-done-hook 'dsr-server-done-hook) ;;;; Dr. Riley's style is ~ gnu ======= ;; (setq c-default-style '((c-mode . "bsd") (other . "gnu") ) ) (add-hook 'c-mode-hook (lambda () (dsr-insert-template) )) (add-hook 'asm-mode-hook (lambda() (local-set-key "\C-m" (insert "\n")) (local-set-key "\C-j" (insert "\n")) )) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(font-lock-builtin-face ((((type tty) (class color)) (:foreground "white" :weight light)))) '(font-lock-function-name-face ((((type tty) (class color)) (:foreground "gray" :weight light)))))