home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / EmacsTeX / emacs-patches / sample.emacs < prev   
Encoding:
Text File  |  1992-09-05  |  2.3 KB  |  92 lines

  1. (display "You are in a maze of twisty little editors, all different.")
  2.  
  3. ;
  4. ; Set some miscellaneous stuff
  5. ;
  6. ; (set-input-mode t nil)
  7. ; (setq manual-program "man")
  8. ; (setq backup-by-copying-when-linked t)
  9. ; (setq text-mode-hook 'turn-on-auto-fill)
  10. ; (setq term-setup-hook 'enable-arrow-keys)
  11.  
  12. ;
  13. ; Set the load path
  14. ;
  15.  
  16. (setq-default load-path '("/Unix/lib/emacs/lisp"
  17.               "/usr/lib/emacs/lisp" nil))
  18.  
  19. ;
  20. ; the setq objective-C-mode-hook is not absolutely necessary, but I use it in
  21. ; order to override the objc-mode defaults of /* */ comments at col 70something
  22. ;
  23.  
  24. (autoload 'objective-C-mode "objc-mode-no-untabify"
  25.           "Objective-C mode" t nil)
  26.  
  27. (setq objective-C-mode-hook '(lambda ()
  28.                                (setq comment-column 48)
  29. ;                   (setq objective-C-indent-level 4)
  30.                                (setq comment-start "//")
  31.                                (setq comment-end "")))
  32.  
  33. ;
  34. ; set all the special file types that are recognized and what modes
  35. ; they are tied to here
  36. ;
  37.  
  38. (setq auto-mode-alist (append   '(("\\.c" . objective-C-mode)
  39.                   ("\\.m" . objective-C-mode)
  40.                   ("\\.h" . objective-C-mode)
  41.                   ("\\.scm$" . scheme-mode)
  42.                   ("\\.sml$" . sml-mode)
  43.                   ("\\.sig$" . sml-mode))
  44.                 auto-mode-alist))
  45.  
  46. ; Don't scroll past EOF....
  47.  
  48. (defun next-line-no-mod (arg)
  49.   "Like next-line but does not add lines at eof."
  50.   (interactive "p")
  51.   (setq this-command 'next-line)
  52.   (next-line-internal arg)
  53.   )
  54.  
  55. ;
  56. ; Bind some keys for minimal gosmacs compatibility.
  57. ;
  58.  
  59. (global-set-key "\C-x\C-l"    'goto-line)
  60. (global-set-key "\C-c\C-e"    'compile)
  61. (global-set-key "\C-x\C-f"    'find-file)
  62. (global-set-key "\e\e"        'minibuffer-complete)
  63. (global-set-key "\M-p"        'prc-buffer)           ; print the buffer
  64. (global-set-key "\C-xn"        'other-window)
  65. (global-set-key "\C-xp"        '(lambda () (interactive) (other-window -1)))
  66. (global-set-key "\M-r"        'replace-string)
  67. (global-set-key "\C-n"        'next-line-no-mod)
  68.  
  69. ;
  70. ; No Trojan horses, please.
  71. ;
  72. (setq inhibit-local-variables t)
  73.  
  74. ;
  75. ; Define C indenting style
  76. ;
  77.  
  78. (setq c-indent-level 2)
  79. (setq c-continued-statement-offset 2)
  80. (setq c-continued-brace-offset 0)
  81. (setq c-brace-offset -2)
  82. (setq c-brace-imaginary-offset 0)
  83. (setq c-argdecl-indent 0)
  84. (setq c-label-offset -2)
  85.  
  86. ;
  87. ; prc utility stuff
  88. ;
  89.  
  90. (autoload 'prc-buffer "prc" "enscript buffer." t)
  91. (autoload 'prc-region "prc" "enscript region." t)
  92.