(autoload 'mwheel-install "mwheel" "Enable wheely mouse")
(mwheel-install)
(add-to-list 'load-path "~/lib/slime-1.0")
(require 'slime)
(slime-autodoc-mode)
(slime-setup)
(setq inferior-lisp-program "lisp")
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)
(local-set-key "\r" 'newline-and-indent)
(setq lisp-indent-function 'common-lisp-indent-function)
(setq indent-tabs-mode nil)))
(setq auto-mode-alist (cons '("\\.lp$" . lisp-mode)
auto-mode-alist))
(setq load-path (cons "~/lib/emacs" load-path))
(global-font-lock-mode t)
(setq transient-mark-mode t)
(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t)
(require 'html-helper-mode "html-helper-mode.el")
(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.asp$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.phtml$" . html-helper-mode) auto-mode-alist))
(global-set-key "\C-xt" 'tidy-region)
(setq shell-command-default-error-buffer "tidy-errors") (defun tidy-region ()
"Run Tidy HTML parser on current region."
(interactive)
(let ((start (mark))
(end (point))
(command "/usr/local/bin/tidy -config /home/cmillward/lib/tidyconfig.txt -asxhtml"))
(shell-command-on-region start end command t t
shell-command-default-error-buffer)))
(global-set-key "\M-g" 'goto-line)
(custom-set-variables
'(load-home-init-file t t)
'(tex-dvi-view-command "dvi"))
(setq display-time-day-and-date t)
(display-time)
(global-set-key "\C-cy" 'do-smart-yank)
(fset 'do-smart-yank
"\C-y\C-c\C-q")
(autoload 'javascript-mode "javascript-mode" "JavaScript mode" t)
(setq auto-mode-alist (append '(("\\.js$" . javascript-mode))
auto-mode-alist))
(autoload 'python-mode "python-mode" "Python mode" t)
(setq auto-mode-alist (append '(("\\.py$" . python-mode))
auto-mode-alist))
(defun copy-line (n)
"Copy N lines at point to the kill-ring."
(interactive "p")
(kill-ring-save (line-beginning-position) (line-beginning-position (1+ n))))
(defun copy-line-with-filename (n)
"Copy N lines at point to the kill-ring."
(interactive "p")
(kill-ring-save (line-beginning-position) (line-beginning-position (1+ n)))
(kill-append (concat (buffer-name) ": ") '1)
)
(defun cmillward-add-perl-string (n)
"Put stuff around string"
(interactive "p")
(concat "my $input<<END;\n" (car kill-ring))
(kill-append "\nEND" '1)
)
(global-set-key "\C-cc" 'cmillward-add-perl-string)
(global-set-key "\C-ck" 'copy-line-with-filename)
(require 'line-num "line-num.el")
(defun insert-time ()
(interactive)
(insert (format-time-string "%Y-%m-%d-%R")))
(defun cmillward-paste-toggle-x ()
(interactive)
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
)
(require 'desktop)
(desktop-load-default)
(setq desktop-globals-to-save (append '(minibuffer-history command-history file-name-history extended-command-history)
desktop-globals-to-save))
(setq history-length 250)
(desktop-read)
(setq desktop-enable t)
(add-to-list 'load-path "/home/cmillward/lib/emacs/emacs-wiki")
(add-to-list 'load-path "/home/cmillward/lib/emacs/planner")
(add-to-list 'load-path "/home/cmillward/lib/emacs/remember")
(require 'planner)
(setq planner-carry-tasks-forward t)
(require 'planner-id)
(define-key global-map [?\C-x ?\C-t] 'planner-create-task-from-buffer)
(define-key global-map [?\C-x ?\C-n] 'remember)
(require 'remember)(require 'remember-planner)
(setq remember-handler-functions '(remember-planner-append))
(setq remember-annotation-functions planner-annotation-functions)
(defun planner-diary-add-entry (date time text)
"Prompt for a diary entry to add to `diary-file'. Will run
planner-annotations to make hyper links"
(interactive (list (planner-read-date)
(read-string "Time: ")
(read-string "Diary entry: ")))
(save-excursion
(save-window-excursion
(make-diary-entry
(concat
(let ((cal-date (planner-filename-to-calendar-date date)))
(if european-calendar-style
(format "%d/%d/%d"
(elt cal-date 1)
(elt cal-date 0)
(elt cal-date 2))
(format "%d/%d/%d"
(elt cal-date 0)
(elt cal-date 1)
(elt cal-date 2))))
" " time " " text " "
(run-hook-with-args-until-success
'planner-annotation-functions))))))
(define-key global-map [?\C-x ?\C-d] 'planner-diary-add-entry)
(require 'planner-diary)
(setq planner-diary-use-diary t)
(planner-insinuate-diary)
(planner-insinuate-calendar)
(setq planner-diary-number-of-days 7)
(setq planner-diary-number-of-diary-entries 7)
(setq planner-diary-file diary-file)
(add-to-list 'load-path "/home/cmillward/lib/emacs/flymake")
(require 'flymake)
(require 'perldoc)
(require 'htmlize)