;;beginning of _emacs ;; author W. Minten et al. ;; last modification June 28, 1998 ;; default frame and color settings ; invoke M-x list-colors-display to choose the colors ; comment this if you want to see the default settings (setq default-frame-alist '((top . 000) (left . 350) (width . 80) (height . 42) (cursor-color . "red") (background-color . "wheat") (vertical-scroll-bars . right) ;fonts found on the mailing list, uncomment one at your convenience ;(font . "-*-Courier-normal-r-*-*-13-97-*-*-c-*-*-ansi-") ;(font . "-*-Terminal-normal-r-*-*-8-60-*-*-c-*-*-oem-") ;(font . "-*-Terminal-normal-r-*-*-12-72-*-*-c-80-*-oem-") ;(font . "-*-Terminal-normal-r-*-*-8-60-*-*-c-*-*-oem-") ;(font . "-*-Terminal-normal-r-*-*-19-142-*-*-c-*-*-oem-") ) ) ;; some interactive color settings by means of ; M-x set-mouse-color RET magenta RET ;strange but this seems not to work.. ; M-x set-cursor-color RET red RET ; M-x set-background-color RET black RET ; M-x set-foreground-color RET yelow RET ;some useful additional settings (setq display-time-24hr-format t) ; In 24 hour format (display-time) ; Display the time (setq-default auto-fill-hook 'do-auto-fill) (setq fill-column 78) (standard-display-european 1) ; Display full ISO character set (put 'eval-expression 'disabled nil) (setq text-mode-hook '(lambda() (auto-fill-mode 1))) ;; no emacs start-up message (setq inhibit-startup-message t) ;; Redefine some keys. (setq kill-whole-line t) ; Kill EOL too (global-set-key [kp-home] 'beginning-of-line) (global-set-key [kp-end] 'end-of-line) (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 [S-delete] 'clipboard-kill-region) (global-set-key [S-insert] 'clipboard-yank) (global-set-key [C-insert] 'clipboard-kill-ring-save) (global-set-key [S-right] 'set-mark-command) (global-set-key [f1] 'goto-line) ; goto line (global-set-key [delete] 'delete-char) ; delete character under cursor (global-set-key [f4] 'indent-three-spaces) ; indent 3 spaces (global-set-key [f8] 'kill-current-line) ; delete current line (global-set-key [f7] 'kill-current-or-next-word) ; delete current word (global-set-key [?\C-z] 'undo); added here because I usually do kills by mistake (global-set-key "\C-x\C-j" 'goto-line) ; Command prompts for linenumber to go to. ;; Define function that indents three spaces. (defun indent-three-spaces () "Indent three spaces." (interactive) (beginning-of-line) (insert " ") (next-line 1) ) ;; Define function that removes the current line. (setq kill-whole-line t) (defun kill-current-line () "Delete the current line." (interactive) (beginning-of-line) (kill-line) ) ;; Define function that removes the current word. (defun kill-current-or-next-word () "Delete current or next word." (interactive) (forward-word 1) (backward-kill-word 1) ;(delete-char 1) ) ;;;;Define keys and functions useful for AUC-TeX ;;If you do not want to use 'C-c C-c' or the pull-down menu "Command" (global-set-key [(control f5)] 'do-LaTeX) ; LaTeX the current file (global-set-key [(control f6)] 'do-DVIview) ; DVIview the current file (defun do-LaTeX () "LaTeX the curent file." (interactive) (TeX-command "LaTeX" 'TeX-master-file)) (defun do-DVIview () "YAPview the curent file." (interactive) (TeX-command "View" 'TeX-master-file)) ;;If you do not want to use the pull-down menu "Command" for dvips (global-set-key [(control f7)] 'do-DVIPS) ; DVIPS the current file (global-set-key [(control f8)] 'do-PSview) ; PSview the current file (defun do-DVIPS () "DVIPS the curent file." (interactive) (TeX-command "dviPS" 'TeX-master-file)) (defun do-PSview () "DVIPS the curent file." (interactive) (TeX-command "Ghostview" 'TeX-master-file)) ;; prevent echoing ^M in the shell (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) ;if you encounter a file with ^M or ... at the end of every line, ; this means a worng copy by samba or floppy disk of the DOS file to UNIX. ; get rid of them by pressing [F5] (global-set-key [f5] 'cut-ctrlM) ; cut all ^M. (defun cut-ctrlM () "Cut all visible ^M." (interactive) (beginning-of-buffer) (while (search-forward "\r" nil t) (replace-match "" nil t)) ) ;still necessary (setenv "TEMP" "c:/windows/temp") (setenv "TMP" "c:/windows/temp") ; helpful (setq text-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) (setq tex-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) (setq latex-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) ; enable tex parser, also very helpful (setq ispell-enable-tex-parser t) ;; fontification font-lock.el much better than the default hilit19.el ;***************************** (for coloring) ;;automatic Font Lock mode in TeX mode ;(add-hook 'tex-mode-hook 'turn-on-font-lock) ;;if Font Lock necessary for other than .tex files, uncomment following (global-font-lock-mode t) (setq font-lock-maximum-decoration t) ;; load default lisp file (.el or .elc) for improved LaTeX mode ;; all settings are located in tex-site, hence ;************************************************************** (load "c:/emacs/site-lisp/tex-site") ;;end of _emacs