I usually do:

1) lein new your-project-name
2) cd your-project-name, add  :dev-dependencies [[swank-clojure "1.3.0-
SNAPSHOT"]]  to your project.clj, and run lein deps
3) run lein swank
4) Connect from emacs with M-x slime-connect and accept the default
options it gives you.

I haven't had any trouble with macports.  Also, emacs will offer to
install clojure for you when it's first set up for clojure.

For emacs I use emacs-app from macports.  I have the following in
~/.emacs.d/site-lisp/ (you probably wouldn't want all of this):

ac-slime
cedet
cmuscheme
ecb
ess-5.11
paredit
quack
swank-clojure
cedet-1.0pre7
php-mode-1.5.0
sbt
slime-2010-07-27
auto-complete-1.3
clojure-mode
color-theme-6.6.0
elib-1.0
jdee-2.4.0.1
pure-mode
scala
smart-tab


My .emacs is:

;; Easier to load-path
(defun add-subdirs-to-load-path (dir)
  (let ((default-directory (concat dir "/")))
    (normal-top-level-add-subdirs-to-load-path)))
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
(add-subdirs-to-load-path "~/.emacs.d/site-lisp/")

;; LOOK OF EMACS

; "y or n" instead of "yes or no"
(fset 'yes-or-no-p 'y-or-n-p)
; Display line and column numbers
(setq line-number-mode t)
(setq column-number-mode t)
(global-set-key "\C-c\C-w" 'backward-kill-word)
(show-paren-mode 1)

;; Color theme

(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-euphoria)))
(set-cursor-color "yellow")
(setq-default cursor-type '(bar . 2))
(blink-cursor-mode 1)
(global-hl-line-mode 1) ; highlight the current line
(set-face-background 'hl-line "grey10")
(set-default-font "-apple-Andale_Mono-medium-normal-normal-*-12-*-*-*-
m-0-iso10646-1")
(modify-frame-parameters nil '((wait-for-wm . nil)))

;; gui stuff

(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode 1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode 1))

;; Line numbers, indents etc.
(setq standard-indent 2) ; Indent size 2
(global-linum-mode -1) ; Line numbers on side

;; Useful commands
(add-hook 'text-mode-hook 'turn-on-auto-fill)

;; History
(savehist-mode 1)
(desktop-save-mode 1)
(setq history-length 250)
(add-to-list 'desktop-globals-to-save 'file-name-history)

;; Smart Tab
(require 'smart-tab) ;; make sure smart-tab.el is reachable in your
load-path first
(global-smart-tab-mode 1) ;; switch on smart-tab everywhere
(setq smart-tab-completion-functions-alist
      '((emacs-lisp-mode . lisp-complete-symbol)
        (text-mode . dabbrev-completion) ;; this is the "default"
emacs expansion function
        (clojure-mode . slime-complete-symbol))) ;; see update below

;; Auto-complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/auto-
complete/ac-dict")
(ac-config-default)
;; For this see
;; http://github.com/purcell/ac-slime
;; 
http://groups.google.com/group/clojure/browse_thread/thread/09dde36a2ab572df/1ca36e456d31aa58#1ca36e456d31aa58
(require 'ac-slime)
(add-hook 'slime-mode-hook 'set-up-slime-ac)
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
(setq ac-sources (append '(ac-source-slime-simple) ac-sources))


;; CEDET

;(load-file "/Users/daviddreisigmeyer/.emacs.d/site-lisp/cedet/common/
cedet.el")
;(global-ede-mode t)


;; ECB

(require 'ecb)
(setq ecb-tip-of-the-day nil)
(setq ecb-layout-name "my-right-dsh")
; Make it easier to start and stop ecb
; The small window size with a Mac messes up the format
(defun ea ()
        (interactive)
        (ecb-activate))
(defun ed ()
        (interactive)
        (ecb-deactivate))

;; ESS

(require 'ess-site)

;; SLIME

(setq slime-lisp-implementations
        '((sbcl ("/usr/local/bin/sbcl"))))
;       '((ccl  ("/usr/local/bin/ccl64"))))
(require 'slime)
(slime-setup '(slime-fancy slime-banner slime-asdf slime-sbcl-exts))
(setq slime-use-autodoc-mode nil) ; So slime-fancy will work with
clojure
(global-set-key "\C-cs" 'slime-selector) ; C-c s r takes us to the
slime repl

;; CLOJURE

(autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t)
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
(require 'swank-clojure)
(setq slime-lisp-implementations
      (append slime-lisp-implementations
              `((clojure ,(swank-clojure-cmd) :init swank-clojure-
init))))

;; For Rincanter

(setenv "R_HOME" "/Library/Frameworks/R.framework/Resources")

;; For JAVA

(require 'jde)


;;
;; PAREDIT
;;
;;      
http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2007-07/msg01505.html
;;
;;
;;

(autoload 'paredit-mode "paredit"
  "Minor mode for pseudo-structurally editing Lisp code." t)
(require 'paredit)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'inferior-lisp-mode-hook (lambda () (paredit-mode +1)))

;; Stop SLIME's REPL from grabbing DEL,
;; which is annoying when backspacing over a '('
(defun override-slime-repl-bindings-with-paredit ()
   (define-key slime-repl-mode-map
      (read-kbd-macro paredit-backward-delete-key) nil))
      (add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-
with-paredit)

;; Electric RETURN
(defvar electrify-return-match
    "[\]}\)\"]"
    "If this regexp matches the text after the cursor, do an \"electric
\"
  return.")
  (defun electrify-return-if-match (arg)
    "If the text after the cursor matches `electrify-return-match'
then
  open and indent an empty line between the cursor and the text.  Move
the
  cursor to the new line."
    (interactive "P")
    (let ((case-fold-search nil))
      (if (looking-at electrify-return-match)
          (save-excursion (newline-and-indent)))
      (newline arg)
      (indent-according-to-mode)))
  ;; Using local-set-key in a mode-hook is a better idea.
  (global-set-key (kbd "RET") 'electrify-return-if-match)


;; ************ STUFF I DON'T USE ******************
;
;; For Pure
;
;(require 'pure-mode)
;(setq auto-mode-alist (cons '("\\.pure$" . pure-mode) auto-mode-
alist))
;(add-hook 'pure-mode-hook 'turn-on-font-lock)
;(add-hook 'pure-eval-mode-hook 'turn-on-font-lock)
;(global-set-key "\C-c\M-p" 'run-pure)
;(global-set-key "\C-h\M-p" 'pure-help)
;(require 'w3m-load)
;
;; QiII -- Waiting for Shen
;
;(defun qi ()
;  "Run QiII in an Emacs buffer."
;  (interactive)
;  (let ((lisp-program-name "/Users/daviddreisigmeyer/lisp/My_Lisp/qi/
Lisp"))
;    (run-lisp lisp-program-name)))
;
;; *** THIS IS FOR SCHEME ***
;
;(add-hook 'scheme-mode-hook (lambda () (paredit-mode +1)))
;(add-hook 'inferior-scheme-mode-hook (lambda () (paredit-mode +1)))
;
;; RACKET - I mainly use DrRacket
;
;(defun racket ()
;  "Run Racket Scheme in an Emacs buffer."
;  (interactive)
;  (require 'quack)
;  (let ((scheme-program-name "/Users/daviddreisigmeyer/lisp/My_Lisp/
Racket_5.0/bin/racket"))
;    (run-scheme scheme-program-name)))
;
;; *** THIS IS FOR PHP ***
;
;(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
;(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
;(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
;
;; KAWA
;
;(defun kawa ()
;  "Run Kawa Scheme in an Emacs buffer."
;  (interactive)
;  (require 'quack)
;  (let ((scheme-program-name "/Users/daviddreisigmeyer/lisp/My_Lisp/
kawa/bin/kawa"))
;    (run-scheme scheme-program-name)))
;
;; MIT-SCHEME
;
;(defun mit ()
;  "Run MIT Scheme in an Emacs buffer."
;  (interactive)
;  (require 'quack)
;  (let ((scheme-program-name "/opt/local/bin/mit-scheme"))
;    (run-scheme scheme-program-name)))
;
;; *** THIS IS FOR SCALA ***
;
;(let ((path "/Users/daviddreisigmeyer/.emacs.d/site-lisp/scala"))
;  (setq load-path (cons path load-path))
;  (load "scala-mode-auto.el"))
;(defun scala-turnoff-indent-tabs-mode ()
;  (setq indent-tabs-mode nil))
;(add-hook 'scala-mode-hook 'scala-turnoff-indent-tabs-mode)
;(load "/Users/daviddreisigmeyer/.emacs.d/site-lisp/sbt/sbt.el")
;
;; *************************************************


;; *** OTHER STUFF ***
;; These are put in by other programs

(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 t)
 '(column-number-mode t)
 '(ecb-layout-window-sizes nil)
 '(ecb-options-version "2.40")
 '(jde-compiler (quote ("javac" "")))
 '(jde-jdk (quote ("1.6.0")))
 '(jde-jdk-registry (quote (("1.6.0" . "/System/Library/Frameworks/
JavaVM.framework/Versions/CurrentJDK"))))
 '(quack-default-program "racket")
 '(quack-programs (quote ("racket" "bigloo" "csi" "csi -hygienic"
"gosh" "gsi" "gsi ~~/syntax-case.scm -" "guile" "kawa" "mit-scheme"
"mred -z" "mzscheme" "mzscheme -il r6rs" "mzscheme -il typed-scheme"
"mzscheme -M errortrace" "mzscheme3m" "mzschemecgc" "rs" "scheme"
"scheme48" "scsh" "sisc" "stklos" "sxi")))
 '(show-paren-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.
 '(show-paren-match ((t (:background "grey30")))))



On Aug 17, 10:59 am, HB <hubaghd...@gmail.com> wrote:
> Hey,
> How to install Clojure on Mac OS X?
> I googled the web, some use MacPorts, others write some shell scripts.
> Is there a -standard- way to install Clojure on OS X (if possible,
> please don't refer me to MacPorts)?
> Thanks all for help and time.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to