;; ;; File: .emacs ;; ;; Description: GNU-EMACS and XEmacs Settings ;; (if (string-match "XEmacs\\|Lucid" emacs-version) ;;{{{ XEMACS ;; ======= ;; ======= (progn ;;{{{ Startup Settings ;; ======================= (setq load-path (append (list "/home/chopp/emacs") load-path)) (setq load-path (append (list "/home/chopp/emacs/auctex") load-path)) (setq load-path (append (list "/home/chopp/emacs/misc") load-path)) (setq load-path (append (list "/home/chopp/emacs/reftex") load-path)) (setq load-path (append (list "/home/chopp/emacs/x-symbol") load-path)) (setq load-path (append (list "/home/chopp/emacs/tex-toolbar") load-path)) (setq load-path (append (list "/home/chopp/emacs/dictionary") load-path)) (add-to-list 'display-warning-suppressed-classes 'font) (setq-default Info-directory-list '("/usr/info" "/usr/local/info" "/usr/share/info" "/usr/X11R6/lib/xemacs/info" "/usr/share/texmf/teTeX/info" "/usr/lib/xemacs/xemacs-packages/info")) ;;}}} ;;{{{ Mode Settings ;; ------------ ;; ------------ ;;{{{ TeX Modes ;; ========= ;;{{{ Auc-TeX Mode ;; ------------ ;;{{{ Commandos und Menu ;; - - - - - - - - - - (setq-default TeX-view-style '(("^landscape$" "dvips -o %f -t landscape %d ; gv %f") ("." "dvips -o %f %d ; gv %f"))) (setq-default TeX-command-list (list (list "TeX" "tex '\\nonstopmode\\input %t'" 'TeX-run-TeX nil t) (list "LaTeX" "%l '\\nonstopmode\\input{%t}'" 'TeX-run-LaTeX nil t) (list "View" "%v " 'TeX-run-discard t nil) (list "View 2xA5" "a4toa5 %d /tmp/emacs_a5.dvi; dvips -t landscape /tmp/emacs_a5.dvi -o %f; rm /tmp/emacs_a5.dvi; gv %f" 'TeX-run-discard t nil) (list "Print" "%p " 'TeX-run-command t nil) (list "Queue" "%q" 'TeX-run-background nil nil) (list "File" "dvips %d -o %f " 'TeX-run-discard t nil) (list "File to 2xA5" "a4toa5 %d /tmp/emacs_a5.dvi; dvips -t landscape /tmp/emacs_a5.dvi -o %f; rm /tmp/emacs_a5.dvi" 'TeX-run-discard t nil) (list "BibTeX" "bibtex %s" 'TeX-run-BibTeX nil nil) (list "Index" "makeindex %s" 'TeX-run-command nil t) (list "Check" "lacheck %s" 'TeX-run-compile nil t) (list "Spell" "" 'TeX-run-ispell nil nil) (list "Other" "" 'TeX-run-command t t) (list "Makeinfo" "makeinfo %t" 'TeX-run-compile nil t) (list "AmSTeX" "amstex '\\nonstopmode\\input %t'" 'TeX-run-TeX nil t))) ;;}}} ;;{{{ Pfade ;; - - - (setq TeX-macro-global '("/usr/share/texmf/tex")) (setq TeX-auto-global "/home/chopp/bin/auctex/auto/") (setq TeX-macro-privat "~/tex-files/") (setq TeX-auto-privat "~/tex-files/") ;;}}} ;;{{{ andere Einstellungen ;; - - - - - - - - - - - (setq-default TeX-master nil) (setq TeX-parse-self t) ; (setq TeX-auto-save t) (setq TeX-open-quote "``") (setq TeX-close-quote "''") ;;}}} ;;{{{ Packages ;; - - - - - (require 'tex-site) (require 'font-latex) (require 'bib-cite) ;;}}} ;;{{{ Hooks ;; - - - (defun my-TeX-hook () "Mein TeX-Mode Hook!" (define-key TeX-mode-map "\C-cn" 'TeX-next-error)) (defun my-LaTeX-indent-and-fill-paragraph () "Does LaTeX-indent and fill-paragraph" (interactive) ; (fill-paragraph t) (LaTeX-fill-paragraph t) (LaTeX-indent-line) ) (add-hook `TeX-mode-hook 'my-TeX-hook) (add-hook `LaTeX-mode-hook '(lambda () (define-key LaTeX-mode-map "\C-cn" 'TeX-next-error) (define-key LaTeX-mode-map [(control a)] 'capitalize-word) (define-key LaTeX-mode-map [tab] 'my-LaTeX-indent-and-fill-paragraph) (make-frame-more-wide) (make-variable-buffer-local 'TeX-view-style) (function (lambda () (setq ispell-parser 'tex))) (auto-fill-mode t) (flyspell-mode t) )) (add-hook `LaTeX-mode-hook 'turn-on-bib-cite) ;;}}} ;;}}} ;;{{{ TeX XSymbol ;; ----------- ;(load "/usr/lib/xemacs/site-lisp/x-symbol/lisp/auto-autoloads") (setq x-symbol-exec-directory "/home/chopp/bin/x-symbol/exec") (load "/home/chopp/emacs/x-symbol/auto-autoloads") (load "/home/chopp/emacs/x-symbol/x-symbol-site") ;;}}} ;;{{{ TeX Toolbar ;; ----------- (load "tex-toolbar") ;;}}} ;;{{{ Ref-TeX Mode ;; ------------ (setq reftex-enable-partial-scans t) (setq reftex-save-parse-info t) (setq reftex-use-multiple-selection-buffers t) (setq reftex-plug-into-AUCTeX '(t t t t)) (setq bib-cite-use-reftex-view-crossref t) (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t) (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil) (autoload 'reftex-citation "reftex" "Do citation with RefTeX" t) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode ;;}}} ;;{{{ X-Font-Lock Mode (load "x-font-lock") ;(setq x-font-lock-default-font ; (try-font-name "-Adobe-Helv-Medium-R-*-*-14-*-*-*-*-*-iso8859-1")) ; (try-font-name "-ttf-courier new-*-*-*-*-*-*-*-*-*-*-*-1")) ;;}}} ;;{{{ BibTeX Mode (disabled) ... ; (load "bibtex") ;;}}} ;;}}} ;;{{{ Python-Mode ;; (require 'python-mode) (setq py-jump-on-exception nil) (defun my-python-mode-hook () ;; add my personal style and set it for the current buffer (turn-on-font-lock) (line-number-mode t) (setq tab-width 4) (define-key py-mode-map [f1] 'py-libindex-lookup-word-at-point) (define-key py-mode-map "\C-m" 'newline-and-indent)) (add-hook 'python-mode-hook 'my-python-mode-hook) ; Hot key help for Python ; Set the following two variables to point to library document ; root and indexfile. Note that py-lib-docroot can be a link to a ; local directory, or to http directory. (setq py-lib-docroot "file:/usr/doc/python-doc-1.5.1/html-docs/lib/") (setq py-lib-docindex "/usr/lib/xemacs/site-lisp/PyLibLookup-1.1/pylib15.idx") ; We use the browse-url package to do the hard work for us (autoload 'browse-url-at-point "browse-url" "Ask a WWW browser to load the URL at or before point." t) (autoload 'browse-url-of-buffer "browse-url" "Ask a WWW browser to display BUFFER." t) ; ; Then some elisp magic, could be cleaner ; A function to take the word at point and display HTML help on it. ; (defun py-libindex-lookup-word-at-point () (interactive) (save-excursion (let ((end) (word) (cmd) (buf)) (forward-word 1) (setq end (point)) (backward-word 1) (setq word (buffer-substring end (point))) (if (get-buffer "*lookup result*") (kill-buffer "*lookup result*")) (setq buf (get-buffer-create "*lookup result*")) (call-process "indexlookup.py" nil buf nil word py-lib-docroot py-lib-docindex) (set-buffer buf) (if (> (count-lines (point-min) (point-max)) 4) (browse-url-of-buffer buf) (search-backward ":/") (browse-url-at-point))))) ;;}}} ;;{{{ CC-Mode (require 'cc-mode) ;;}}} ;;{{{ Matlab-Mode ;; (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) (defun my-matlab-mode-hook () ;; add my personal style and set it for the current buffer (turn-on-font-lock) (line-number-mode t) (setq tab-width 4) (define-key py-mode-map "\C-m" 'newline-and-indent)) (add-hook 'matlab-mode-hook 'my-matlab-mode-hook) ;;}}} ;;{{{ Whitespace-Mode ;; ;(setq whitespace-chars 'tabs) ;(setq whitespace-install-toolbar-icon t) ;(setq whitespace-install-submenu t) ;(setq whitespace-toolbar-function 'whitespace-mode) (require 'whitespace-mode) ;;}}} ;;{{{ Folding-Mode ;; ============ (if (eq 'x (console-type)) (let () ; (setq fold-allow-overlays t) (require 'folding) (folding-mode-add-find-file-hook) ; (fold-install-hooks) (folding-add-to-marks-list 'makefile-mode "# {{{ " "# }}}") (folding-add-to-marks-list 'python-mode "#{{{ " "#}}}" nil t) (folding-add-to-marks-list 'bibtex-mode "%{{{ " "%}}}" nil t))) ;;}}} ;;{{{ PC-Select-Mode ;; ============== (require 'pc-select) (pc-select-mode) ;;}}} ;;{{{ Function-Menu ;; ============= (if (eq 'x (console-type)) (let () (require 'func-menu) (add-hook 'find-file-hooks 'fume-add-menubar-entry))) ;;}}} ;;{{{ Completion-Mode ;; =============== (load "completion") (initialize-completions) ;;}}} ;;{{{ ISpell-Mode ;; =========== (setq-default ispell-program-name "aspell") ;(setq ispell-dictionary "deutsch-latin1") (setq ispell-dictionary "deutsch8") ; (setq ispell-complete-word-dict "/usr/dict/deutsch") ;(append-ispell-dict-alist "deutsch.hash" ; '("deutsch-babel" ; "[a-zA-Z\"]" ; "[^a-zA-Z\"]" "[']" t ("-C" "-d" "deutsch") "~tex" nil)) ;(append-ispell-dict-alist "deutsch.hash" ; '("deutsch-latin1" ; "[a-zA-Z\304\326\334\344\366\337\374]" ; "[^a-zA-Z\304\326\334\344\366\337\374]" ; "[']" t ("-C" "-d" "deutsch") "~latin1" iso-latin-1)) (defun mydicttodeutsch8 () (interactive) ; (ispell-change-dictionary "deutsch-latin1") (ispell-change-dictionary "deutsch8") ) (defun mydicttoenglish () (interactive) (ispell-change-dictionary "english") ) ;;}}} ;;{{{ flySpell-Mode ;; =========== (setq flyspell-default-dictionary "deutsch8") (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checking" t) (autoload 'global-flyspell-mode "flyspell" "On-the-fly spelling" t) ;;}}} ;;{{{ Crypt-Mode ;; ========== ; (require 'crypt) ;;}}} ;;{{{ XInfo-Mode (autoload 'xinfo-mode-hook "xinfo" "xinfo mode hook." t) (add-hook 'Info-mode-hook (function xinfo-mode-hook)) ;;}}} ;;{{{ SMB-Mode (autoload 'smb-mode "smb-mode" "SMB Major Mode" t) (setq auto-mode-alist (cons '("smb\\.conf$" . smb-mode) auto-mode-alist)) ;;}}} ;;{{{ Autoinsert-Mode ;; =============== (add-hook 'find-file-hooks 'auto-insert) (setq auto-insert-directory "~/emacs/skel/") (setq auto-insert t) (setq auto-insert-alist '( ;; C/C++ Header-File ; (("\\.\\([Hh]\\|hh\\|hpp\\)\\'" . "C / C++ header") ; (upcase (concat (file-name-nondirectory ; (substring buffer-file-name 0 (match-beginning 0))) ; "_" ; (substring buffer-file-name (1+ (match-beginning 0))))) ; "#ifndef " str \n ; "#define " str "\n\n" ; "\n\n#endif") ;; C/C++ Program-File ; (("\\.\\([Cc]\\|cc\\|cpp\\)\\'" . "C / C++ program") ; nil ; "#include \"" ; ;; nop without latest cc-mode ; (and (fboundp 'c-companion-file) ; ;(file-readable-p (c-companion-file 'name)) ; (file-name-nondirectory (c-companion-file 'name))) & ?\" ; | -10) ;; Makefile ("[Mm]akefile\\'" . "makefile.inc") ("\\.shtml\\'" . "template.shtml") ;; HTML-File (("\\.html\\'" . "HTML - File") nil "\n" "\n" "" "\n" "\n" "\n\n" "\n" "") ;; LaTeX - g-brief ("\\.brief.tex\\'" . "g-brief_vorlage.brief.tex") ;; BibTeX File ;; (bibtex-mode . "tex-insert.tex") ;; Shellscript (("/bin/.*[^/]\\'" . "Shell-Script mode magic number") lambda () (if (eq major-mode default-major-mode) (sh-mode))) ;; Ada File (ada-mode . ada-header))) ;;}}} ;;{{{ W3 ;; == (setq-default w3-delay-image-loads nil) (setq-default w3-delay-mpeg-loads nil) (setq-default w3-color-use-reducing t) (setq-default w3-color-filter 'ppmquant) (setq-default w3-dump-to-disk nil) (setq-default url-automatic-caching t) (setq-default url-standalone-mode nil) (setq-default url-use-hypertext-gopher t) (setq-default url-use-hypertext-dired t) (setq-default url-proxy-services nil) (setq-default url-be-asynchronous nil) (setq-default w3-default-homepage "http://www.tu-clausthal.de/~mvcho/Links.html") (setq-default url-privacy-level 'none) (setq-default w3-toolbar-orientation 'top) ;;}}} ;;{{{ Mailen und News ;; ================== (setq auto-mode-alist (append '(("pico\\.[a-z0-9]*\\'" . message-mode)) auto-mode-alist)) ;;{{{ Faces ;; ----- (defface my-message-quote-even-face '((((class color) (background dark)) (:foreground "steelBlue" )) (((class color) (background light)) (:foreground "steelBlue" )) (t (:bold t))) "Face for even quoting.") (defface my-message-quote-odd-face '((((class color) (background dark)) (:foreground "darkred")) (((class color) (background light)) (:foreground "darkred")) (t (:bold t :italic t))) "Face for even quoting.") (defface my-message-quote-first-face '((((class color) (background dark)) (:foreground "darkred" :bold t)) (((class color) (background light)) (:foreground "darkred" :bold t)) (t (:italic t))) "Face for first quoting.") (defface my-message-url-face '((((class color) (background dark)) (:foreground "darkgreen" :bold t)) (((class color) (background light)) (:foreground "darkgreen" :bold t)) (t (:bold t :italic t))) "Face for urls.") (defface my-message-email-face '((((class color) (background dark)) (:foreground "maroon" :bold t)) (((class color) (background light)) (:foreground "maroon" :bold t)) (t (:bold t :italic t))) "Face for emails.") (defface my-message-headline-face '((((class color) (background dark)) (:foreground "black" :bold t)) (((class color) (background light)) (:foreground "black" :bold t)) (t (:bold t :italic t))) "Face for headline.") ;;}}} (setq message-font-lock-keywords `( ; Jede ungerade Quotetiefe größer drei (,(concat "^\\([ \\t]*[>|}]\\)\\{3,3\\}" "\\([ \\t]*[>|}]\\)\\{2,2\\}*[ \\t]*[^ \\t>|}].*") . my-message-quote-odd-face) ; Jede gerade Quotetiefe größer zwei (,(concat "^\\([ \\t]*[>|}]\\)\\{2,2\\}" "\\([ \\t]*[>|}]\\)\\{2,2\\}*[ \\t]*[^ \\t>|}].*") . my-message-quote-even-face) ; Quotetiefe eins ("^[ \\t]*[>|}][ \\t]*[^>|}].*" . my-message-quote-first-face) ; Pine Headline (,(concat "^On [A-Z][a-z][a-z], [0-9]\\{1,2\\} [A-Z][a-z]* " "[0-9]\\{4,4\\},? [-A-Za-z0-9_ @\\.\\\\\\\+]* wrote:$") . my-message-headline-face) ; Urls ("\\(http\\|ftp\\):\\\\\\\\[A-Za-z0-9][-0-9A-Za-z_\\.\\\\]*" 0 my-message-url-face t) ; Emails (,(concat "\\(mail:\\)?[A-Za-z0-9][-\\+0-9A-Za-z_\\.]*" "@[-\\+0-9A-Za-z_\\.]*") 0 my-message-email-face t) (,(concat "_[A-Za-z0-9äöüÄÖÜß]*_") 0 underline t) (,(concat "\\*[A-Za-z0-9äöüÄÖÜß]*\\*") 0 bold t) (,(concat "/[A-Za-z0-9äöüÄÖÜß]*/") 0 italic t) )) (require 'message) (defun message-set-auto-save-file-name ()) (defun my-message-buffer-kill () (interactive) (gnuserv-kill-buffer-function)) (defun my-message-mode-hook () ;; add my personal style and set it for the current buffer (auto-fill-mode t) (flyspell-mode t) (line-number-mode t) (setq message-mode-auto-directory nil) (defun message-set-auto-save-file-name ()) (define-key message-mode-map [f4] 'gnuserv-edit) (define-key message-mode-map "\C-c\C-c" 'gnuserv-edit) (define-key message-mode-map "\C-c\C-x" 'gnuserv-edit) (define-key message-mode-map "\C-c\C-s" 'gnuserv-edit) (define-key message-mode-map "\C-c\C-k" 'my-message-buffer-kill) (define-key message-mode-map "\C-c\C-d" 'my-message-buffer-kill) ) (add-hook 'message-mode-hook 'my-message-mode-hook) ;;}}} ;;{{{ Gnus ;; If `some', only fill in the gaps that are needed to tie loose threads ;; together. If `more', fill in all leaf nodes that Gnus can find. If ;; non-nil and non-`some', fill in all gaps that Gnus manages to guess. ;(setq gnus-build-sparse-threads 'some) ;; *Function used for gathering loose threads. ;; There are two pre-defined functions: `gnus-gather-threads-by-subject', ;; which only takes Subjects into consideration; and ;; `gnus-gather-threads-by-references', which compared the References ;; headers of the articles to find matches. ;(setq gnus-summary-thread-gathering-function ; 'gnus-gather-threads-by-references) ;;;================================ ;;; Formatting the summary buffer: sorting by thread ;; gnus-thread-sort-by-author - Sort threads by root author. ;; gnus-thread-sort-by-chars - Sort threads by root article octet length. ;; gnus-thread-sort-by-date - Sort threads by root article date. ;; gnus-thread-sort-by-lines - Sort threads by root article Lines header. ;; gnus-thread-sort-by-number - Sort threads by root article number. ;; gnus-thread-sort-by-score - Sort threads by root article score. ;; gnus-thread-sort-by-subject - Sort threads by root subject. ;; gnus-thread-sort-by-total-score - Sort threads by the sum of all scores in the thread. ;;;*================================ ;(setq gnus-thread-sort-functions ; '(gnus-thread-sort-by-number ; gnus-thread-sort-by-date ; gnus-thread-sort-by-subject ; gnus-thread-sort-by-author ; gnus-thread-sort-by-score ; gnus-thread-sort-by-total-score)) ;(setq ;; All of this is for Oort Gnus and higher: ; gnus-summary-line-format "%U%R%z%(%[%4L: %-20,20n%]%B %s%)\n" ; gnus-summary-same-subject "" ; gnus-sum-thread-tree-root " >" ; gnus-sum-thread-tree-single-indent " " ; gnus-sum-thread-tree-vertical "|" ; gnus-sum-thread-tree-indent " " ; gnus-sum-thread-tree-leaf-with-other "+-> " ; gnus-sum-thread-tree-single-leaf "`-> " ) ;(setq gnus-select-method '(nntp "news.tu-clausthal.de")) ;(setq browse-url-browser-program "/home/chopp/bin/myurl_handler.sh") ;(setq nnfolder-directory "~/fmail/") ;(setq nnmail-spool-file 'procmail) ;(setq nnmail-procmail-directory "~/mail/") ;(setq gnus-secondary-select-methods '((nnfolder ""))) ;(setq nnmail-procmail-suffix "") ;;}}} ;;{{{ MailCrypt ;:*======================= ;:* load mailcrypt (XEmacs tool for pgp) (load-library "mailcrypt") (autoload 'mc-install-write-mode "mailcrypt" nil t) (autoload 'mc-install-read-mode "mailcrypt" nil t) (add-hook 'message-mode-hook 'mc-install-write-mode) (setq mc-encrypt-for-me t mc-passwd-timeout 6000) (setq mc-pgp-keydir "/home/chopp/.gnupg/") (mc-setversion "gpg") ;:*======================= ;:* mailcrypt-support for gnus (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode) (message "Mailcrypt initialised") ;;}}} ;;{{{ Mew ;(autoload 'mew "mew" nil t) ;(autoload 'mew-send "mew" nil t) ;(setq mew-name "Christian Hopp") ;; (user-full-name) ;(setq mew-user "chopp") ;; (user-login-name) ;(setq mew-mail-domain "iei.tu-clausthal.de") ;(setq mew-mail-domain-list '("iei.tu-clausthal.de")) ;;; (setq mew-pop-user "your POP account") ;; (user-login-name) ;;;(setq mew-pop-server "your POP server") ;; if not localhost ;;;(setq mew-smtp-server "your SMTP server") ;; if not localhost ;(setq mew-icon-directory "/usr/lib/xemacs/etc/Mew/") ;; if using XEmacs ;;; See also mew-config-alist for advanced us ;(setq mew-mailbox-type 'mbox) ;(setq mew-mbox-command "mewinc") ;;; Optional setup (Read Mail menu for Emacs 21): ;(if (boundp 'read-mail-command) ; (setq read-mail-command 'mew)) ;;; Optional setup (e.g. C-xm for sending a message): ;(autoload 'mew-user-agent-compose "mew" nil t) ;(if (boundp 'mail-user-agent) ; (setq mail-user-agent 'mew-user-agent)) ;(if (fboundp 'define-mail-user-agent) ; (define-mail-user-agent ; 'mew-user-agent ; 'mew-user-agent-compose ; 'mew-draft-send-message ; 'mew-draft-kill ; 'mew-send-hook)) ;;}}} ;;{{{ Calendar-Mode (setq calendar-latitude 54) (setq calendar-longitude -10) (setq calendar-location-name "Clauthal-Zellerfeld") (setq appt-message-warning-time 30) (setq appt-issue-message t) (setq all-christian-calendar-holidays t) (add-hook 'diary-hook 'appt-make-list) (add-hook 'diary-display-hook 'fancy-diary-display) (add-hook 'list-diary-entries-hook 'sort-diary-entries) (setq calendar-time-zone +120) (setq calendar-standard-time-zone-name "CET") (setq calendar-daylight-time-zone-name "CEST") (load "cal-de.el") ;;}}} ;;{{{ Dictionary (autoload 'dictionary-search "dictionary" "Ask for a word and search it in all dictionaries" t) (autoload 'dictionary-match-words "dictionary" "Ask for a word and search all matching words in the dictionaries" t) (autoload 'dictionary "dictionary" "Create a new dictionary buffer" t) (global-set-key [(control c) ?s] 'dictionary-search) (global-set-key [(control c) ?m] 'dictionary-match-words) ;;}}} ;;{{{ translate-Mode (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) (setq *translate-glob-dir* "/home/chopp/dictionary/") (setq *translate-program* "egrep") (setq *translate-separator* " :: ") (setq *translate-glob-dictname* "chemniz-ger-eng.vok") ;;}}} ;;{{{ Dic-Mode (load-library "dic") (global-set-key '[(control c) l] 'dicleo) ;;}}} ;;{{{ babel-Mode (Babelfish Mode) (require 'babel) (global-set-key '[(control c) (control t)] 'babel-region) ;;}}} ;;{{{ HTML-MODE (setq auto-mode-alist (append '((".*\\.s?html\\(\\.de\\|\\.en\\|\\.fr\\|\\)" . html-mode)) auto-mode-alist)) ;;}}} ;;{{{ Outfit and Handling Settings ;; ---------------------------- ;; ---------------------------- ;;{{{ Tastenkombinationen ;; =================== ;;{{{ Global ;; ------ ;;{{{ Frame Functions ;; - - - - - - - - (defun make-frame-less-wide () "Den Frame schmaler machen" (interactive) (set-frame-width (get-frame-for-buffer (buffer-name)) ; (- (frame-width (get-frame-for-buffer (buffer-name))) 1) 80) (set-fill-column 75)) (defun make-frame-more-wide () "Den Frame breiter machen" (interactive) (set-frame-width (get-frame-for-buffer (buffer-name)) ; (+ (frame-width (get-frame-for-buffer (buffer-name))) 1) 108) (set-fill-column 105)) ;;}}} (define-key global-map 'dead-tilde "~") (define-key global-map 'dead-circumflex "^") (define-key global-map 'dead-grave "`") (define-key global-map 'dead-acute "'") (define-key global-map 'kp_enter [(control m)]) (define-key global-map 'print 'execute-extended-command) (define-key global-map '[(control print)] 'shell-command) ;; (define-key global-map '[(control delete)] 'x-delete-primary-selection) ;; (define-key global-map '[(shift delete)] 'x-kill-primary-selection) (define-key global-map '[(control button1)] 'modeline-buffers-menu) (define-key global-map '[(control button3)] 'folding-mouse-context-sensitive) ;; (define-key global-map '[(control button3)] 'modeline-menu) (define-key global-map [(meta backspace)] 'undo) (define-key global-map [f2] (quote find-file)) (define-key global-map [f3] (quote save-buffer)) (define-key global-map [f4] (quote kill-this-buffer)) (define-key global-map [(delete)] 'delete-char) (define-key global-map [(kp-delete)] 'delete-char) (define-key global-map [(backspace)] 'backward-delete-char) (define-key global-map [(meta control left)] 'make-frame-less-wide) (define-key global-map [(meta control right)] 'make-frame-more-wide) (define-key global-map [(meta space)] 'complete) (define-key global-map [(control c) i d] 'mydicttodeutsch8) (define-key global-map [(control c) i e] 'mydicttoenglish) (define-key global-map [(control f)] 'fill-paragraph) (define-key global-map [(meta control f)] 'fill-region) (define-key global-map 'SunCopy 'toolbar-copy) (define-key global-map 'SunPaste 'toolbar-paste) (define-key global-map 'SunCut 'toolbar-cut) (define-key global-map 'SunOpen 'find-file) (define-key global-map 'SunFront 'delete-other-windows) (define-key global-map 'SunProps 'customize) (define-key global-map 'find 'isearch-forward) (define-key global-map 'help 'info) (define-key global-map [(shift help)] 'info-query) (define-key global-map [(control help)] 'help) (define-key global-map 'cancel 'keyboard-quit) (define-key global-map [(control find)] 'isearch-forward-regexp) ;;}}} ;;{{{ Lisp-Mode ;; --------- ; (define-key lisp-mode-map [(delete)] 'delete-char) ; (define-key lisp-mode-map [(backspace)] 'backward-delete-char) ;;}}} ;;{{{ C-Mode ;; --------- (define-key c-mode-map [(delete)] 'delete-char) (define-key c-mode-map [(backspace)] 'backward-delete-char) ;;}}} ;;{{{ C++-Mode ;; --------- (define-key c++-mode-map [(delete)] 'delete-char) (define-key c++-mode-map [(backspace)] 'backward-delete-char) ;;}}} ;;{{{ AucTeX-Mode ;; --------- ;; (define-key LaTeX-mode-map [(control a)] 'capitalize-word) (defun latex-rt-key-set () "Tastenkombinationen zum Tippen von regelungstechnischen Texten" (interactive) (define-key LaTeX-mode-map [(control alt ?.)] "\\cdot") (define-key LaTeX-mode-map [(control alt ?-)] "^{-1}") (define-key LaTeX-mode-map [(control alt a)] "\\ask") (define-key LaTeX-mode-map [(control alt f)] "\\frac{}{}") (define-key LaTeX-mode-map [(control alt u) ?0] "\\ul{0}") (define-key LaTeX-mode-map [(control alt u) ?A] "\\ul{A}") (define-key LaTeX-mode-map [(control alt u) ?B] "\\ul{B}") (define-key LaTeX-mode-map [(control alt u) ?C] "\\ul{C}") (define-key LaTeX-mode-map [(control alt u) ?D] "\\ul{D}") (define-key LaTeX-mode-map [(control alt u) ?d ?x] "\\ul{\\dot x}") (define-key LaTeX-mode-map [(control alt u) ?h ?u] "\\ul{\\hat u}") (define-key LaTeX-mode-map [(control alt u) ?h ?x] "\\ul{\\hat x}") (define-key LaTeX-mode-map [(control alt u) ?h ?y] "\\ul{\\hat y}") (define-key LaTeX-mode-map [(control alt u) ?I] "\\ul{I}") (define-key LaTeX-mode-map [(control alt u) ?K] "\\ul{K}") (define-key LaTeX-mode-map [(control alt u) ?l] "\\ul{L}") (define-key LaTeX-mode-map [(control alt u) ?r] "\\ul{R}") (define-key LaTeX-mode-map [(control alt u) ?p] "\\ul{p}") (define-key LaTeX-mode-map [(control alt u) ?P] "\\ul{P}") (define-key LaTeX-mode-map [(control alt u) ?Q] "\\ul{Q}") (define-key LaTeX-mode-map [(control alt u) ?t ?u] "\\ul{\\tilde u}") (define-key LaTeX-mode-map [(control alt u) ?t ?x] "\\ul{\\tilde x}") (define-key LaTeX-mode-map [(control alt u) ?t ?y] "\\ul{\\tilde y}") (define-key LaTeX-mode-map [(control alt u) ?u] "\\ul{u}") (define-key LaTeX-mode-map [(control alt u) ?v] "\\ul{v}") (define-key LaTeX-mode-map [(control alt u) ?V] "\\ul{V}") (define-key LaTeX-mode-map [(control alt u) ?x] "\\ul{x}") (define-key LaTeX-mode-map [(control alt u) ?y] "\\ul{y}") (define-key LaTeX-mode-map [(control ?()] "\\left(") (define-key LaTeX-mode-map [(control ?\))] "\\right)") (define-key LaTeX-mode-map [(control ?{)] "\\left\\{") (define-key LaTeX-mode-map [(control ?})] "\\right\\}") (define-key LaTeX-mode-map [(control ?[)] "\\left[") (define-key LaTeX-mode-map [(control ?])] "\\right]") ) ;;}}} ;;{{{ Emacs-Lisp-Mode ;; --------------- (define-key emacs-lisp-mode-map [(delete)] 'delete-char) (define-key emacs-lisp-mode-map [(backspace)] 'backward-delete-char) ;;}}} ;;{{{ Python-Mode ;; ----------- (define-key py-mode-map [(return)] 'newline-and-indent) (define-key py-mode-map [(delete)] 'delete-char) (define-key py-mode-map [(backspace)] 'backward-delete-char) (define-key py-mode-map [(meta backspace)] 'undo) ;;}}} ;;}}} ;;{{{ Fonts und Farben ;; ================ (set-face-foreground font-lock-comment-face "CadetBlue4") (set-face-foreground font-lock-string-face "LightCoral") (set-face-foreground font-lock-keyword-face "Blue") (set-face-foreground font-lock-function-name-face "DodgerBlue4") (set-face-foreground font-lock-variable-name-face "LightSteelBlue4") (set-face-foreground font-lock-type-face "Purple4") (set-face-foreground font-lock-reference-face "azure4") ;(set-face-foreground font-lock-error-face "red") (set-face-foreground font-latex-math-face "green4") (set-face-foreground font-latex-warning-face "red") (set-face-foreground font-latex-sedate-face "mediumpurple3") (set-face-background 'whitespace-tab-face "grey85") ;(if (eq 'x (console-type)) ; (let () (require 'x-font-menu) ;; (font-menu-set-font nil nil "140") ; (font-menu-set-font "Courier" nil nil))) (setq font-lock-use-default-fonts nil) (setq font-lock-use-default-colors nil) (require 'font-lock) (add-hook 'font-lock-mode-hook 'turn-on-lazy-shot) ;;}}} ;;{{{ Toolbar ;; ======= (if (eq 'x (console-type)) (add-spec-list-to-specifier default-toolbar '((global (nil [:style 2d :size 5] [toolbar-file-icon find-file t "Open a file" ] [toolbar-folder-icon dired t "View directory"] [toolbar-disk-icon save-buffer t "Save buffer" ] [toolbar-printer-icon print-buffer t "Print buffer" ] [:style 2d :size 5] [toolbar-cut-icon x-kill-primary-selection t "Kill region"] [toolbar-copy-icon x-copy-primary-selection t "Copy region"] [toolbar-paste-icon x-yank-clipboard-selection t "Paste from clipboard"] [:style 2d :size 5] [toolbar-replace-icon query-replace t "Replace text" ] [toolbar-undo-icon undo t "Undo edit" ] [:style 2d :size 5] [toolbar-compile-icon toolbar-compile t "Compile" ] [toolbar-debug-icon toolbar-debug t "Debug" ] [toolbar-spell-icon toolbar-ispell t "Spellcheck" ] ; [toolbar-mail-icon toolbar-mail t "Mail" ] ; [toolbar-news-icon toolbar-news t "News" ] [:style 2d :size 5] [toolbar-info-icon toolbar-info t "Information" ] [:style 2d :size 5] [toolbar-wspace-icon whitespace-toolbar-function t "Toggle whitespace mode"] [:style 2d :size 500] ))))) ;;}}} ;;{{{ Modeline ;; ======== ;;{{{ Datum und Zeit ;; -------------- (standard-display-european t) ; (setq display-time-day-and-date t) (setq display-time-24hr-format t) (display-time) ;;}}} ;;{{{ Zeilennummerierung ;; ------------------ (line-number-mode t) (column-number-mode t) ;;}}} ;;{{{ Misc (setq modeline-click-swaps-buffers t) (setq-default modeline-format (list (purecopy "") (purecopy '(line-number-mode "-%l|")) (purecopy '(column-number-mode "%c-")) (purecopy '(-3 . "%p-")) (cons modeline-modified-extent 'modeline-modified) (cons modeline-buffer-id-extent 'modeline-buffer-identification) (purecopy " ") 'global-mode-string (purecopy " %[(") (cons modeline-minor-mode-extent (list "" 'mode-name 'minor-mode-alist)) (cons modeline-narrowed-extent "%n") 'modeline-process (purecopy ")%]----") (purecopy "-%-"))) (setq display-time-form-list (list 'time 'load)) (display-time-function) ;;}}} ;;}}} ;;{{{ Sound ;; ===== ;(cond ((string-match ":0" (getenv "DISPLAY")) ; (load-default-sounds)) ; (t ; (setq bell-volume 40) ; (setq sound-alist ; (append sound-alist '((no-completion :pitch 500)))) ; )) ;;}}} ;;}}} ;;{{{ Autosave ;; ======== (require 'auto-save) (setq auto-save-directory (expand-file-name "~/emacs/autosaves/") auto-save-directory-fallback auto-save-directory auto-save-hash-p nil auto-save-interval 2000) ;;}}} ;;{{{ Misc ;; ==== ;(if (eq 'x (console-type)) ; (require 'search-menu)) (defun my-translate-at-point (n) (interactive "p") (if (not (eq n 1)) (my-translate-word (read-from-minibuffer "Translate: " (current-word))) (my-translate-word (current-word)))) (defun my-translate-word (word) (shell-command (concat "/home/chopp/bin/emacs_translate " word))) (global-set-key "\C-c\C-kt" 'my-translate-at-point) ;;}}} ;;{{{ Auto Mode Settings (setq auto-mode-alist (cons '("\\.y$" . c-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.l$" . c-mode) auto-mode-alist)) ;;}}} ;;{{{ ?????? ;; ====== ;(put 'eval-expression 'disabled nil) ;;}}} ;;{{{ Server (if (eq 'x (console-type)) (gnuserv-start)) ;;}}} ;;{{{ XEmacs-Internal Settings ;; =============== (setq minibuffer-max-depth nil) (setq next-line-add-newlines 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 "/home/chopp/.xemacs-options"))) ;; ============================ ;; End of Options Menu Settings ;;}}} ;;{{{ Yow ;; === ;(yow) ;;}}} ) ;;}}} ;;}}} ;;{{{ GNU-EMACS ;; ========= (progn ;;{{{ Folding-Mode ;; ============ ; (setq fold-allow-overlays t) (require 'folding) (folding-mode-add-find-file-hook) (fold-install-hooks) (fold-add-to-marks-list 'python-mode "#{{{ " "#}}}" nil t) ;;}}} ;;{{{ TeX Modes ;; ========= ;;{{{ Auc-TeX ;; ------- ;;{{{ Packages ;; - - - - - (require 'tex-site) (require 'bib-cite) ;;}}} ;;{{{ Commandos und Menu ;; - - - - - - - - - - (setq-default TeX-view-style '(("^landscape$" "dvips -Z -D 600 -t landscape %d ; gv %f") ("." "dvips -Z -D 600 %d ; gv %f"))) (setq-default TeX-command-list (list (list "TeX" "tex '\\nonstopmode\\input %t'" 'TeX-run-TeX nil t) (list "LaTeX" "%l '\\nonstopmode\\input{%t}'" 'TeX-run-LaTeX nil t) (list "View" "%v " 'TeX-run-discard t nil) (list "View 2xA5" "a4toa5 %d /tmp/emacs_a5.dvi; dvips -Z -D 600 -t landscape /tmp/emacs_a5.dvi -o %f; rm /tmp/emacs_a5.dvi; gv %f" 'TeX-run-discard t nil) (list "Print" "%p " 'TeX-run-command t nil) (list "Queue" "%q" 'TeX-run-background nil nil) (list "File" "dvips %d -o %f " 'TeX-run-discard t nil) (list "File to 2xA5" "a4toa5 %d /tmp/emacs_a5.dvi; dvips -Z -D 600 -t landscape /tmp/emacs_a5.dvi -o %f; rm /tmp/emacs_a5.dvi" 'TeX-run-discard t nil) (list "BibTeX" "bibtex %s" 'TeX-run-BibTeX nil nil) (list "Index" "makeindex %s" 'TeX-run-command nil t) ;(list "Check" "lacheck %s" 'TeX-run-compile nil t) ;(list "Spell" "" 'TeX-run-ispell nil nil) (list "Other" "" 'TeX-run-command t t) (list "Makeinfo" "makeinfo %t" 'TeX-run-compile nil t) ;(list "AmSTeX" "amstex '\\nonstopmode\\input %t'" 'TeX-run-TeX nil t) (list "pdfLaTeX" "pdflatex '\\nonstopmode\\input %t'" 'TeX-run-TeX nil t) )) ;;}}} ;;{{{ Pfade ;; - - - (setq TeX-macro-global '("/usr/lib/teTeX/texmf/tex")) (setq TeX-auto-global "/usr/local/share/emacs/site-lisp/auctex-9.8f/auto/") (setq TeX-macro-privat "~/tex-files/") (setq TeX-auto-privat "~/tex-files/") ;;}}} ;;{{{ andere Einstellungen ;; - - - - - - - - - - - (setq TeX-parse-self t) ; (setq TeX-auto-save t) (setq TeX-open-quote "``") (setq TeX-close-quote "''") ;;}}} ;;}}} ;;}}} ;;{{{ Fonts und Farben ;; ================ (require 'font-lock) ; (require 'font-latex) (set-face-foreground font-lock-comment-face "CadetBlue4") (set-face-foreground font-lock-string-face "LightCoral") (set-face-foreground font-lock-keyword-face "Blue") (set-face-foreground font-lock-function-name-face "DodgerBlue4") (set-face-foreground font-lock-variable-name-face "LightSteelBlue4") (set-face-foreground font-lock-type-face "Purple4") (set-face-foreground font-lock-reference-face "azure4") ;(set-face-foreground font-lock-error-face "red") ;(set-face-foreground font-latex-math-face "green4") ;(set-face-foreground font-latex-warning-face "red") ;(set-face-foreground font-latex-sedate-face "mediumpurple3") ;(set-face-background 'whitespace-tab-face "grey85") (setq font-lock-use-default-fonts nil) (setq font-lock-use-default-colors nil) (global-font-lock-mode t) (setq font-lock-maximum-decoration t) ;;}}} ) ;;}}} )