;;beginning of _emacs ;; author W. Minten et al. ;; last modification June 28, 1998 ;; 19981008.01 (setq w32-num-mouse-buttons 2) ; the cua-mode makes the insert/paste stuff work like MS windows (load "cua-mode") (CUA-mode t) (set-background-color "wheat") ;; 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 . 130) (width . 80) (height . 30) (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))) ;; fix the printing using 'pr' ;; from http://atnetsend.ne.mediaone.net/~paquette/WinProgramming.html#prwin32 ;(setq lpr-command "pr") ;(setq lpr-add-switches nil) ;(setq lpr-switches '("-f" "-p55" "-P\\\\SE-NTSERVER\\Sys102HP" "-s")) ; fix up the menu bar to use lpr-buffer instead of print-buffer ;(define-key menu-bar-tools-menu [lpr-buffer] '("lpr Buffer" . lpr-buffer)) ;(define-key menu-bar-tools-menu [lpr-region] '("lpr Region" . lpr-region)) ;(define-key menu-bar-tools-menu [print-buffer] nil) ;(define-key menu-bar-tools-menu [print-region] nil) (setq-default w32-print-use-faces nil w32-print-paper-type 'letter w32-print-lpr-destination "//SE-NTSERVER/SYS102HP" w32-print-ps-destination "//SE-NTSERVER/SYS102HP" w32-print-gs-destination "//SE-NTSERVER/SYS102HP" w32-print-gs-device "ljet4" w32-print-gs-device-dpi '300 w32-print-gs-version "5.10" w32-print-gs-path "c:/apps/gstools/gs5.10" w32-print-gs-view-path "c:/apps/gstools/gsview" w32-print-psnup-path "c:/apps/bin/emacs/site-bin" w32-print-lpr-path "c:/apps/bin/emacs/site-bin") (load "w32-print" 'noerror 'nomessage) ; Printing setup ; (load "w32-print") ; Printing setup ;; http://www.cns.ed.ac.uk/people/stephen/emacs/iswitchb.el (load '"iswitchb") (iswitchb-default-keybindings) ;(describe-function 'iswitchb) ;; 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-backspace] 'backward-kill-word); (global-set-key [C-delete] 'kill-word); (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] 'help) (global-set-key [f3] '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 [M-f4] 'save-buffers-kill-emacs) ; Leave (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 have a network connection with UNIX like environment ; take care of CR/LF disabling if NTemacs manages (load/save) files on it ; ftp://ftp.sunet.se/pub/os/Win32/ntEmacs/docs/ntemacs.html#translation (load "c:/apps/bin/emacs/site-lisp/untranslate") (add-untranslated-filesystem "d:") ; d: is a UNIX drive ;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:/temp") (setenv "TMP" "c:/temp") ;; use ISPELL on PC (see http://cat.rpi.edu/~tibbetts/ispell_toc.html ; fot the installation procedure) ; you don't need to add c:\ispell4\exe to your PATH, and ; you don't need to copy or move any file after unzipping ; if you define ispell-command and ispell-look-command properly. ; M-$ for ispell word under cursor, M-x ispell-buffer for whole buffer ; see also pull-down menu , , . (cond ((file-exists-p "c:/apps/ispell4/exe/ispell.exe") (autoload 'ispell-word "ispell4" "Check spelling of word at or before point" t) (autoload 'ispell-complete-word "ispell4" "Complete word at or before point" t) (autoload 'ispell-region "ispell4" "Check spelling of every word in the region" t) (autoload 'ispell-buffer "ispell4" "Check spelling of every word in the buffer" t) (setq ispell-command "c:/apps/ispell4/exe/ispell.exe" ispell-look-dictionary "c:/apps/ispell4/ispell.words" ispell-look-command "c:/apps/ispell4/exe/look.exe" ispell-command-options (list "-d" "c:/apps/ispell4/ispell.dict")))) ; 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) ;;; Sample batch setup of most things that may be necessary *before* ;;; loading w32-print.el:; ; ; (setq-default w32-print-use-faces nil ; w32-print-paper-type 'letter ; w32-print-lpr-destination "//SE-NTNET/SYS102HP" ; w32-print-ps-destination "//SE-NTNET/SYS102HP" ; w32-print-gs-destination "//SE-NTNET/SYS102HP" ; w32-print-gs-device "ljet4" ; w32-print-gs-device-dpi '300 ; w32-print-gs-version "5.10" ; w32-print-lpr-path "d:/bin/emacs/site-bin" ; w32-print-gs-path "c:/PROGRA~1/GSTOOLS/gs5.10" ; w32-print-gs-view-path "c:/PROGRA~1/GSTOOLS/gsview" ; w32-print-psnup-path "d:/bin/emacs/site-bin") ; (load "w32-print" 'noerror 'nomessage) ; Printing setup ;; stig-paren.el, a parentheses mathing much better than the default paren.el ;*************** (for better view of matched parentheses) (cond (window-system (require 'stig-paren) ;; XEmacs (global-set-key [(control leftparen)] 'stig-paren-toggle-dingaling-mode) (global-set-key [(control rightparen)] 'stig-paren-toggle-sexp-mode)) (t (setq blink-matching-paren t)) ) ;;settings for bib-cite.el ;************************** (require 'imenu) (define-key global-map [S-mouse-3] 'imenu) (autoload 'turn-on-bib-cite "bib-cite") (add-hook 'LaTeX-mode-hook 'turn-on-bib-cite) ;; print several pages per page ;; source : http://www.cs.rose-hulman.edu/~econommx/emacs/2-up.html ;; requires psnup.exe & print.el ;;;;;(load-library "print") ;; print ps several pages/page ;; load default lisp file (.el or .elc) for improved LaTeX mode ;; all settings are located in tex-site, hence ;************************************************************** (load "c:/apps/bin/emacs/site-lisp/tex-site") (setq ange-ftp-ftp-program-name "c:/apps/bin/emacs/site-bin/ftp.exe") ;;end of _emacs