;--------------------------------------------------------------------- ; xemacs initialization file. ; This file is executed by xemacs whenever it is launched. ;--------------------------------------------------------------------- ; Disable whatever global customizations the system administrator ; may have established. (setq inhibit-default-init t) ; When the user typed the BACKSPACE key (alias Control-h), pretend ; that the user typed the DELETE key. Without this keyboard ; translation, the BACKSPACE key calls the function "help-command". (keyboard-translate ?\C-h ?\C-?) ; Set the "Control-x ?" key sequence to call the function ; "help-command". (global-set-key "\C-x?" 'help-command) ; Set the "Control-x l" (the letter "ell") key sequence to ; call the function "goto-line". (global-set-key "\C-xl" 'goto-line) ; Set the HOME key to call the function "beginning-of-line". ; (Doesn't work on iMac.) (global-set-key "\C-[[2~" 'beginning-of-line) ; Set the END key to call the function "end-of-line". ; (Doesn't work on iMac.) (global-set-key "\C-[[4~" 'end-of-line) ; Display the line number in the status bar. (setq line-number-mode t) ; Display the column number in the status bar. (setq column-number-mode t) ; Make the Control-n and Control-p keys (and the down arrow and up ; arrow keys) scroll the current window one line at a time instead ; of one-half screen at a time. (setq scroll-step 1) ; Set the comment character for asm-mode to '#'. (setq asm-comment-char ?#) ; Indent using spaces instead of tabs in c-mode and asm-mode. (defun my-c-mode-common-hook () (setq indent-tabs-mode nil)) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (defun my-asm-mode-common-hook () (setq indent-tabs-mode nil)) (add-hook 'asm-mode-hook 'my-asm-mode-common-hook) ; Set the indentation style for C programs. (setq c-default-style "ellemtel") ; (setq c-default-style "cc-mode") ; (setq c-default-style "gnu") ; (setq c-default-style "k&r") ; (setq c-default-style "bsd") ; (setq c-default-style "stroustrup") ; (setq c-default-style "whitesmith") ;--------------------------------------------------------------------- ; Function definitions. ;--------------------------------------------------------------------- ; Indent all lines of the C program in the current buffer according ; to the current indentation style. (defun indent-all() (interactive) (save-excursion (let () (goto-char (point-min)) (while (< (point) (point-max)) (c-indent-command) (next-line 1))))) ;--------------------------------------------------------------------- ; Load and configure the font-lock package. The font-lock package ; does syntax highlighting. ;--------------------------------------------------------------------- ; Load the font-lock package. (require 'font-lock) ; Perform the maximum level of decoration. (setq font-lock-maximum-decoration t) ; Set the font for comments: font-lock-comment-face (copy-face 'bold 'font-lock-comment-face) ; Set the font for documentation strings: font-lock-doc-string-face ; Set the font for strings: font-lock-string-face (set-face-foreground 'font-lock-string-face "red") ; Set the font for keywords: font-lock-keyword-face (set-face-foreground 'font-lock-keyword-face "blue") ; Set the font for function names: font-lock-function-name-face (copy-face 'bold 'font-lock-function-name-face) (set-face-foreground 'font-lock-function-name-face "blue") ; Set the font for variable names: font-lock-variable-name-face ; Set the font for type names: font-lock-type-face (set-face-foreground 'font-lock-type-face "green") ; Set the font for reference names: font-lock-reference-face ; Set the font for preprocessor commands: font-lock-preprocessor-face (set-face-foreground 'font-lock-preprocessor-face "blue") ;--------------------------------------------------------------------- ; The following is auto-generated by xemacs. Don't touch it. ;--------------------------------------------------------------------- (custom-set-variables '(load-home-init-file t t)) (custom-set-faces)