Differences between revisions 4 and 6

Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#format wiki
#language en
#pragma section-numbers off
= Emacs: Escape-Meta-Alt-Control-Shift =

Since I don't want to join the editor religious war I'm not going to tell you where you might find information about [http://www.dina.dk/~abraham/religion/ the sacred editor].

See http://www.emacswiki.org/ for more information about emacs.

This is my {{{~/.emacs}}} for [http://homepage.mac.com/zenitani/emacs-e.html Carbon Emacs].

{{{
;;
;; ~/.emacs
;;
;; Thomas Krennwallner <tkren at nospam kr dot tuwien dot ac dot at>
;;

;;
;; setup ~/emacs/site-lisp/ as additional local elisp source for loading libs
;;
(setq load-path (cons (expand-file-name "~/emacs/site-lisp/") load-path))
(add-to-list 'load-path "~/emacs/site-lisp/ecb")

;;
;; setup PATH environment
;;
(setq exec-path (append exec-path (list "/usr/texbin" "/opt/local/bin")))


;;
;; setup additional packages
;;

;; python-mode
(require 'python-mode)
(setq py-python-command "python2.4")

;; we want the xquery mode
(require 'xquery-mode)

;; ;; owl mode
;; (add-to-list 'load-path "~/emacs/site-lisp/owl")
;; (autoload 'owl-mode "owl-mode" "OWL mode." t)
;; (push (cons "\\.owl" 'owl-mode) auto-mode-alist)

;; emacs code browser
(load-file "/Applications/MyApps/Emacs.app/Contents/Resources/site-lisp/cedet/common/cedet.el")
(require 'ecb)
(setq ecb-tip-of-the-day nil)
(setq semantic-load-turn-useful-things-on t)
;;(require 'ede)
;;(global-ede-mode t)

;; subversion support
(require 'vc-svn)

;; tabs for buffers
;; (require 'tabbar)
;; (tabbar-mode)

;; ;; haskell-mode
;; (setq haskell-font-lock-symbols 'unicode)

;; ;; doxymacs font highlightning
;; (require 'doxymacs)

;; (add-hook 'c-mode-common-hook 'doxymacs-mode)

;; (defun my-doxymacs-font-lock-hook ()
;; (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)

;; ;; load flyspell spellchecker
(require 'ispell)
(add-hook 'text-mode-hook '(lambda() (flyspell-mode)))

;; let skim display the particular line in the tex file by Shift-Cmd-Click
(require 'tex-site)
(add-hook 'TeX-mode-hook
    (lambda ()
        (add-to-list 'TeX-output-view-style
            '("^pdf$" "."
              "/Applications/MyApps/Skim.app/Contents/SharedSupport/displayline %n %o %b")))
)

;; start emacsserver for emacsclient
(server-start)


;;
;; set some convinient keybindings
;;

;; bind M-x count-matches to C-c m
(global-set-key "\C-cm" 'count-matches)

;; bind M-x count-words-region to C-c w
(global-set-key "\C-cw" 'count-words-region)

;;; counts the words in a region
;;; from "Programming in Emacs Lisp"
;;; http://www.gnu.org/software/emacs/emacs-lisp-intro/
(defun count-words-region (beginning end)
  "Print number of words in the region."
  (interactive "r")
  (message "Counting words in region ... ")
;;; 1. Set up appropriate conditions.
  (save-excursion
    (let ((count 0))
      (goto-char beginning)
;;; 2. Run the while loop.
      (while (and (< (point) end)
                  (re-search-forward "\\w+\\W*" end t))
        (setq count (1+ count)))
;;; 3. Send a message to the user.
      (cond ((zerop count)
             (message "The region does NOT have any words."))
            ((= 1 count)
             (message "The region has 1 word."))
            (t
             (message "The region has %d words." count))
            )
      )
    )
  )


;;
;; Finetuning
;;

;; Confirm on exit :-)
(setq confirm-kill-emacs 'y-or-n-p)

;; Automatic display of matching parentheses
(show-paren-mode)
(setq blink-matching-paren)

;; save my emacs session to .emacs.d
(require 'desktop)
(desktop-save-mode t)

;; Changes all yes/no questions to y/n type
(fset 'yes-or-no-p 'y-or-n-p)

;; display column numbers
(column-number-mode 't)

;; name and email address used when editing ChangeLogs
(setq add-log-full-name "Thomas Krennwallner")
(setq add-log-mailing-address "tkren AT nospam kr DOT tuwien DOT ac DOT at")
;; keep new entries for the same file together
(setq add-log-keep-changes-together t)

;; case insensitiv search
(setq case-fold-search t)

;; utf-8 settings
(setq current-language-environment "UTF-8")
(prefer-coding-system 'utf-8)

;; display time
(display-time)
(setq display-time-24hr-format t)
(setq display-time-mail-file (quote none))
(setq display-time-mode t)

;; syntax highlightning on
(global-font-lock-mode t)

;; scroll with wheel-mice
(mouse-wheel-mode t)

;; don't save emacs session
(setq save-place nil)

;; region highlightning for marks
(transient-mark-mode t)

;; don't append <N> on buffer names
(setq uniquify-buffer-name-style t)

;; visible bell on
(setq visible-bell t)

;; automatic file de/compression
(auto-compression-mode t)
}}}

----
CategoryConfig