Skip to content

Commit

Permalink
Update live packs based on previous development. See recent commits f…
Browse files Browse the repository at this point in the history
…or history.
  • Loading branch information
samaaron committed Mar 30, 2013
1 parent c6abfb2 commit fa718c2
Show file tree
Hide file tree
Showing 76 changed files with 2,831 additions and 6,099 deletions.
3 changes: 2 additions & 1 deletion packs/live/bindings-pack/config/default-bindings.el
Expand Up @@ -33,6 +33,7 @@
(global-set-key (kbd "C-c g p") 'git-gutter:previous-diff)
(global-set-key (kbd "C-c g n") 'git-gutter:next-diff)
(global-set-key (kbd "C-c g d") 'git-gutter:popup-diff)
(global-set-key (kbd "C-c g r") 'git-gutter:revert-hunk)

;;text manipulation shortcuts
(global-set-key (kbd "C-c t b") 'untabify-buffer)
Expand Down Expand Up @@ -185,7 +186,7 @@
;; File
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-x C-M-f") 'find-file-in-project)
(global-set-key (kbd "C-x f") 'recentf-ido-find-file)
(global-set-key (kbd "C-x f") 'live-recentf-ido-find-file)
(global-set-key (kbd "C-x C-r") 'ido-recentf-open)
(global-set-key (kbd "M-`") 'file-cache-minibuffer-complete)
(global-set-key (kbd "C-x C-b") 'ibuffer)
Expand Down
33 changes: 33 additions & 0 deletions packs/live/clojure-pack/config/nrepl-conf.el
Expand Up @@ -26,6 +26,7 @@
(kbd "}") 'paredit-close-curly)))

(setq nrepl-popup-stacktraces nil)
(setq nrepl-popup-stacktraces-in-repl nil)
(add-to-list 'same-window-buffer-names "*nrepl*")

;;Auto Complete
Expand All @@ -45,6 +46,38 @@

;;; Monkey Patch nREPL with better behaviour:

(defun live-nrepl-err-handler (buffer ex root-ex session)
"Make an error handler for BUFFER, EX, ROOT-EX and SESSION."
;; TODO: use ex and root-ex as fallback values to display when pst/print-stack-trace-not-found
(let ((replp (equal 'nrepl-mode (buffer-local-value 'major-mode buffer))))
(if (or (and nrepl-popup-stacktraces-in-repl replp)
(and nrepl-popup-stacktraces (not replp)))
(lexical-let ((nrepl-popup-on-error nrepl-popup-on-error)
(err-buffer (nrepl-popup-buffer nrepl-error-buffer t)))
(with-current-buffer buffer
(nrepl-send-string "(if-let [pst+ (clojure.core/resolve 'clj-stacktrace.repl/pst+)]
(pst+ *e) (clojure.stacktrace/print-stack-trace *e))"
(nrepl-make-response-handler err-buffer
'()
(lambda (err-buffer str)
(with-current-buffer err-buffer (goto-char (point-max)))
(nrepl-emit-into-popup-buffer err-buffer str)
(with-current-buffer err-buffer (goto-char (point-min)))
)
(lambda (err-buffer str)
(with-current-buffer err-buffer (goto-char (point-max)))
(nrepl-emit-into-popup-buffer err-buffer str)
(with-current-buffer err-buffer (goto-char (point-min)))
)
'())
(nrepl-current-ns)
(nrepl-current-tooling-session)))
(with-current-buffer nrepl-error-buffer
(compilation-minor-mode 1))
))))

;;(setq nrepl-err-handler 'live-nrepl-err-handler)

;;; Region discovery fix
(defun nrepl-region-for-expression-at-point ()
"Return the start and end position of defun at point."
Expand Down
3 changes: 3 additions & 0 deletions packs/live/clojure-pack/init.el
Expand Up @@ -2,6 +2,9 @@

(require 'rainbow-delimiters)

(live-add-pack-lib "uuid")
(require 'uuid)

(live-load-config-file "paredit-conf.el")
(live-load-config-file "mic-paren-conf.el")
(live-load-config-file "highlight-flash-conf.el")
Expand Down
26 changes: 16 additions & 10 deletions packs/live/clojure-pack/lib/clojure-mode/README.md
Expand Up @@ -65,16 +65,22 @@ current buffer with <kbd>C-c C-,</kbd>. Failing tests and errors will be
highlighted using overlays. To clear the overlays, use <kbd>C-c k</kbd>.

You can jump between implementation and test files with <kbd>C-c C-t</kbd> if
your project is laid out in a way that clojure-test-mode expects. Your
project root should have a `src/` directory containing files that
correspond to their namespace. It should also have a `test/` directory
containing files that correspond to their namespace, and the test
namespaces should mirror the implementation namespaces with the
addition of "-test" as the suffix to the last segment of the namespace.

So `my.project.frob` would be found in `src/my/project/frob.clj` and
its tests would be in `test/my/project/frob_test.clj` in the
`my.project.frob-test` namespace.
your project is laid out in a way that clojure-test-mode expects. Your project
root should have a `src/` directory containing files that correspond to their
namespace. It should also have a `test/` directory containing files that
correspond to their namespace, and the test namespaces should mirror the
implementation namespaces with the addition of "-test" as the suffix to the last
segment of the namespace.

So `my.project.frob` would be found in `src/my/project/frob.clj` and its tests
would be in `test/my/project/frob_test.clj` in the `my.project.frob-test`
namespace.

This behavior can also be overridden by setting `clojure-test-for-fn` and
`clojure-test-implementation-for-fn` with functions of your choosing.
`clojure-test-for-fn` takes an implementation namespace and returns the full
path of the test file. `clojure-test-implementation-for-fn` takes a test
namespace and returns the full path for the implementation file.

## Paredit

Expand Down
10 changes: 6 additions & 4 deletions packs/live/clojure-pack/lib/clojure-mode/clojure-mode.el
Expand Up @@ -6,7 +6,7 @@
;; Lennart Staflin <lenst@lysator.liu.se>
;; Phil Hagelberg <technomancy@gmail.com>
;; URL: http://github.com/technomancy/clojure-mode
;; Version: 2.0.0
;; Version: 2.1.0
;; Keywords: languages, lisp

;; This file is not part of GNU Emacs.
Expand Down Expand Up @@ -189,7 +189,7 @@
"load-file" "load-reader" "load-string" "loaded-libs" "locking"
"long" "long-array" "longs" "loop" "macroexpand"
"macroexpand-1" "make-array" "make-hierarchy" "map" "map?"
"mapcat" "max" "max-key" "memfn" "memoize"
"map-indexed" "mapcat" "max" "max-key" "memfn" "memoize"
"merge" "merge-with" "meta" "method-sig" "methods"
"min" "min-key" "mod" "name" "namespace"
"neg?" "newline" "next" "nfirst" "nil?"
Expand Down Expand Up @@ -388,7 +388,7 @@ numbers count from the end:
leiningen.compile -> leiningen.test.compile (uses 1)
clojure.http.client -> clojure.http.test.client (uses -1)")

(defvar clojure-mode-version "2.0.0"
(defvar clojure-mode-version "2.1.0"
"The current version of `clojure-mode'.")

(defun clojure-mode-display-version ()
Expand Down Expand Up @@ -913,7 +913,7 @@ This function also returns nil meaning don't specify the indentation."
((or (eq method 'defun)
(and (null method)
(> (length function) 3)
(string-match "\\`\\(?:\\S +/\\)?def\\|with-"
(string-match "\\`\\(?:\\S +/\\)?\\(def\\|with-\\)"
function)))
(lisp-indent-defform state indent-point))

Expand Down Expand Up @@ -1279,6 +1279,8 @@ Clojure test file for the given namespace.")
(put 'clojure-mode-load-command 'safe-local-variable 'stringp)

(add-to-list 'auto-mode-alist '("\\.clj\\'" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.dtm\\'" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.edn\\'" . clojure-mode))
(add-to-list 'interpreter-mode-alist '("jark" . clojure-mode))
(add-to-list 'interpreter-mode-alist '("cake" . clojure-mode)))

Expand Down
31 changes: 18 additions & 13 deletions packs/live/clojure-pack/lib/clojure-mode/clojure-test-mode.el
Expand Up @@ -4,7 +4,7 @@

;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode
;; Version: 2.0.0
;; Version: 2.1.0
;; Keywords: languages, lisp, test
;; Package-Requires: ((clojure-mode "1.7") (nrepl "0.1.7"))

Expand All @@ -22,18 +22,23 @@
;; current buffer with C-c C-,. Failing tests and errors will be
;; highlighted using overlays. To clear the overlays, use C-c k.

;; You can jump between implementation and test files with C-c t if
;; your project is laid out in a way that clojure-test-mode
;; expects. Your project root should have a src/ directory containing
;; files that correspond to their namespace. It should also have a
;; test/ directory containing files that correspond to their
;; namespace, and the test namespaces should mirror the implementation
;; namespaces with the addition of "test" as the second-to-last
;; segment of the namespace.

;; So my.project.frob would be found in src/my/project/frob.clj and
;; its tests would be in test/my/project/test/frob.clj in the
;; my.project.test.frob namespace.
;; You can jump between implementation and test files with <kbd>C-c C-t</kbd> if
;; your project is laid out in a way that clojure-test-mode expects. Your
;; project root should have a `src/` directory containing files that correspond
;; to their namespace. It should also have a `test/` directory containing files
;; that correspond to their namespace, and the test namespaces should mirror the
;; implementation namespaces with the addition of "-test" as the suffix to the
;; last segment of the namespace.

;; So `my.project.frob` would be found in `src/my/project/frob.clj` and its
;; tests would be in `test/my/project/frob_test.clj` in the
;; `my.project.frob-test` namespace.

;; This behavior can also be overridden by setting `clojure-test-for-fn` and
;; `clojure-test-implementation-for-fn` with functions of your choosing.
;; `clojure-test-for-fn` takes an implementation namespace and returns the full
;; path of the test file. `clojure-test-implementation-for-fn` takes a test
;; namespace and returns the full path for the implementation file.

;;; History:

Expand Down
23 changes: 21 additions & 2 deletions packs/live/clojure-pack/lib/nrepl/CHANGELOG.md
@@ -1,10 +1,16 @@
# Changelog

## 0.1.7 (current)
## 0.1.8 (current)

### New features

* Add support for multiple nrepl session. A single session is closed with
### Bugs fixed

## 0.1.7 / 2013-03-13

### New features

* Add support for multiple nrepl sessions. A single session is closed with
`M-x nrepl-close`. A repl session is made default with
`M-x nrepl-make-repl-connection-default`.
* Added support for pretty-printing in the REPL buffer.
Expand All @@ -18,10 +24,23 @@ bound to <kbd>C-c M-c</kbd>.
* Added `nrepl-hide-special-buffers` setting to control the display of special
buffers like `*nrepl-server*` and `*nrepl-connection*`.
* Apply ANSI color codes to output sent to nrepl buffers.
* Add a connection browser `nrepl-connection-browser` to allow control of
multiple connections.
* Add macroexpand key bindings to `nrepl-mode-map`.
* Don't suppress namespaces in macroexpansion.
* Add explicit require of expected namespaces in the repl buffer.
* Add command `nrepl-pprint-eval-last-expression`.
* Add an event buffer for debugging.
* Allow connections without repl buffers.
* Add hook `nrepl-file-loaded-hook` which runs on load-file
completion.
* Expand ido-completion to include "used" variables in addition to
"interned" variables.

### Bugs fixed

* More accurate matching of filenames in stacktraces.
* Fix #290 - Macroexpand buffer truncates long expansions

## 0.1.6 / 2013-01-29

Expand Down

0 comments on commit fa718c2

Please sign in to comment.