.Emacs for Windows 29 Jun 2009

(setq load-path (cons "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/org-6.27a/" load-path))
(add-to-list 'load-path "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/remember/")

(require 'org)
(require 'remember)
(require 'org-install)
(add-to-list 'auto-mode-alist '("\.org\'" . org-mode))

(global-set-key "C-cl" 'org-store-link)
(global-set-key "C-ca" 'org-agenda)
(global-set-key "C-cb" 'org-iswitchb)

(global-font-lock-mode 1)                     ; for all buffers
(add-hook 'org-mode-hook 'turn-on-font-lock)  ; Org buffers only

(defalias 'list-buffers 'ibuffer)
(defconst cls-tmp-dir    "~/.emacs.tmp")

(setq org-log-done t)
(setq org-directory "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org")
(setq org-default-notes-file "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/notes.org")

(setq remember-annotation-functions '(org-remember-annotation))
(setq remember-handler-functions '(org-remember-handler))
(add-hook 'remember-mode-hook 'org-remember-apply-template)
(define-key global-map "C-cr" 'org-remember)

(setq org-remember-templates
    '(("Todo" ?t "* TODO %? %T %^gn %in " "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/personal.org" )
     ("Journal" ?j "n* %^{topic} %T n%i%?n" "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/journal.org")
     ("Reference" ?r "n* %^{topic} %T n%i%?n" "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/reference.org")
     ("Notes" ?n "n* %^{topic} %T n%i%?n" "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/notes.org")
     ("Contact" ?c "n* %^{Name} :CONTACT:n%[C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/contacts.txt]n"
              "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/")
     ))

(require 'org-publish)
(setq org-publish-project-alist
      '(
	      ("org-notes"
		 :base-directory "~/org/"
		 :base-extension "org"
		 :publishing-directory "~/public_html/"
		 :recursive t
		 :publishing-function org-publish-org-to-html
		 :headline-levels 4             ; Just the default for this project.
		 :auto-preamble t
	         :auto-index t                  ; Generate index.org automagically...
		 :index-filename "sitemap.org"  ; ... call it sitemap.org ...
		 :index-title "Sitemap"         ; ... with title 'Sitemap'.
		 )
		("org-static"
		 :base-directory "~/org/"
		 :base-extension "css\|js\|png\|jpg\|gif\|pdf\|mp3\|ogg\|swf"
		 :publishing-directory "~/public_html/"
		 :recursive t
		 :publishing-function org-publish-attachment
		 )
		("org" :components ("org-notes" "org-static"))
      ))

(setq org-agenda-custom-commands
      '(("p" . "Priorities")
        ("pa" "A items" tags-todo "+PRIORITY="A"")
        ("pb" "B items" tags-todo "+PRIORITY="B"")
        ("pc" "C items" tags-todo "+PRIORITY="C"")
        ;; ...other commands here
        ))

;; To change the location of the annotation file:
(setq org-annotate-file-storage-file "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/annotated.org")
(setq org-annotate-file-add-search t)

(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.
 '(cua-mode t nil (cua-base))
 '(inhibit-startup-screen t)
 '(org-agenda-files (quote ("C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/personal.org")))
 '(show-paren-mode t)
 '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
 '(transient-mark-mode t))
(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.
 )

(defun wc ()
  (interactive)
  (message "Word count: %s" (how-many "\w+" (point-min) (point-max))))

(defun run-current-file ()
(interactive)
  (let (ext-map file-name file-ext prog-name cmd-str)
; get the file name
; get the program name
; run it
    (setq ext-map
          '(
            ("pl" . "perl")
            ("py" . "python")
            ("sh" . "bash")
            ("rb" . "ruby")
            )
          )
    (setq file-name (buffer-file-name))
    (setq file-ext (file-name-extension file-name))
    (setq prog-name (cdr (assoc file-ext ext-map)))
    (setq cmd-str (concat prog-name " " file-name))
    (shell-command cmd-str)))

(define-key global-map "C-c9" 'run-current-file)
(global-set-key (kbd "M-S-") ;; open my personal.org file
  (lambda()(interactive)(find-file "C:/Documents and Settings/csnyder/Desktop/My Dropbox/emacs_org/personal.org")))

;; backups
(setq cls-backup-dir (concat cls-tmp-dir "/backups"))
(setq make-backup-files t ;; do make backups
  backup-by-copying t     ;; and copy them here
  backup-directory-alist '(("." . "~/.emacs.tmp/backups")) ;; FIXME
  version-control t
  kept-new-versions 2
  kept-old-versions 5
  delete-old-versions t)
This entry was posted in Emacs. Bookmark the permalink.

Comments are closed.