shosei

more .emacs

Mar 14th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 4.51 KB | None | 0 0
  1. ;; -*- mode: emacs-lisp -*-
  2.  
  3. ; First, avoid the evil:
  4. (when (featurep 'xemacs)
  5.   (error "This machine runs xemacs, install GNU Emacs first."))
  6.  
  7. ; Make ö, ü and such work
  8. (set-language-environment 'german)
  9. (set-terminal-coding-system 'iso-latin-1)
  10.  
  11. ; Save space
  12. (menu-bar-mode nil)
  13.  
  14. ; Handle .gz files
  15. (auto-compression-mode t)
  16.  
  17. ; Provide templates for new files
  18. (auto-insert-mode t)
  19.  
  20. ; Allow completions like em-s-region to complete to emacspeak-speak-region
  21. (partial-completion-mode)
  22.  
  23. ; This somehow produced a failure on excelior
  24. (add-hook 'after-init-hook 'server-start)
  25. (add-hook 'server-done-hook
  26.       (lambda ()
  27.         (shell-command "screen -r -X select `cat ~/tmp/emacsclient-caller`")))
  28.  
  29. (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
  30.  
  31. (unless (featurep 'emacspeak)
  32.   (add-hook 'emacs-lisp-mode-hook 'eldoc-mode))
  33.  
  34. ; Update string in the first 8 lines looking like Timestamp: <> or " "
  35. (add-hook 'write-file-hooks 'time-stamp)
  36.  
  37. (setq diary-file "~/emacs/diary")
  38. (add-hook 'diary-hook 'appt-make-list)
  39. (diary 0)
  40.  
  41. (eval-after-load "em-term"
  42.   '(add-to-list 'eshell-visual-commands "zsh"))
  43.  
  44. (let ((chessdir (expand-file-name
  45.          "~/emacs/lisp/chess")))
  46.   (when (file-directory-p chessdir)
  47.     (add-to-list 'load-path chessdir)
  48.     (setq chess-sound-directory (concat chessdir "/sounds"))))
  49. (when (load "chess-auto" t)
  50.   (setq
  51.    chess-default-display 'chess-plain
  52.    chess-ics-server-list '(("freechess.org" 5000 "mlang"))
  53.    chess-plain-black-square-char 43
  54.    chess-plain-draw-border t
  55.    chess-plain-white-square-char 45
  56.    chess-plain-spacing 0))
  57.  
  58.  
  59. (setq gnus-init-file "~/emacs/.gnus.el")
  60.  
  61. ; Use C-xaig to correct common typos
  62. (setq abbrev-file-name "~/emacs/abbrev_defs")
  63. (if (file-exists-p abbrev-file-name)
  64.     (quietly-read-abbrev-file))
  65. (set-default 'abbrev-mode t)
  66.  
  67. ;; Misc options I just prefer everytime
  68. (setq cperl-indent-level 2
  69.       custom-buffer-indent 2
  70.       gc-cons-threshold (* 1024 1024)
  71.       european-calendar-style t
  72.       mail-user-agent 'message-user-agent
  73.       message-generate-headers-first t
  74.       w3-display-frames 'ask
  75.       widget-choice-toggle t
  76.       widget-menu-minibuffer-flag t
  77.       url-privacy-level '(os agent)
  78.       vc-cvs-diff-switches "-u")
  79.  
  80.  
  81. (put 'narrow-to-region 'disabled nil)
  82.  
  83.  
  84. (require 'crypt++ nil t)
  85. (setq crypt-encryption-type 'mcrypt)
  86.  
  87.  
  88. (add-to-list 'load-path (expand-file-name "~/emacs/lisp/"))
  89. (require 'itime)
  90. (setq display-time-string-forms
  91.       '(24-hours ":" minutes " "
  92.          (itime-string 24-hours minutes seconds)
  93.          (if mail
  94.              " Mail"
  95.            ""))
  96.        display-time-interval 30)
  97. (display-time-mode 1)
  98.  
  99.  
  100. (condition-case data
  101.     (let ((default-directory "~/emacs/"))
  102.       (load-file "./local"))
  103.   (file-error 'notfound))
  104.  
  105.  
  106. (if (file-exists-p
  107.      (setq custom-file
  108.        (concat "~/emacs/custom-"
  109.            (int-to-string emacs-major-version))))
  110.     (load-file custom-file))
  111.  
  112.  
  113. (unless (featurep 'emacspeak)
  114.   (global-semantic-auto-parse-mode 1)
  115.   (unless (featurep 'emacspeak)
  116.     (setq semantic-auto-parse-no-working-message t))
  117.   (add-hook 'semantic-init-hooks 'senator-minor-mode))
  118.  
  119.  
  120. ;; Emacs wiki
  121.  
  122. (require 'emacs-wiki)
  123. (add-to-list 'emacs-wiki-interwiki-names '("Bug" . "http://bugs.debian.org/"))
  124. (add-to-list 'emacs-wiki-interwiki-names '("Package" . "http://packages.debian.org/"))
  125. (setq
  126.  emacs-wiki-projects
  127.  '(
  128.    ("PrivateNotes"
  129.     (emacs-wiki-directories "~/doc/private"))
  130.    ("DebianWiki"
  131.     (emacs-wiki-directories "~/debian/notes")
  132. ;    (emacs-wiki-publishing-directory . "/[su/[email protected]]~/public_html/")
  133.     (emacs-wiki-publishing-directory . "~/debian/public_html")
  134.     )))
  135.  
  136. (when (featurep 'emacspeak)
  137.   (defun viavoice-set-language (lang)
  138.     (cond
  139.      ((eq lang 'german)
  140.       (dtk-interp-queue "`l4 Deutsch")
  141.     (dtk-interp-speak))
  142.      ((eq lang 'english)
  143.       (dtk-interp-queue "`l1 English")
  144.       (dtk-interp-speak))
  145.      (t (error "Unknown language"))))
  146.   (defun emacspeak-set-language-to-german ()
  147.     (interactive)
  148.     (viavoice-set-language 'german))
  149.   (defun emacspeak-set-language-to-english ()
  150.     (interactive)
  151.     (viavoice-set-language 'english))
  152.   (global-set-key (kbd "C-c e") 'emacspeak-set-language-to-english)
  153.   (global-set-key (kbd "C-c d") 'emacspeak-set-language-to-german))
  154.  
  155. (define-prefix-command 'f8-map nil "f7=grep, f8=compile")
  156. (define-key f8-map [f8] 'compile)
  157. (define-key f8-map [f7] 'grep)
  158. (global-set-key [f8] 'f8-map)
  159. (custom-set-variables
  160.  '(load-home-init-file t t))
  161. (custom-set-faces)
Advertisement
Add Comment
Please, Sign In to add comment