[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Xemacs configuration question



 (1) I want to get Xemacs to recognize   *.tcl and *.itcl files.
 (2) I want to change the background color  from gray to white.
 (3) I want to color highlight the keyword  in  source.tcl and source.itcl files
What will I have to change to accomplish this.
 I have been trying various things unsuccefully.
My .emacs file look like the attached file. It is in text format.
What do you recommend that I change?

-- 
  Alcatel USA Corporation              Internet: @ssd.usa.alcatel.com
  1000 Coit Road Plano, Texas 75075
  **** The opinions expressed are not those of Alcatel USA, Inc ****Xemacs configuration question

;;; -*- Mode: Emacs-Lisp -*-

;;; This is a sample .emacs file.
;;;
;;; The .emacs file, which should reside in your home directory, allows you to
;;; customize the behavior of Emacs.  In general, changes to your .emacs file
;;; will not take effect until the next time you start up Emacs.  You can load
;;; it explicitly with `M-x load-file RET ~/.emacs RET'.
;;;
;;; There is a great deal of documentation on customization in the Emacs
;;; manual.  You can read this manual with the online Info browser: type
;;; `C-h i' or select "Emacs Info" from the "Help" menu.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;			Basic Customization			    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Enable the commands `narrow-to-region' ("C-x n n") and 
;; `eval-expression' ("M-ESC", or "ESC ESC").  Both are useful
;; commands, but they can be confusing for a new user, so they're
;; disabled by default.
(put 'narrow-to-region 'disabled nil)
(put 'eval-expression 'disabled nil)
(setq-default indent-tabs-mode nil)  ;fv


;; Make the sequence "C-x C-j" execute the `goto-line' command, 
;; which prompts for a line number to jump to.
(global-set-key "\C-x\C-j" 'goto-line)


(cond ((string-match "Lucid" emacs-version)
       ;;
       ;; Code for any version of Lucid Emacs goes here
       ;;

       ;; Change the values of some variables.
       ;; (t means true; nil means false.)
       ;;
       ;; Use the "Describe Variable..." option on the "Help" menu
       ;; to find out what these variables mean.
       (setq default-frame-alist '((width . 100) (height . 50)))
       (setq find-file-use-truenames nil
	     find-file-compare-truenames t
	     minibuffer-confirm-incomplete t
	     complex-buffers-menu-p t
	     next-line-add-newlines nil
	     )

       ;; When running ispell, consider all 1-3 character words as correct.
       (setq ispell-extra-args '("-W" "3"))

       (if (featurep 'sunpro)
	   (progn
	     (setq-default mode-line-buffer-identification '("lemacs: %17b"))
	     (setq mode-line-buffer-identification '("lemacs: %17b")))
	   (progn
	     (setq-default mode-line-buffer-identification '("Xemacs: %17b"))
	     (setq mode-line-buffer-identification '("Xemacs: %17b"))))

       (cond ((eq window-system 'x)
	      ;;
	      ;; Code which applies only when running emacs under X goes here.
	      ;; (Currently, this is always the case in lemacs, but it will
	      ;; not be in the future.)
	      ;;

	      ;; Remove the binding of C-x C-c, which normally exits emacs.
	      ;; It's easy to hit this by mistake, and that can be annoying.
	      ;; Under X, you can always quit with the "Exit Emacs" option on
	      ;; the File menu.
	      (global-set-key "\C-x\C-c" nil)
	      (global-set-key "\C-z" 'scroll-down)

	      ;; This changes the variable which controls the text that goes
	      ;; in the top window title bar.  (However, it is not changed
	      ;; unless it currently has the default value, to avoid
	      ;; interfering with a -wn command line argument I may have
	      ;; started emacs with.)
;;	      (if (equal screen-title-format "%S: %b")
;;	        (setq screen-title-format
;;		       (concat "%S: " execution-path " [" emacs-version "]"
;;				(if nil ; (getenv "NCD")
;;				    ""
;;				  "   %b"))))

	      ;; If we're running on display 0, load some nifty sounds that
	      ;; will replace the default beep.  But if we're running on a
	      ;; display other than 0, which probably means my NCD X terminal,
	      ;; which can't play digitized sounds, do two things: reduce the
	      ;; beep volume a bit, and change the pitch of the sound that is
	      ;; made for "no completions."
	      ;;
	      ;; (Note that sampled sounds only work if lemacs was compiled
	      ;; with sound support, and we're running on the console of a
	      ;; Sparc, HP, or SGI machine, or on a machine which has a
	      ;; NetAudio server; otherwise, you just get the standard beep.)
	      ;;
	      ;; (Note further that changing the pitch and duration of the
	      ;; standard beep only works with some X servers; many servers
	      ;; completely ignore those parameters.)
	      ;;
	      ;;(cond ((string-match ":0" (getenv "DISPLAY"))
;;		     (load-default-sounds))
;;		    (t
;;		     (setq bell-volume 20)
;;		     (setq sound-alist
;;			   (append sound-alist '((no-completion :pitch 500))))
;;		     ))
	      ))

       ;;
       ;; (The following code applies whether or not we're running X.)
       ;;

       ;; Change the binding of mouse button 2, so that it inserts the
       ;; selection at point (where the text cursor is), instead of at
       ;; the position clicked.
       ;;
       ;; Note that you can find out what a particular key sequence or
       ;; mouse button does by using the "Describe Key..." option on
       ;; the Help menu.
       (define-key global-map 'button2 'x-insert-selection)

       ;; LISPM bindings of Control-Shift-C and Control-Shift-E.
       ;; Note that "\C-C" means Control-C, not Control-Shift-C.
       ;; To specify shifted control characters, you must use the
       ;; more verbose syntax used here.
       (define-key emacs-lisp-mode-map '(control C) 'compile-defun)
       (define-key emacs-lisp-mode-map '(control E) 'eval-defun)

       ;; Make backspace and delete be the same.  This doesn't work in all
       ;; cases; a better way would be to use xmodmap.
;;     (global-set-key 'backspace [delete])
;;     (global-set-key '(meta backspace) [(meta delete)])
;;     (global-set-key '(control backspace) [(control delete)])
;;     (global-set-key '(meta control backspace) [(meta control delete)])

       ;; Make F5 be `undo'
       (global-set-key 'f5 'undo)

       ;; Make F6 be `save-file' followed by `delete-window'.
       (global-set-key 'f6 "\C-x\C-s\C-x0")

       ;; Make `C-x C-m' and `C-x RET' be different (since I tend to type
       ;; the latter by accident sometimes.)
       (define-key global-map [(control x) return] nil)

       ;; Change the cursor used when the mouse is over a mode line
       (setq x-mode-pointer-shape "leftbutton")

       ;; Change the cursor used during garbage collection.
       ;;
       ;; Note that this cursor image is rather large as cursors go, and so it
       ;; won't work on some X servers (such as the MIT R5 Sun server) because
       ;; servers may have lamentably small upper limits on cursor size.
       ;(if (featurep 'xpm)
       ;   (setq x-gc-pointer-shape
       ;	 (expand-file-name "trash.xpm" data-directory)))

       ;; Here's another way to do that: it first tries to load the cursor
       ;; once and traps the error, just to see if it's possible to load that
       ;; cursor on this system; if it is, then it sets x-gc-pointer-shape,
       ;; because we knows that will work.  Otherwise, it doesn't change that
       ;; variable because we know it will just cause some error messages.
       (if (featurep 'xpm)
	   (let ((file (expand-file-name "recycle.xpm" data-directory)))
	     (if (condition-case error
		     (make-cursor file) ; returns a cursor if successful.
		   (error nil))	    ; returns nil if an error occurred.
		 (setq x-gc-pointer-shape file))))
	 
       ;; Add `dired' to the File menu
       (add-menu-item '("File") "Edit Directory" 'dired t)

       ;; Here's a way to add scrollbar-like buttons to the menubar
       (add-menu-item nil "Top" 'beginning-of-buffer t)
       (add-menu-item nil "<<<" 'scroll-down t)
       (add-menu-item nil " . " 'recenter t)
       (add-menu-item nil ">>>" 'scroll-up t)
       (add-menu-item nil "Bot" 'end-of-buffer t)

       ))

;;; Older versions of emacs did not have these variables
;;; (emacs-major-version and emacs-minor-version.)
;;; Let's define them if they're not around, since they make
;;; it much easier to conditionalize on the emacs version.

(if (and (not (boundp 'emacs-major-version))
	 (string-match "^[0-9]+" emacs-version))
    (setq emacs-major-version
	  (string-to-int (substring emacs-version
				    (match-beginning 0) (match-end 0)))))
(if (and (not (boundp 'emacs-minor-version))
	 (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version))
    (setq emacs-minor-version
	  (string-to-int (substring emacs-version
				    (match-beginning 1) (match-end 1)))))


(cond ((and (string-match "Lucid" emacs-version)
	    (>= emacs-major-version 19)
	    (>= emacs-minor-version 6))
       ;;
       ;; Code which requires Lucid Emacs version 19.6 or newer goes here
       ;;
       ))

(cond ((>= emacs-major-version 19)
       ;;
       ;; Code for any vintage-19 emacs goes here
       ;;
       ))

(cond ((and (not (string-match "Lucid" emacs-version))
	    (= emacs-major-version 19))
       ;;
       ;; Code specific to FSF Emacs 19 (not Lucid Emacs) goes here
       ;;
       ))

(cond ((< emacs-major-version 19)
       ;;
       ;; Code specific to emacs 18 goes here
       ;;
       ))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;		Customization of Specific Packages		    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;; ********************
;;; Load ange-ftp, which uses the FTP protocol as a pseudo-filesystem.
;;; When this is loaded, the pathname syntax /user@host:/remote/path
;;; refers to files accessible through ftp.
;;;
(require 'dired)
(require 'ange-ftp)
(setq ange-ftp-default-user "anonymous"      ; id to use for /host:/remote/path
      ange-ftp-generate-anonymous-password t ; use $USER@`hostname`
      ange-ftp-binary-file-name-regexp "."   ; always transfer in binary mode
      )
(setq ange-ftp-default-user "anonymous"      ; id to use for /host:/remote/path
      ange-ftp-generate-anonymous-password t ; use $USER@`hostname`
      ange-ftp-binary-file-name-regexp "."   ; always transfer in binary mode
      )


;;; ********************
;;; Load the auto-save.el package, which lets you put all of your autosave
;;; files in one place, instead of scattering them around the file system.
;;;
(setq auto-save-directory (expand-file-name "~/autosaves/")
      auto-save-directory-fallback auto-save-directory
      auto-save-hash-p nil
      ange-ftp-auto-save t
      ange-ftp-auto-save-remotely nil
      ;; now that we have auto-save-timeout, let's crank this up
      ;; for better interactive response.
      auto-save-interval 2000
      )
(require 'auto-save)


;;; ********************
;;; Load much improved versions of the C and C++ modes.  At some point this
;;; will become the default in Lucid Emacs.
;;;
(fmakunbound 'c-mode)
(fmakunbound 'c++-mode)
(makunbound 'c-mode-map)
(makunbound 'c++-mode-map)
(makunbound 'c-style-alist)

(autoload 'c++-mode "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode   "cc-mode" "C Editing Mode" t)

(setq auto-mode-alist
      (append '(
        ("\\.ada$"  . ada-mode)
				("\\.arc$" . arc-mode)
				("\\.awk$"  . awk-mode)
				("\\.bib$"  . bib-mode)
				("\\.bibtex$"  . bib-mode)
				("\\.C$"  . c++-mode)
				("\\.c$"  . c-mode)
				("\\.cc$" . c++-mode)
				("\\.cci$" . c++-mode)
				("\\.cpp$" . c++-mode)
				("\\.cxx$" . c++-mode)
				("\\.p$" . c++-mode)
				("\\.el$" . emacs-lisp-mode)
				("\\.H$" . c++-mode)
				("\\.h$"  . c-mode)
				("\\.hh$" . c++-mode)
				("\\.hpp$" . c++-mode)
				("\\.hp$" . c++-mode)
				("\\.html$" . sgml-mode)
				("\\.hxx$" . c++-mode)
				("\\.i$" . c-mode)
				("\\.idl$" . c++-mode)
				("\\.inl$" . c++-mode)
				("\\.ksh$" . ksh-mode)
				("\\.lex$" . c++-mode)
				("\\.lzh$" . arc-mode)
				("\\.nawk$"  . awk-mode)
				("\\.nroff$"  . nroff-mode)
				("\\.perl$" . perl-mode)
				("\\.rex$" . rexx-mode)
				("\\.rexx$" . rexx-mode)
				("\\.s$" . asm-mode)
				("\\.sgml$" . sgml-mode)
				("\\.tex$" . tex-mode)
				("\\.txt$" . text-mode)
				("\\.xpm$" . xpm-mode)
				("\\.y$" . c++-mode)
				("\\.zip$" . arc-mode)
				("\\.zoo$" . arc-mode))
	      auto-mode-alist))

;; This controls indentation.  The default is 4 spaces but the
;; Emacs source code uses 2.
(setq c-basic-offset 2)


;;; ********************
;;; Load a partial-completion mechanism, which makes minibuffer completion
;;; search multiple words instead of just prefixes; for example, the command
;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET'
;;; because there are no other commands whose first three words begin with
;;; the letters `b', `c', and `a' respectively.
;;;
(load-library "completer")


;;; ********************
;;; Load crypt, which is a package for automatically decoding and reencoding
;;; files by various methods - for example, you can visit a .Z or .gz file,
;;; edit it, and have it automatically re-compressed when you save it again.
;;; 
(setq crypt-encryption-type 'pgp   ; default encryption mechanism
      crypt-confirm-password t	   ; make sure new passwords are correct
      ;crypt-never-ever-decrypt t  ; if you don't encrypt anything, set this to
				   ; tell it not to assume that "binary" files
				   ; are encrypted and require a password.
      )
(require 'crypt)


;;; ********************
;;; Edebug is a source-level debugger for emacs-lisp programs.
;;;
(define-key emacs-lisp-mode-map "\C-xx" 'edebug-defun)


;;; ********************
;;; Font-Lock is a syntax-highlighting package.  When it is enabled and you
;;; are editing a program, different parts of your program will appear in
;;; different fonts or colors.  For example, with the code below, comments
;;; appear in red italics, function names in function definitions appear in
;;; blue bold, etc.  The code below will cause font-lock to automatically be
;;; enabled when you edit C, C++, Emacs-Lisp, and many other kinds of
;;; programs.
;;;
;;; The "Options" menu has some commands for controlling this as well.
;;;
(cond ((string-match "Lucid" emacs-version)
       (require 'font-lock)
       (set-face-foreground 'font-lock-function-name-face "blue")
       (set-face-background 'default "white")
       (set-face-foreground 'default "black")
       (set-face-foreground 'font-lock-comment-face "red")
       (set-face-foreground 'font-lock-string-face "forest green")
       (set-face-underline-p 'font-lock-string-face nil)
       (make-face-unitalic 'font-lock-string-face)
       (make-face-unitalic 'font-lock-function-name-face)
       (add-hook 'emacs-lisp-mode-hook	'turn-on-font-lock)
       (add-hook 'lisp-mode-hook	'turn-on-font-lock)
       (add-hook 'c-mode-hook		'turn-on-font-lock)
       (add-hook 'c++-mode-hook		'turn-on-font-lock)
       (add-hook 'perl-mode-hook	'turn-on-font-lock)
       (add-hook 'tex-mode-hook		'turn-on-font-lock)
       (add-hook 'texinfo-mode-hook	'turn-on-font-lock)
       (add-hook 'postscript-mode-hook	'turn-on-font-lock)
       (add-hook 'dired-mode-hook	'turn-on-font-lock)
       (add-hook 'ada-mode-hook		'turn-on-font-lock)
       ))


;;; ********************

;;; func-menu is a package that scans your source file for function definitions
;;; and makes a menubar entry that lets you jump to any particular function
;;; definition by selecting it from the menu.  The following code turns this on
;;; for all of the recognized languages.  Scanning the buffer takes some time,
;;; but not much.
;;;
(cond ((string-match "Lucid" emacs-version)
       (require 'func-menu)
       (define-key global-map 'f8 'function-menu)
       (add-hook 'find-file-hooks 'fume-add-menubar-entry)
       (define-key global-map "\C-cg" 'fume-prompt-function-goto)
       (define-key global-map '(shift button3) 'mouse-function-menu)
       ))


;;; ********************
;;; MH is a mail-reading system from the Rand Corporation that relies on a
;;; number of external filter programs (which do not come with emacs.)
;;; Emacs provides a nice front-end onto MH, called "mh-e".
;;;
;; Bindings that let you send or read mail using MH
;(global-set-key "\C-xm" 'mh-smail)
;(global-set-key "\C-x4m" 'mh-smail-other-window)
;(global-set-key "\C-cr" 'mh-rmail)

;; Customization of MH behavior.
(setq mh-delete-yanked-msg-window t)
(setq mh-yank-from-start-of-msg 'body)
(setq mh-summary-height 11)

;; Use lines like the following if your version of MH
;; is in a special place.
;(setq mh-progs "/usr/dist/pkgs/mh/bin.svr4/")
;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/")


;;; ********************
;;; W3 is a browser for the World Wide Web, and takes advantage of the very
;;; latest redisplay features in Lucid Emacs.  You can access it simply by
;;; typing 'M-x w3'; however, if you're unlucky enough to be on a machine
;;; that is behind a firewall, you will have to do something like this first:

;(setq w3-use-telnet t
; 		 ;;
; 		 ;; If the Telnet program you use to access the outside world is
; 		 ;; not called "telnet", specify its name like this.
; 		 w3-telnet-prog "itelnet"
; 		 ;;
; 		 ;; If your Telnet program adds lines of junk at the beginning
; 		 ;; of the session, specify the number of lines here.
; 		 w3-telnet-header-length 4
; 		 )
(require 'func-menu)
(define-key global-map 'f8 'function-menu)
(add-hook 'find-file-hooks 'fume-add-menubar-entry)
(define-key global-map "\C-cg" 'fume-prompt-function-goto)
(define-key global-map '(shift button3) 'mouse-function-menu)

(setq-default c-continued-brace-offset 0)
;(setq-default indent-tabs-mode f)  ;fv
(setq-default indent-tabs-mode nil)  ;fv
(setq-default tab-width 2)
(setq visable-bell t)
(setq truncate-lines t)
;(setq c-indent-level 2)
;(setq c-label-offset  -2)
;(setq c-argdecl-indent 2)
;(setq c++-hanging-braces t)

(setq indent-tabs-mode nil) ;fv
(setq c-auto-newline t) ; fv
(setq c-tab-always-indent t) ; fv

(global-set-key "\C-x\C-v" 'view-file)
(global-set-key "\M-\C-h" 'backward-kill-word)
(global-set-key "\C-/" 'backward-kill-word)
(global-set-key "\M-r" 'replace-string)
(global-set-key "\M-\C-r" 'query-replace)
(global-set-key "\C-x?" 'help-for-help)
(global-set-key "\C-h" 'backward-delete-char)
(global-set-key "\C-o" 'open-line)
(global-set-key "\C-x\C-6" 'hexl-find-file)
(global-set-key 'f35 'scroll-up)
(global-set-key 'f29 'scroll-down)
(global-set-key 'f27 'beginning-of-line)
(global-set-key 'r13 'end-of-buffer)
(global-set-key 'f33 'end-of-line)
(global-set-key 'f16 'x-copy-primary-selection)
(global-set-key 'f20 'x-kill-primary-selection)
(global-set-key 'f18 'x-yank-clipboard-selection)
(global-set-key 'f14 'undo)
(global-set-key 'f12 'call-last-kbd-macro)
(global-set-key 'insert 'overwrite-mode)  ; overstrike mode toggle
;(global-set-key '(control r) 'isearch-backward-regexp)
;(global-set-key '(control s) 'isearch-forward-regexp)
(global-set-key '(shift button2) 'x-insert-selection) ;put selection where the cursor is
;global-set-key '(backspace) 'backward-delete-char)
;(add-hook 'c++-mode-hook '(set-variable tab-width 2))
;;(add-hook 'c++-mode-hook '(set-variable indent-tabs-mode t))
;;(add-hook 'c++-mode-hook '(define-key c++-mode-map "\M-\C-h" 'backward-kill-word))  
;;(define-key c++-mode-map "\M-\C-h" 'backward-kill-word)
;;(add-hook 'c-mode-hook '(define-key c-mode-map "\M-\C-h" 'backward-kill-word))  
;;(define-key c-mode-map "\M-\C-h" 'backward-kill-word)
;;(add-hook 'c++-mode-hook '(define-key c++-mode-map "\M-\BS" 'backward-kill-word))
;;(add-hook 'c-mode-hook '(define-key c-mode-map "\M-\BS" 'backward-kill-word))
;;(add-hook 'c++-mode-hook '(define-key c++-mode-map "\C-h" 'backward-delete-char))
;;(define-key c++-mode-map "\C-h" 'backward-delete-char)
;;(add-hook 'c-mode-hook '(define-key c-mode-map "\C-h" 'backward-delete-char))
;;(define-key c-mode-map "\C-h" 'backward-delete-char)
;;(add-hook 'c++-mode-hook '(define-key c++-mode-map "\BS" 'backward-delete-char))
;;(add-hook 'c-mode-hook '(define-key c-mode-map "\BS" 'backward-delete-char))
;;(add-hook 'c++-mode-hook '(define-key c++-mode-map "\C-." 'tab-to-tab-stop))
;;(define-key c++-mode-map "\C-." 'tab-to-tab-stop)
;;(add-hook 'c-mode-hook '(define-key c-mode-map "\C-." 'tab-to-tab-stop))
;;(define-key c-mode-map "\C-." 'tab-to-tab-stop)

;(defun untabify-buffer ()
;  ('mark-whole-buffer)
;  ('untabify)
;)

(add-hook 'c++-mode-hook
     '(lambda ()
        (define-key c++-mode-map [(delete)] 'delete-char)
        (setq c-basic-offset 9)                    ;; for debugging
        (define-key c++-mode-map "\M-\C-h" 'backward-kill-word)
        (define-key c++-mode-map "\C-o" 'open-line)
        ;; (define-key c++-mode-map "\C-i" 'self-insert-command)
        (define-key c++-mode-map "\C-i" 'tab-to-tab-stop)
        (define-key c++-mode-map [(again)] 'call-list-kbd-macro)
        ;;(define-key c++-mode-map "#" 'self-insert-command)
        (define-key c++-mode-map "*" 'self-insert-command)
        (define-key c++-mode-map "," 'self-insert-command)
        (define-key c++-mode-map "/" 'self-insert-command)
        (setq c-basic-offset 11)                  ;; for debugging
        
        ;; this line should turn return into a newline just
        ;; in case I forget to hit ^J at the end of each line
        (define-key c++-mode-map "\C-m" 'newline-and-indent)

        ;; these lines were changed added to set up the
        ;; autoindent, etc. features of emacs
        ;;(define-key c++-mode-map ":" 'self-insert-command)
        ;;(define-key c++-mode-map "{" 'self-insert-command)
        ;;(define-key c++-mode-map "}" 'self-insert-command)
        (define-key c++-mode-map ";" 'self-insert-command)
        (define-key c++-mode-map "\C-j" 'newline-and-indent)
        (define-key c++-mode-map "{" 'c-electric-brace)
        (define-key c++-mode-map "}" 'c-electric-brace)
        (define-key c++-mode-map "<" 'c-electric-lt-gt)
        (setq c-basic-offset 13)                   ;; for debugging
        (define-key c++-mode-map ">" 'c-electric-lt-gt)
        ;; (define-key c++-mode-map ";" 'c-electric-semi&comma)
        (define-key c++-mode-map ":" 'c-electric-colon)
        (define-key c++-mode-map "#" 'c-electric-pound)
        (define-key c++-mode-map "\M-\C-i" 'indent-according-to-mode)

        ;; Make F9 be `C++ Indent expression'.
        (global-set-key 'f9 "\M-\C-q")

        ;; Make F10 be untabify entire buffer
        (global-set-key 'f10 'untabify)

        (setq c-electric-pound-behavior nil)

        ;; this line prevents insertion of tab characters
        (setq indent-tabs-mode nil)

        (setq c-basic-offset 15)                   ;; for debugging
        (setq c-basic-offset 7)
        (setq c-tab-always-indent t)
        (setq c-auto-newline t)
        ;;; these lines were added to try to fix the 
        ;;; c-offsets-alist to handle auto indent
        (setq c-offsets-alist
          (append
             '((substatement          . +  )
               (substatement-open     . 0  )
               (member-init-intro     . +  )
               (member-init-cont      . 0  )
               (case-label            . +  )
               (inclass               . ++ )
               (inline-open           . ++ )
               (block-open            . 0  )
               (block-close           . 0  )
               (stream-op             . c-lineup-streamop  )
               (statement-block-intro . +  )
               (statement-case-intro  . +  )
               (statement-case-open   . 0  )
               (else-clause           . 0  )
               (statement             . 0  )
               (statement-cont        . ++ )
               (defun-block-intro     . +  )
               (friend                . -  )
               (access-label          . -  )
               (arglist-intro         . 
                                      c-lineup-arglist-intro-after-paren)
               (arglist-cont          . 0  )
               (arglist-cont-nonempty . c-lineup-arglist )
               (arglist-close         . c-lineup-arglist )
               )
             c-offsets-alist )
          )
        (setq c-basic-offset 17)                    ;; for debugging

        ;; these lines were added to try to get electric
        ;; brace to work in the desired manner
        (setq c-hanging-braces-alist
              '((substatement-open before after)
                (block-open before after)
                (defun-open before after)
                (defun-close before after)
                (class-close before)
                (block-close . c-snug-do-while)
                (brace-list-close )
                (brace-list-open before)
                ))

        ;; these lines were added to try to get the
        ;; electric colon to work properly
        (setq c-basic-offset 19)                     ;; for debugging
        (setq c-cleanup-list
              '(scope-operator
                empty-defun-braces
                ))
        (setq c-hanging-colons-alist
              '((member-init-intro before)
                ))

        (setq c-basic-offset 21)                     ;; for debugging
;        (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72))
        (setq tab-stop-list '(2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 
                                44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80))
        (setq c-basic-offset 2)
        (setq-default tab-width 2)))

(add-hook 'c-mode-hook
	  '(lambda ()
			 (define-key c-mode-map "\M-\C-h" 'backward-kill-word)
	     (define-key c-mode-map "\C-o" 'open-line)
			 ;; (define-key c-mode-map "\C-i" 'self-insert-command)
			 (define-key c-mode-map "\C-i" 'tab-to-tab-stop)
			 (define-key c-mode-map [(again)] 'call-list-kbd-macro)
			 (define-key c-mode-map "#" 'self-insert-command)
			 (define-key c-mode-map "*" 'self-insert-command)
			 (define-key c-mode-map "," 'self-insert-command)
			 (define-key c-mode-map "/" 'self-insert-command)
			 (setq indent-tabs-mode nil)
			 (setq-default tab-width 2)))


(add-hook 'perl-mode-hook
	  '(lambda ()
			 (define-key perl-mode-map "\M-\C-h" 'backward-kill-word)
			 (define-key perl-mode-map "\C-i" 'self-insert-command)
			 (define-key perl-mode-map ";" 'self-insert-command)
			 (define-key perl-mode-map "}" 'self-insert-command)
			 (define-key perl-mode-map [(again)] 'call-list-kbd-macro)
;			 (setq indent-tabs-mode f)  ;fv
			 (setq indent-tabs-mode nil)  ;fv
			 (setq-default tab-width 2)))

;;--------Begin Fontlock init------------------------
(add-hook 'c-mode-hook 'turn-on-font-lock)
(add-hook 'c++-mode-hook 'turn-on-font-lock)
(add-hook 'dired-mode-hook 'turn-on-font-lock)
(add-hook 'emacs-lisp-mode-hook	'turn-on-font-lock)
(add-hook 'awk-mode-hook 'turn-on-font-lock)
(add-hook 'perl-mode-hook 'turn-on-font-lock)
;;--------End Fontlock init------------------------


;;If you would like to add color to this, add the following to your .emacs
;;file: 
;;
;;;; From hilit19.el
;;;;
;; (cond (window-system
;;        (setq hilit-mode-enable-list  '(not text-mode)
;;              hilit-background-mode   'light
;;              hilit-inhibit-hooks     nil
;;              hilit-inhibit-rebinding nil)
;; 
;;        (require 'hilit19)
;;	))

 (setq
  x-fixed-font-alist
  '("Font Menu"
    ("Misc"
     ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1")
     ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1")
     ("lucida 13"
      "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1")
     ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1")
     ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1")
     ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1")
     ("")
     ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1")
     ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1")
     ("clean 8x10" "-schumacher-clean-medium-r-normal--*-100-*-*-c-*-*-1")
     ("clean 8x16" "-schumacher-clean-medium-r-normal--*-160-*-*-c-*-*-1")
     ("")
     ("sony 8x16" "-sony-fixed-medium-r-normal--16-120-100-100-c-80-*-1")
     ("")
     ("-- Courier --")
     ("Courier 10" "-adobe-courier-medium-r-normal--*-100-*-*-m-*-*-1")
     ("Courier 12" "-adobe-courier-medium-r-normal--*-120-*-*-m-*-*-1")
     ("Courier 14" "-adobe-courier-medium-r-normal--*-140-*-*-m-*-*-1")
     ("Courier 18" "-adobe-courier-medium-r-normal--*-180-*-*-m-*-*-1")
     ("Courier 18-b" "-adobe-courier-bold-r-normal--*-180-*-*-m-*-*-1")
     )))

;;-------End of highlighting init------------------------------------
;;

(autoload 'sc-cite-original     "supercite" "Supercite 3.1" t)
(autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t)

(define-key global-map 'delete 'delete-char)
(define-key lisp-mode-map 'delete 'delete-char)
(define-key emacs-lisp-mode-map 'delete 'delete-char)
;(define-key c-mode-map 'delete 'delete-char)
;(define-key c++-mode-map 'delete 'delete-char)
(define-key text-mode-map 'delete 'delete-char)
(define-key indented-text-mode-map 'delete 'delete-char)
(define-key minibuffer-local-map 'delete 'delete-char)

;(global-set-key 'backspace 'backward-delete-char)
;(define-key lisp-mode-map 'backspace 'backward-delete-char)
;(define-key emacs-lisp-mode-map 'backspace 'backward-delete-char)
;(define-key c-mode-map 'backspace 'backward-delete-char)
;(define-key c++-mode-map 'backspace 'backward-delete-char)
(define-key isearch-mode-map 'backspace 'isearch-delete-char)
;(define-key text-mode-map 'backspace 'backward-delete-char)
;(define-key indented-text-mode-map 'backspace 'backward-delete-char)
;(define-key minibuffer-local-map 'backspace 'backward-delete-char)
(setq allow-deletion-of-last-visible-screen t)
(setq explicit-shell-file-name "ksh")
(load-library "saveplace")
(setq-default save-place t)

(cond
 ((and (string-match "Lucid" emacs-version)
       (boundp 'emacs-major-version)
       (= emacs-major-version 19)
       (>= emacs-minor-version 10))
  (require 'font-lock)
  (setq-default highlight-paren-expression t)
  (setq-default overwrite-mode nil)
;  (setq-default teach-extended-commands-p t)
;  (setq-default complex-buffers-menu-p nil)
  (setq-default buffers-menu-max-size 15)
  (setq-default case-fold-search t)
  (blink-paren 1)
;  (pending-delete 1)

  (remove-hook 'lisp-mode-hook 'turn-on-font-lock)
  (add-hook 'ada-mode-hook		'turn-on-font-lock)
  (add-hook 'c-mode-hook 'turn-on-font-lock)
  (add-hook 'c++-mode-hook 'turn-on-font-lock)
  (add-hook 'dired-mode-hook	'turn-on-font-lock)
  (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
  (add-hook 'lisp-mode-hook	'turn-on-font-lock)
  (add-hook 'perl-mode-hook	'turn-on-font-lock)
  (add-hook 'postscript-mode-hook	'turn-on-font-lock)
  (add-hook 'tex-mode-hook		'turn-on-font-lock)
  (add-hook 'texinfo-mode-hook	'turn-on-font-lock)
  (setq c-font-lock-keywords c-font-lock-keywords-2)
  (setq c++-font-lock-keywords c++-font-lock-keywords-2)
  (setq lisp-font-lock-keywords lisp-font-lock-keywords-2)
  ))

(put 'downcase-region 'disabled nil)

(put 'upcase-region 'disabled nil)

;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (= emacs-major-version 20))
       (fboundp 'load-options-file))
  (load-options-file "/homes/iacrabbe/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

Reply to: