(defun sgml-html-galeon-file () "Preview the file for the current buffer in Galeon." (interactive) (highlight-headers-follow-url-galeon (concat "file:" (buffer-file-name (current-buffer))))) (defun highlight-headers-follow-url-galeon (url) (message "Sending %s to Galeon..." url) (save-excursion (set-buffer (get-buffer-create "*Shell Command Output*")) (erase-buffer) (if (equal 0 (apply 'call-process "galeon" nil t nil (list url))) ;; it worked nil ;; it didn't work, so start a new Netscape process. (call-process "galeon" nil 0 nil url))) (message "Sending %s to Galeon... done" url)) (global-set-key [f12] 'sgml-html-galeon-file) (autoload 'mwheel-install "mwheel" "Enable mouse wheel support.") (mwheel-install) ; psgml stuff (autoload 'sgml-mode "psgml" "Major mode to edit SGML files" t) (require 'psgml) (setq sgml-always-quote-attributes t ; expected by many clients sgml-auto-insert-required-elements t sgml-indent-data nil sgml-indent-step 2 sgml-auto-activate-dtd t ; preload dtd sgml-omittag nil sgml-shorttag nil sgml-recompile-out-of-date-cdtd 'ask sgml-set-face window-system sgml-validate-command "nsgmls -s %s %s") (setq sgml-set-face t) (setq-default sgml-indent-data t) ; menus for creating new documents (setq sgml-custom-dtd '( ( "HTML 2.0" "" ) ( "HTML 2.0 Level 1" "" ) ( "HTML 3.0" "") ( "HTML 4.01 Final" "") ) ) ;(defun html-mode () ; (interactive) ; (sgml-mode) ; (make-local-variable 'sgml-declaration) ; (make-local-variable 'sgml-default-doctype-name) ; (setq sgml-declaration "/usr/local/lib/sgml/html.decl" ; sgml-default-doctype-name "html" ; sgml-indent-step 0 ; sgml-indent-data nil ; sgml-minimize-attributes nil ; sgml-omittag t ; sgml-shorttag t)) (if window-system (progn (setq sgml-markup-faces '((start-tag . font-lock-keyword-face) (end-tag . font-lock-keyword-face) (comment . font-lock-comment-face) (pi . font-lock-string-face) (sgml . font-lock-reference-face) (doctype . font-lock-variable-name-face) (entity . font-lock-function-name-face) (shortref . font-lock-type-face))) (add-hook 'sgml-mode-hook (function (lambda () (require 'font-lock) (font-lock-mode) ))))) (add-to-list 'sgml-catalog-files "/usr/local/share/sgml/docbook/4.1/catalog") (add-to-list 'sgml-catalog-files "/usr/local/share/sgml/html/catalog") (add-to-list 'sgml-catalog-files "/usr/local/share/sgml/iso8879/catalog") (add-to-list 'sgml-catalog-files "/usr/local/share/sgml/jade/catalog") ; end psgml stuff (gnuserv-start) (setq text-mode-hook 'turn-on-auto-fill) (setq load-path (append load-path '("~/share/elisp/") '("/usr/local/share/emacs/21.2/site-lisp/dictionary") '("/usr/local/lib/xemacs-21.1.14/site-lisp/dictionary") )) (cond ((load "dictionary-init") ;; key bindings (global-set-key "\C-cs" 'dictionary-search) (global-set-key "\C-cm" 'dictionary-match-words) )) (autoload 'icmp-lookup "icmp-info" "Perform an ICMP lookup" t) (autoload 'icmp-list "icmp-info" "List ICMP types and codes" t) (autoload 'protocols-lookup "protocols" "Perform a protocol lookup" t) (autoload 'services-lookup "services" "Perform a service lookup" t) (load "knf.el") ; devel keymaps map (global-set-key [f5] 'font-lock-fontify-buffer) (global-set-key [f9] 'compile) (global-set-key [f10] 'gdb) (setq auto-mode-alist (cons '("^README$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.[Hh][Tt][Mm][Ll]?\\...$" . html-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.dwt$" . html-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("^\\.emacs$" . emacs-lisp-mode) auto-mode-alist)) (setq minibuffer-max-depth nil) ; load vc and define a handy macro (cond ((require 'vc) (defalias 'commit-with-log (read-kbd-macro "C-x C-s C-x v = C-TAB C-x C-q C-x 4 b RET C-TAB C-x -")) (global-set-key [f6] 'commit-with-log) )) ;; Mail stuff ; mutt email edition support (load "mutt-alias.el") ; load the mutt major mode and override some gnuserv stuff (cond ((load "post.el") (defadvice server-process-filter (after post-mode-message first activate) "If the buffer is in post mode, overwrite the server-edit message with a post-save-current-buffer-and-exit message." (if (eq major-mode 'post-mode) (message (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done.")))) ;; ; This is also needed to see the magic message. Set to a higher ;;;; ; number if you have a faster computer or read slower than me. ;;;; '(font-lock-verbose 1000) (setq server-temp-file-regexp "mutt-") (add-hook 'server-switch-hook (function (lambda() (cond ((string-match "Post" mode-name) (post-goto-body)))))) (add-hook 'post-mode-hook (lambda () (post-random-signature) (require 'smartsig) (setq smartsig-set-signature #'post-select-signature) (setq smartsig-abbrev-table 'post-mode-abbrev-table) (smartsig-add "emacs" "~/.sigs" "emacs" "xemacs" "elisp" "gnu") ;; (smartsig-add "mutt" "~/.sigs/mutt" "mutt" "mail" "email" "elkins") (abbrev-mode 1))) )) ; translation modules which lacks proper dictionnaries (cond ((load "translate.el") (autoload 'translate "translate" "A simple translator." t) (autoload 'translate-at-point "translate" "A simple translator." t) (autoload 'translate-phrase-from-region "translate" "A translator." t) (autoload 'translate-change-dictionary "translate" "A translator" t) (autoload 'translate-enter-translation "translate" "A translator" t) ;; If you like to have some of the functions bound to keys use the ;; following commands or a variation. (global-set-key '[(control c) t] 'translate) (global-set-key '[(control c) T] 'translate-at-point) (global-set-key '[(control c) E] 'translate-enter-translation) )) (custom-set-variables '(font-menu-ignore-scaled-fonts nil) '(mwheel-follow-mouse t) '(paren-mode (quote sexp) nil (paren)) '(default-input-method "latin-1-prefix") '(vc-initial-comment t) '(delete-key-deletes-forward t) '(buffers-menu-submenus-for-groups-p t) '(auto-compression-mode t nil (jka-compr)) '(column-number-mode t) '(default-toolbar-position (quote bottom)) '(send-pr:datadir "/etc/" t) '(overwrite-mode nil) '(vc-diff-switches "-u" t) '(c-echo-syntactic-information-p t) '(diff-switches "-u") '(mutt-alias-file-list (quote ("~/.mutt/aliases"))) '(bar-cursor 2) '(make-backup-files nil) '(font-menu-this-frame-only-p t) '(sgml-catalog-files (quote ("/usr/doc/en_US.ISO8859-1/share/sgml/catalog" "/usr/doc/share/sgml/catalog" "/usr/local/share/sgml/docbook/4.1/catalog" "/usr/local/share/sgml/html/catalog" "/usr/local/share/sgml/iso8879/catalog" "/usr/local/share/sgml/jade/catalog"))) '(case-fold-search t) '(tab-width 8) '(global-font-lock-mode t nil (font-lock)) '(show-paren-mode t nil (paren)) '(c-default-style (quote ((c++-mode . "k&r") (java-mode . "java") (other . "bsd")))) '(pending-delete-mode t nil (pending-del)) '(efs-use-passive-mode t) '(debug-on-error nil) '(truncate-lines nil) '(line-number-mode t) '(current-language-environment "Latin-1" t) '(transient-mark-mode t) '(complex-buffers-menu-p nil) '(blink-cursor-mode t nil (blink-cursor)) '(indent-tabs-mode nil) '(post-kill-quoted-sig nil)) (custom-set-faces '(widget-field-face ((((class grayscale color) (background dark)) (:background "gray10")))) '(post-multiply-quoted-text-face ((((class color) (background dark)) (:foreground "darkgreen")))) '(font-lock-string-face ((((class color) (background dark)) (:foreground "green")))) '(post-double-quoted-text-face ((((class color) (background dark)) (:foreground "blue")))) '(font-lock-doc-string-face ((((class color) (background dark)) (:foreground "lime green")))) '(modeline-buffer-id ((t (:foreground "blue2"))) t) '(font-lock-preprocessor-face ((((class color) (background dark)) (:foreground "blue")))) '(post-quoted-text-face ((((class color) (background dark)) (:foreground "magenta")))) '(font-lock-variable-name-face ((((class color) (background dark)) (:foreground "red")))) '(paren-match ((t (:background "blue"))) t) '(font-lock-warning-face ((((class color) (background dark)) (:foreground "red" :bold t)))) '(font-lock-keyword-face ((((class color) (background dark)) (:foreground "gold")))) '(font-lock-type-face ((((class color) (background dark)) (:foreground "purple")))) '(primary-selection ((t (:background "gray30"))) t) '(list-mode-item-selected ((t (:background "gray20"))) t) '(font-lock-comment-face ((((class color) (background dark)) (:foreground "gray39")))) '(font-lock-function-name-face ((((class color) (background dark)) (:foreground "steelblue1")))) '(isearch ((t (:background "turquoise4"))) t) '(highlight ((t (:background "darkgreen"))) t) '(zmacs-region ((t (:background "gray20"))) t)) ;; this is what the above should look like ;; (custom-set-faces ;; '(widget-field-face ((((class grayscale color) (background dark)) (:background "gray10")))) ;; '(post-multiply-quoted-text-face ((((class color) (background dark)) (:foreground "darkgreen")))) ;; '(font-lock-string-face ((((class color) (background dark)) (:foreground "green")))) ;; '(post-double-quoted-text-face ((((class color) (background dark)) (:foreground "blue")))) ;; '(font-lock-doc-string-face ((((class color) (background dark)) (:foreground "lime green")))) ;; '(modeline-buffer-id ((t (:foreground "blue2"))) t) ;; '(font-lock-preprocessor-face ((((class color) (background dark)) (:foreground "blue")))) ;; '(post-quoted-text-face ((((class color) (background dark)) (:foreground "magenta")))) ;; '(font-lock-variable-name-face ((((class color) (background dark)) (:foreground "red")))) ;; '(paren-match ((t (:background "blue"))) t) ;; '(font-lock-warning-face ((((class color) (background dark)) (:foreground "red" :bold t)))) ;; '(font-lock-keyword-face ((((class color) (background dark)) (:foreground "gold")))) ;; '(font-lock-type-face ((((class color) (background dark)) (:foreground "purple")))) ;; '(primary-selection ((t (:background "gray30"))) t) ;; '(list-mode-item-selected ((t (:background "gray20"))) t) ;; '(font-lock-comment-face ((((class color) (background dark)) (:foreground "gray39")))) ;; '(font-lock-function-name-face ((((class color) (background dark)) (:foreground "steelblue1")))) ;; '(isearch ((t (:background "turquoise4"))) t) ;; '(highlight ((t (:background "darkgreen"))) t) ;; '(zmacs-region ((t (:background "gray20"))) t)) (put 'narrow-to-region 'disabled nil) (put 'narrow-to-page 'disabled nil)