.emacs

my .emacs file (see for an update here: http://my.opera.com/AxxL/blog/2012/09/24/emacs-2) …

I've updated the info. Please see the new blog-entry at: http://my.opera.com/AxxL/blog/2012/09/24/emacs-2

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(backup-directory-alist (quote (("." . "~/.backups"))))
 '(blink-cursor-mode nil nil (frame))
 '(calendar-week-start-day 1)
 '(case-fold-search t)
 '(column-number-mode t)
; '(cua-mode t nil (cua-base))
 '(current-language-environment "German")
 '(default-input-method "german-postfix")
 '(fill-column 76)
 '(global-font-lock-mode t nil (font-lock))
 '(indent-tabs-mode nil)
 '(inhibit-startup-screen t)
 '(load-home-init-file t t)
 '(make-backup-files nil)
 '(mm-text-html-renderer (quote html2text))
 '(require-final-newline t)
 '(show-paren-mode t nil (paren))
 '(tab-width 4)
 '(tool-bar-mode nil))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "SystemWindow" :foreground "SystemWindowText" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "outline" :family "Consolas")))))



;; Query Replace in open Buffers
(defun query-replace-in-open-buffers (arg1 arg2)
  "query-replace in open files"
  (interactive "sQuery Replace in open Buffers: nsquery with: ")
  (mapcar
   (lambda (x)
     (find-file x)
     (save-excursion
       (beginning-of-buffer)
       (query-replace arg1 arg2)))
   (delq
    nil
    (mapcar
     (lambda (x)
       (buffer-file-name x))
     (buffer-list)))))


;; Duplicate line
(defun duplicate-line()
 "Duplicate line."
 (interactive)
 (let (
       (beg (line-beginning-position))
       (end (line-end-position)))
   (copy-region-as-kill beg end)
   (beginning-of-line)
   (forward-line 1)
   (yank)
   (newline)
   (forward-line -1)))

;; Beenden mit Nachfrage
(setq kill-emacs-query-functions
      (cons (lambda () (y-or-n-p "Quit Emacs? "))
            kill-emacs-query-functions))

;; Quote Other Window (Control-Tab)
(global-set-key (quote [C-tab]) (quote other-window))

;; Titlebar mit Dateiname
(setq frame-title-format (concat "%f (%b) - %F " emacs-version))

;; make psgml shut up about "External entity HTML not found" when the
;; document does not have a doctype.
(setq sgml-warn-about-undefined-entities nil)

;; Menu
(require 'easymenu) 
(easy-menu-add-item nil 
                    (list (if (>= emacs-major-version 22) "Tools" "tools")) 
                    '("My Commands" 
                      ["Kill rectangle" kill-rectangle t] 
                      ["Sort lines" sort-lines t]))

;; Diary
;; http://www.emacswiki.org/emacs/DiaryMode

;;Fancy display

;; Here is some code to make your calendar and diary display fancier:
(setq view-diary-entries-initially t
      mark-diary-entries-in-calendar t
      number-of-diary-entries 7)
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)

;; Here is some code to get rid of the ugly equal signs under the date:
(add-hook 'fancy-diary-display-mode-hook
          '(lambda ()
             (alt-clean-equal-signs)))

(defun alt-clean-equal-signs ()
  "This function makes lines of = signs invisible."
  (goto-char (point-min))
  (let ((state buffer-read-only))
    (when state (setq buffer-read-only nil))
    (while (not (eobp))
      (search-forward-regexp "^=+$" nil 'move)
      (add-text-properties (match-beginning 0) 
                           (match-end 0) 
                           '(invisible t)))
    (when state (setq buffer-read-only t))))

;; Diary Localization
;; German

;; Here's the code to make it all German. It changes the date format for
;; your diary entries to European style, makes Monday the first day of the
;; week, and changes weekday and month names.
                                        ;(european-calendar)
(setq calendar-week-start-day 1
      calendar-day-name-array
      ["Sonntag" "Montag" "Dienstag" "Mittwoch" 
       "Donnerstag" "Freitag" "Samstag"]
      calendar-month-name-array
      ["Januar" "Februar" "Marrz" "April" "Mai" 
       "Juni" "Juli" "August" "September" 
       "Oktober" "November" "Dezember"])



;;
;; SITE-LISP
;;
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\.js$" . js2-mode))
Advertisements