;;; Configuration file for XEmacs, tested only with 21.* ;(push (expand-file-name "~/gnu/share/emacs/site-lisp") load-path) ;(push (expand-file-name "~/emacs/czx/util/") load-path) ;(push (expand-file-name "~/emacs/czx/emacs/") load-path) (push (expand-file-name "~/emacs/") load-path) ;;; Set directory with host configuration (setq hostconf-directory (or (getenv "HOSTCONF") "~/.conf")) ;;; Load the local configuration (defun host-load (name) "Load file from host configuration directory, if it exists" (let ((_file (locate-file name (list hostconf-directory) '(".elc" ".el")))) (and _file (load _file)))) (host-load "pre-local") ;(require 'czech) (if (featurep 'mule) (progn (register-input-method "czech" "Czech" 'quail-use-package "CZ" "\"Standard\" Czech keyboard in the Windoze NT 105 keys version." "quail/czech") (register-input-method "czech-qwerty" "Czech" 'quail-use-package "CZ" "\"Standard\" Czech keyboard in the Windoze NT 105 keys version, QWERTY layout." "quail/czech") (register-input-method "czech-prog-1" "Czech" 'quail-use-package "CZ" "Czech (non-standard) keyboard for programmers #1." "quail/czech") (register-input-method "czech-prog-2" "Czech" 'quail-use-package "CZ" "Czech (non-standard) keyboard for programmers #2." "quail/czech") (register-input-method "czech-prog-3" "Czech" 'quail-use-package "CZ" "Czech (non-standard) keyboard for programmers #3." "quail/czech"))) ;; Customization file (setq custom-file "~/emacs/custom") (load custom-file) ;; We don't need toolbar - keys are faster than mouse (set-specifier default-toolbar-visible-p nil) ;; Initialize Czech environment (if (or (and (boundp 'mule-tty-win-initted) mule-tty-win-initted) (and (boundp 'mule-x-win-initted) mule-x-win-initted)) (progn (cond (mule-tty-win-initted (set-keyboard-coding-system 'iso-8859-2) (set-terminal-coding-system 'iso-8859-2)) (mule-x-win-initted ;; Czech hack - map dead-iota to + in quail mode (require 'hack-quail)) ) (set-language-environment "Czech") (setq default-input-method "czech-prog-2") )) ;;; Define my global keybindings (load "xemacskey") ;;; Add my paths to info directories (if (boundp 'Info-directory-list) (progn (if (file-exists-p "/pkg/info") (push "/pkg/info" Info-directory-list)) (if (file-exists-p "~/gnu/info") (push "~/gnu/info" Info-directory-list)) )) ;; Cyclebuffer - another method of switching buffers (autoload 'cyclebuffer-forward "cyclebuffer" "cycle forward" t) (autoload 'cyclebuffer-backward "cyclebuffer" "cycle backward" t) ;; Tildify - hard spaces in text (autoload 'tildify-buffer "tildify" t) (autoload 'tildify-region "tildify" t) ;; Completion (require 'completer) ;; Filladapt mode in all text buffers (add-hook 'text-mode-hook 'filladapt-mode) (autoload 'filladapt-mode "filladapt" "Toggle Filladapt minor mode" t) ;; Haskell (autoload 'haskell-mode "haskell-mode" "Major mode for editing Haskell scripts." t) (autoload 'literate-haskell-mode "haskell-mode" "Major mode for editing literate Haskell scripts." t) (add-hook 'haskell-mode-hook 'turn-on-haskell-font-lock) (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan) ;(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) ;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent) (add-hook 'haskell-mode-hook 'turn-on-haskell-hugs) ;; Setting major modes according to file extensions (setq auto-mode-alist (append '(("\\.h\\'" . c++-mode) ("\\.dat\\'" . fundamental-mode) ("\\.s?html\\.?.*\\'" . html-mode) ("\\.java\\'" . jde-mode) ("\\.v\\'" . verilog-mode) ("\\.[hg]s\\'" . haskell-mode) ("\\.hi\\'" . haskell-mode) ("\\.l[hg]s\\'" . literate-haskell-mode) ("\\.vhdl?\\'" . vhdl-mode)) auto-mode-alist)) ;;; AUCTeX settings (require 'tex-site) (require 'bib-cite) (defun pekon-latex () ; (x-symbol-mode) (local-set-key [(shift f1)] "\C-hidmAUCTeX\r") (local-set-key [(meta f1)] "\C-hidmLaTeX\r") (local-set-key [(f9)] "\C-x\C-s\C-c\C-c\r") (local-set-key [(shift f9)] (lambda () (interactive) (shell-command "etags *.{tex,ltx}")))) ;(setq TeX-command-list (append TeX-command-list '(("CSLaTeX" "cslatex '\\nonstopmode\\input{%t}'" TeX-run-LaTeX nil t )))) ;;; CC-modes (autoload 'tag-complete-symbol "etags" "complete tag" t) (quietly-read-abbrev-file) (defun pekon-c-mode () (abbrev-mode 1) (setq c-hungry-delete-key t) (setq c-basic-offset 2) (local-set-key [(meta tab)] 'tag-complete-symbol) (local-set-key [(shift f9)] (lambda () (interactive) (shell-command "etags *.[ch]")))) (defun pekon-c++-mode () (c-set-offset 'inclass '+) (local-set-key [(shift f9)] (lambda () (interactive) (shell-command "etags *.{cc,cpp,C,h}")))) (defun pekon-java-mode () (make-variable-buffer-local 'c-basic-offset) (setq c-basic-offset 4) (abbrev-mode 1) (local-set-key [(shift f9)] (lambda () (interactive) (shell-command "etags *.java")))) ;; Dired mode (defun pekon-kill-dired nil "Kill all buffers in dired-mode" (interactive) (let ((l (buffer-list))) (while l (if (eq 'dired-mode (cdr (assoc 'major-mode (buffer-local-variables (car l))))) (kill-buffer (car l))) (setq l (cdr l)) ))) (defun pekon-dired () (define-key dired-mode-map [mouse-2] 'dired-mouse-view-file)) (add-hook 'dired-mode-hook 'pekon-dired) (setq dired-guess-shell-alist-user '(("\\.tgz$" "tar tzf") ("\\.dtx$" "latex") ("\\.ps$" "gv") ("\\.ltx$" "cslatex"))) ;; Set my private SGML catalog file ;(setq sgml-catalog-files (append sgml-catalog-files '("/usr/doc/doc-html-w3/html4/HTML4.cat"))) ;; Minor modes ;; Font-lock (require 'font-lock) (add-hook 'font-lock-mode-hook 'turn-on-lazy-shot) ;;; function menus in source files (require 'func-menu) (add-hook 'find-file-hooks 'fume-add-menubar-entry) ;; Do we have pgp ? (setq pekon-has-pgp (file-directory-p "~/.pgp")) ;;; Emacs/W3 Configuration ;(require 'w3-auto "w3-auto") ;;; Diary,calendar and appointments ;(display-time) ;(setq global-mode-string "") ;; Decompress compressed files on opening (jka-compr-install) ;; X-Symbol ;(if (eq (console-type) 'x) (x-symbol-initialize)) ;; Gnus autoload (autoload 'gnus "gnus" "gnus newsreader" t) ;;; Misc function for testing MULE buffers (defun charsets-in-buffer () "Return list of charsets in the buffer." (interactive) (message "%S" (charsets-in-region (point-min) (point-max)))) ;;; Version control (require 'vc-hooks) ;;; Load pending-delete-mode (require 'pending-del) ;; and disable it, forever (defun pending-delete-mode (&optional ignored) "I do not want pending delete mode. _Never_." nil) ;;; Settings for X window system (cond ((or (not (fboundp 'device-type)) (equal (device-type) 'x)) (progn ;; Disable progress bar (fmakunbound 'progress) ;; Shift+movement selects blocks (require 'pc-select) (pc-select-mode) ;; Enable mouse wheel if present (if (fboundp 'mwheel-install) (mwheel-install)) ;; Indication of overwrite mode (setq pekon-overwrite overwrite-mode) (add-hook 'post-command-hook (function (lambda () (if pekon-overwrite (if (not overwrite-mode) (progn (set-face-background 'text-cursor "green") (setq pekon-overwrite nil))) (if overwrite-mode (progn (set-face-background 'text-cursor "red") (setq pekon-overwrite t)))))))) )) ; Settings for X window system (host-load "post-local") ;; Local Variables: ;; coding: iso-2022-8 ;; End: