SteveElkins

I use Emacs more and more, lately on Windows, casually on Unixish systems a long time. Recently I got SBCL and Gambit-C working with Emacs on Windows so I’ve been spending more of my free time using it.

.emacs

;;;;;;;;;;;;;;;
;;;;  w3m  ;;;;
;;;;;;;;;;;;;;;

;; the trick was ensuring that w3m was compiled with emacs23
(setq load-path (cons "C:/Documents and Settings/selkins/My Documents/emacs-w3m"
                      load-path))
(require 'w3m-load)
(setq browse-url-browser-function 'w3m-browse-url)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
;; optional keyboard short-cut (probably conflicts with dired)
;; (global-set-key "\C-xm" 'browse-url-at-point)
;; (setq w3m-use-cookies t)

;;;;;;;;;;;;;;;;;;;;;;
;;;;  lisp+slime  ;;;;
;;;;;;;;;;;;;;;;;;;;;;

;; slime setup from OpenBSD 4.4
;; (setq load-path (cons "~/.emacs.lisp/slime" load-path))
;; ;; (setq inferior-lisp-program "/usr/local/bin/clisp -K full")
;; (setq inferior-lisp-program "/usr/local/bin/sbcl")
;; (require 'slime)
;; (slime-setup '(slime-fancy))
;; (global-set-key "\C-cs" 'slime-selector)

;; http://www.pchristensen.com/blog/articles/installing-sbcl-emacs-and-slime-on-windows-xp/
;(setq load-path (cons "C:/Documents and Settings/selkins/My Documents/slime/slime"
                      load-path))
;(setq inferior-lisp-program "sbcl")
;; clisp doesn't work for me and I haven't pushed it since sbcl does
;; (setq inferior-lisp-program "C:/Program Files/clisp-2.48/full/lisp.exe -B C:/Program Files/clisp-2.48/full -M C:/Program Files/clisp-2.48/full/lispinit.mem -ansi -q")

;; CURRENT
(setq load-path (cons "C:/Documents and Settings/selkins/My Documents/Downloads/slime-2010-09-03"
                      load-path))
(setq inferior-lisp-program "C:/ccl/wx86cl.exe")
(require 'slime)
(setq slime-net-coding-system 'utf-8-unix)
(slime-setup '(slime-fancy))
(global-set-key "\C-cs" 'slime-selector)
(setq common-lisp-hyperspec-root "file:///c:/Documents and Settings/selkins/My Documents/Lisp/clhs/Hyperspec/")

;; http://xach.livejournal.com/130040.html has a link to this
(defun scratch-lisp-file ()
  "Insert a template (with DEFPACKAGE and IN-PACKAGE forms) into
  the current buffer."
  (interactive)
  (goto-char 0)
  (let* ((file (file-name-nondirectory (buffer-file-name)))
         (package (file-name-sans-extension file)))
    (insert ";;;; " file "\n")
    (insert "\n(defpackage #:" package "\n  (:use #:cl))\n\n")
    (insert "(in-package #:" package ")\n\n")))

;; org mode
(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)

;;;;;;;;;;;;;;;;;;;;
;;;;  Gambit-C  ;;;;
;;;;;;;;;;;;;;;;;;;;

;; info
(setq Info-default-directory-list
      (append Info-default-directory-list
              '("C:/Program Files/Gambit-C/v4.5.1/info")))

(setq load-path (cons "C:/Program Files/Gambit-C/v4.5.1/share/emacs/site-lisp"
		      load-path))
(autoload 'gambit-inferior-mode "gambit" "Hook Gambit mode into cmuscheme.")
(autoload 'gambit-mode "gambit" "Hook Gambit mode into scheme.")
(add-hook 'inferior-scheme-mode-hook (function gambit-inferior-mode))
(add-hook 'scheme-mode-hook (function gambit-mode))
;; this works!  probably requires a post-installation reboot like sbcl did.
;; it's from the manual.  gambit.el has -:t and using it I get neither the
;; version banner nor the REPL prompt, but I don't get an error either.
(setq scheme-program-name "gsi -:d-")

;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;  emacs searching  ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; M-x check-eol
(defun check-eol (FILE)
  (interactive "fFile: ")
  (set-buffer (generate-new-buffer "*check-eol*"))
  (insert-file-contents-literally FILE)
  (let ((point (search-forward "\r\n")))
    (kill-buffer nil)
    point))

;; http://www.emacswiki.org/emacs/NTEmacsWithCygwin
;; commented the HOME setting since it hurt me by busting ~/.emacs
(let* ((cygwin-root "c:/cygwin")
       (cygwin-bin (concat cygwin-root "/bin")))
  ;(setenv "HOME" "c:/Documents and Settings/selkins")
  (setenv "PATH" (concat cygwin-bin ";" (getenv "PATH")))
  (setq exec-path (cons cygwin-bin exec-path)))
(setq shell-file-name "bash")
(setq explicit-shell-file-name "bash")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;  emacs customize does the rest  ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(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.
 '(blink-cursor-mode nil)
 '(indent-tabs-mode nil)
 '(mode-require-final-newline (quote ask))
 '(require-final-newline (quote ask))
 '(tab-always-indent t)
 '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 88 96 104 112 120)))
 '(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.
 )

Contact

Combine sgelkins with Gmail if you want to send me a message.

Tips

link .emacs_bash to .profile to get M-x shell to read it.


CategoryHomepage