18 Sep, 2004
;;Andy Chase's .emacs file, placed here primarily for backup purposes.
;;Fix Tramp for now:
(setq process-connection-type t)
;; append some additional paths to load-path
(setq load-path
(cons (expand-file-name "~/emacs.d/site-lisp") load-path))
(setq load-path
(cons (expand-file-name "~/emacs.d/site-lisp/psgml") load-path))
(setq load-path
(cons (expand-file-name "~/emacs.d/site-lisp/w3/lisp") load-path))
(setq load-path
(cons (expand-file-name "/Applications/Emacs.app/Contents/Resources/lisp") load-path))
(setq load-path
(cons (expand-file-name "/Applications/Emacs.app/Contents/Resource/site-lisp") load-path))
;;Set up Inform mode
(autoload 'inform-mode "inform-mode" "Inform editing mode." t)
(autoload 'inform-maybe-mode "inform-mode" "Inform/C header editing mode.")
(setq auto-mode-alist
(append '(("\\.h\\'" . inform-maybe-mode)
("\\.inf\\'" . inform-mode))
auto-mode-alist))
(add-hook 'inform-mode-hook 'turn-on-font-lock)
;; Set up Malyon
(require 'malyon)
;; Set up w3
(require 'w3-auto)
;; Set up php-mode
(require 'php-mode)
;; Set up python mode
(require 'python-mode)
(setq auto-mode-alist
(append '(("\\.py\\'" . python-mode))
auto-mode-alist))
;; To use abbrev-mode, add lines like this:
(add-hook 'php-mode-user-hook
'(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))
;; Set foreground and background colors:
(setq default-frame-alist
(nconc '((foreground-color . "White")
(background-color . "dark slate gray"))
default-frame-alist))
(add-to-list 'default-frame-alist '(font . "-apple-andale mono-medium-r-normal--14-0-75-75-m-0-mac-roman"))
;;rmail settings
(setenv "MAILHOST" "mail.greyledge.net")
(setq rmail-primary-inbox-list '("po:achase")
rmail-pop-password-required t)
;; Autoload ange-ftp
(require 'ange-ftp)
;; Custom programming functions
;;Insert comment line for Inform programming
(defun inform-comment-line ()
"Insert comment separator line at point."
(interactive)
(insert (format "!=============================================================================
")
)
)
;;Keybinding for inform comment line
(define-key inform-mode-map "\C-c\c" 'inform-comment-line)
;;Set up mappings for System identifiers-- URLS to local DTDs:
;; (Many thanks to David Megginson for this code, found at
;; http://www.oasis-open.org/cover/psgml120FIX.html )
(defvar sgml-sysid-alist '()
"Association list of system IDs and actual file paths.")
(defun sgml-insert-mapped-sysid (sysid)
(let ((mapping (assoc sysid sgml-sysid-alist)))
(cond (mapping
(insert-file (cadr mapping))
t)
(t nil))))
(setq sgml-sysid-resolve-functions
(cons (function sgml-insert-mapped-sysid)
(and (boundp 'sgml-sysid-resolve-functions)
sgml-sysid-resolve-functions)))
(setq sgml-sysid-alist
'(("http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
"/sw/share/xml/dtd/docbookx/4.2.0/docbookx.dtd")
("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
"/sw/share/xml/dtd/xhtml/xhtml1-strict.dtd")
("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
"/sw/share/xml/dtd/xhtml/xhtml1-strict.dtd")
("http://www.w3.org/TR/html4/strict.dtd"
"~/xml/html4/strict.dtd")
("http://inresonance.com/dtd/xrdl.dtd"
"~/xml/xrdl01/xrdl.dtd")
))
;; Autoload PSGML:
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
(require 'psgml)
(add-to-list 'auto-mode-alist '("\\.html" . sgml-mode))
(add-to-list 'auto-mode-alist '("\\.xhtml" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.adp" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.xml" . xml-mode))
(add-to-list 'auto-mode-alist '("\\.wml" . xml-mode))
(add-to-list 'sgml-catalog-files "~/xml/xhtml/xhtml1.soc")
(add-to-list 'sgml-catalog-files "/sw/share/xml/dtd/docbookx/4.2.0/docbook.cat")
(add-to-list 'sgml-catalog-files "~/xml/html4/HTML4.catalog")
;(add-to-list 'sgml-catalog-files "/home/andy/.sgml/dtd/catalog")
;; Configure font locking for PSGML:
(setq sgml-markup-faces '((start-tag . font-lock-function-name-face)
(end-tag . font-lock-function-name-face)
(comment . font-lock-comment-face)
(pi . bold)
(sgml . bold)
(doctype . bold)
(entity . font-lock-type-face)
(shortref . font-lock-function-name-face)))
(setq sgml-set-face t)
(setq-default sgml-indent-data t)
;; Some convenient key definitions:
;; (define-key sgml-mode-map "\C-c\C-x\C-e" 'sgml-describe-element-type)
;; (define-key sgml-mode-map "\C-c\C-x\C-i" 'sgml-general-dtd-info)
;; (define-key sgml-mode-map "\C-c\C-x\C-t" 'sgml-describe-entity))))
;;auto-activate saved DTDs:
(setq sgml-auto-activate-dtd t)
;; enable font-lock in all modes that accept it
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
;;Let's try out some PSGML/DocBook customization:
(make-face 'sgml-comment-face)
(make-face 'sgml-start-tag-face)
(make-face 'sgml-end-tag-face)
(make-face 'sgml-entity-face)
(make-face 'sgml-doctype-face)
(make-face 'sgml-attrib-face)
(setq sgml-set-face t) ; without this, all SGML text is in same color
(setq sgml-markup-faces
'((comment . sgml-comment-face)
(start-tag . sgml-start-tag-face)
(end-tag . sgml-end-tag-face)
(doctype . sgml-doctype-face)
(entity . sgml-entity-face)
(attrib . sgml-attrib-face)))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auto-image-file-mode t nil (image-file))
'(column-number-mode t)
'(direct-print-region-use-command-dot-com t t)
'(gnus-nntp-server "news.pair.com")
'(gnus-secondary-servers nil)
'(inform-interpreter-command "/sw/bin/frotz")
'(jde-enable-abbrev-mode t)
'(mouse-wheel-mode t nil (mwheel))
'(php-manual-url "http://us2.php.net/manual/en/manual.php")
'(print-circle nil t)
'(print-continuous-numbering nil t)
'(printer-name "Shop LaserWriter 16/600")
'(rmail-enable-mime nil)
'(rmail-preserve-inbox t)
'(sgml-auto-insert-required-elements t t)
'(sgml-ignore-undefined-elements nil t)
'(sgml-insert-missing-element-comment nil t)
'(sgml-live-element-indicator nil t)
'(sgml-warn-about-undefined-elements t t)
'(spell-command "/sw/bin/aspell")
'(svn-process-cmd "/sw/bin/svn")
'(tab-stop-list (quote (2 4 6 8 10 16 24 32 40 48 56 64 72 80 88 96 104 112 120)))
'(tab-width 4)
'(tex-alt-dvi-print-command "lpr -d")
'(tex-dvi-print-command "lpr -d")
'(xsl-process-command (quote ("java -jar /Users/andy/xml/saxon/saxon.jar -o %o %i %s" "/Users/andy/xml/fop-0.20.5/fop.sh -xsl /Users/andy/xml/xsl/docbook/fo/docbook.xsl -xml %i -pdf %o"))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(font-lock-comment-face ((((class color) (background dark)) (:foreground "antiquewhite3" :slant oblique))))
'(font-lock-function-name-face ((t (:foreground "medium turquoise" :weight bold))))
'(font-lock-keyword-face ((((class color) (background dark)) (:foreground "honeydew3"))))
'(font-lock-string-face ((((class color) (background dark)) (:foreground "LightSteelBlue1"))))
'(font-lock-variable-name-face ((((class color) (background dark)) (:foreground "skyblue2"))))
'(sgml-attribute-face ((t (:foreground "yellow"))))
'(sgml-comment-face ((t (:foreground "AntiqueWhite3" :slant oblique))) t)
'(sgml-end-tag-face ((t (:foreground "lightskyblue3" :weight semi-bold))) t)
'(sgml-entity-face ((t (:foreground "paleturquoise2" :weight semi-bold))) t)
'(sgml-start-tag-face ((t (:foreground "lightskyblue3" :weight semi-bold))) t)
'(vhdl-font-lock-enumvalue-face ((((class color) (background dark)) (:foreground "darkslategray3")))))
(setq sgml-xml-declaration "/usr/share/sgml/docbook-dsssl/dtds/decls/xml.dcl")
(setq sgml-custom-dtd '
(
; ( "RSS 0.91"
; "\n" )
( "XRDL 0.1 Document"
"\n" )
( "XHTML 1.0 Strict"
"\n" )
( "XHTML 1.0 Transitional"
"\n" )
( "XHTML 1.0 Frameset"
"\n" )
( "HTML 4.01 Strict"
"")
( "FileMaker Pro XML Result"
"\n" )
; ( "WML 1.1"
; "\n" )
( "DOCBOOK XML 4.2 - Article"
"\n")
( "DOCBOOK XML 4.2 - Book"
"\n")
)
)
;;Fix the delete key:
(global-set-key (kbd "") `delete-char)
(setq delete-key-deletes-forward t)
;;;;Add the w3 client
;;(setq load-path (cons "d:/temp/w3/lisp" load-path))
;;(require 'w3-auto)
;;Set up cygwin-mount: (Disable on UNIX)
;(setenv "PATH" (concat "d:\\cygwin\\bin;" (getenv "PATH")))
;(setq exec-path (cons "d:\\cygwin\\bin\\" exec-path))
;(require 'cygwin-mount)
;(cygwin-mount-activate)
;;Use cygwin instead of POS DOS prompt
;(add-hook 'comint-output-filter-functions
; 'shell-strip-ctrl-m nil t)
;(add-hook 'comint-output-filter-functions
; 'comint-watch-for-password-prompt nil t)
;(setq explicit-shell-file-name "bash.exe")
;; For subprocesses invoked via the shell
;; (e.g., "shell -c command")
;(setq shell-file-name explicit-shell-file-name)
;;Set up JDE and related things: (Currently disabled on OS X)
; (add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site/jde/lisp"))
;(add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site/semantic"))
;(add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site/speedbar"))
;(add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site/elib"))
;(add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site/eieio"))
;(setq jde-global-classpath
; '("." "C:/java1.4/lib/rt.jar"))
;(setenv "JAVA_HOME" "c:\java1.4")
;(require 'jde)
;;Turn on JDE abbreviation mode:
;(setq dbe-enable-abbrev-mode t)
;;Set up Python-mode
(add-to-list 'load-path (expand-file-name "d:/cygwin/home/default/emacs/site"))
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
;; Always Edit New files using Unix-style newline characters:
;;(setq default-buffer-file-coding-system 'undecided-unix)
;;; Emacs/W3 Configuration
(setq load-path (cons "/Users/andy/emacs.d/site-lisp/w3/share/emacs/site-lisp" load-path))
(condition-case () (require 'w3-auto "w3-auto") (error nil))
;; DTD mode
(autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs." t)
(autoload 'dtd-etags "tdtd"
"Execute etags on FILESPEC and match on DTD-specific regular expressions."
t)
(autoload 'dtd-grep "tdtd" "Grep for PATTERN in files matching FILESPEC." t)
;; Turn on font lock when in DTD mode
(add-hook 'dtd-mode-hooks
'turn-on-font-lock)
(setq auto-mode-alist
(append
(list
'("\\.dcl$" . dtd-mode)
'("\\.dec$" . dtd-mode)
'("\\.dtd$" . dtd-mode)
'("\\.ele$" . dtd-mode)
'("\\.ent$" . dtd-mode)
'("\\.mod$" . dtd-mode))
auto-mode-alist))
;;End DTD mode
;; XSL mode
(autoload 'xsl-mode "xslide" "Major mode for XSL stylesheets." t)
;; Turn on font lock when in XSL mode
(add-hook 'xsl-mode-hook
'turn-on-font-lock)
(setq auto-mode-alist
(append
(list
'("\\.fo" . xsl-mode)
'("\\.xsl" . xsl-mode))
auto-mode-alist))
;; Uncomment if using abbreviations
;; (abbrev-mode t)
;;Add html helper mode
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
;;Add html helper mode JSP extensions:
(add-hook 'html-helper-load-hook (function (lambda () (load "jsp-html-helper-mode.el"))))
;;Add hook for psvn (subversion)
(require 'psvn)