Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed to el-get and package reordering

  • Loading branch information...
commit 928ca7a6bed086156d90443743b056358a9efdb1 1 parent 61ddb3e
@diasjorge authored
Showing with 52 additions and 63,028 deletions.
  1. +0 −54 .gitmodules
  2. 0  abbrev_defs
  3. +52 −13 elisp/customization_functions.el → custom_functions.el
  4. +0 −1  elisp/auto-complete
  5. +0 −123 elisp/autotest.el
  6. +0 −7 elisp/clojure-mode/.gitignore
  7. +0 −56 elisp/clojure-mode/README.md
  8. +0 −938 elisp/clojure-mode/clojure-mode.el
  9. +0 −437 elisp/clojure-mode/clojure-test-mode.el
  10. +0 −34 elisp/clojure-mode/test.clj
  11. +0 −31 elisp/color-theme/AUTHORS
  12. +0 −71 elisp/color-theme/BUGS
  13. +0 −342 elisp/color-theme/COPYING
  14. +0 −121 elisp/color-theme/ChangeLog
  15. +0 −26 elisp/color-theme/HACKING
  16. +0 −141 elisp/color-theme/Makefile
  17. +0 −39 elisp/color-theme/Makefile.defs
  18. +0 −86 elisp/color-theme/README
  19. +0 −64 elisp/color-theme/blackboard.el
  20. 0  elisp/color-theme/build-stamp
  21. +0 −15 elisp/color-theme/color-theme-autoloads.in
  22. +0 −793 elisp/color-theme/color-theme-hober2.el
  23. +0 −1,668 elisp/color-theme/color-theme.el
  24. 0  elisp/color-theme/configure-stamp
  25. +0 −22 elisp/color-theme/themes/color-theme-example.el
  26. +0 −13,539 elisp/color-theme/themes/color-theme-library.el
  27. +0 −1  elisp/cucumber
  28. +0 −17 elisp/drupal-mode.el
  29. +0 −319 elisp/emacs-goodies-el/README.Debian
  30. +0 −100 elisp/emacs-goodies-el/align-string.el
  31. +0 −228 elisp/emacs-goodies-el/all.el
  32. +0 −615 elisp/emacs-goodies-el/apache-mode.el
  33. +0 −971 elisp/emacs-goodies-el/ascii.el
  34. +0 −89 elisp/emacs-goodies-el/auto-fill-inhibit.el
  35. +0 −187 elisp/emacs-goodies-el/bar-cursor.el
  36. +0 −1,342 elisp/emacs-goodies-el/bm.el
  37. +0 −585 elisp/emacs-goodies-el/boxquote.el
  38. +0 −235 elisp/emacs-goodies-el/browse-huge-tar.el
  39. +0 −1,050 elisp/emacs-goodies-el/browse-kill-ring.el
  40. +0 −355 elisp/emacs-goodies-el/clipper.el
  41. +0 −115 elisp/emacs-goodies-el/coffee.el
  42. +0 −13,539 elisp/emacs-goodies-el/color-theme-library.el
  43. +0 −1,669 elisp/emacs-goodies-el/color-theme.el
  44. +0 −49 elisp/emacs-goodies-el/color-theme_seldefcustom.el
  45. +0 −1,286 elisp/emacs-goodies-el/csv-mode.el
  46. +0 −1,742 elisp/emacs-goodies-el/ctypes.el
  47. +0 −33 elisp/emacs-goodies-el/cwebm.el
  48. +0 −53 elisp/emacs-goodies-el/dedicated.el
  49. +0 −280 elisp/emacs-goodies-el/df.el
  50. +0 −633 elisp/emacs-goodies-el/dict.el
  51. +0 −293 elisp/emacs-goodies-el/diminish.el
  52. +0 −183 elisp/emacs-goodies-el/dir-locals.el
  53. +0 −186 elisp/emacs-goodies-el/edit-env.el
  54. +0 −336 elisp/emacs-goodies-el/egocentric.el
  55. +0 −169 elisp/emacs-goodies-el/emacs-goodies-build.el
  56. +0 −598 elisp/emacs-goodies-el/emacs-goodies-custom.el
  57. +0 −319 elisp/emacs-goodies-el/emacs-goodies-el.el
  58. +0 −4,115 elisp/emacs-goodies-el/emacs-goodies-el.texi
  59. +0 −2,091 elisp/emacs-goodies-el/emacs-goodies-loaddefs.el
  60. +0 −1  elisp/emacs-goodies-el/emacs-goodies-loaddefs.make
  61. +0 −308 elisp/emacs-goodies-el/eproject-extras.el
  62. +0 −679 elisp/emacs-goodies-el/eproject.el
  63. +0 −1,039 elisp/emacs-goodies-el/ff-paths.el
  64. +0 −981 elisp/emacs-goodies-el/filladapt.el
  65. +0 −205 elisp/emacs-goodies-el/floatbg.el
  66. +0 −5,403 elisp/emacs-goodies-el/folding.el
  67. +0 −939 elisp/emacs-goodies-el/framepop.el
  68. +0 −944 elisp/emacs-goodies-el/graphviz-dot-mode.el
  69. +0 −125 elisp/emacs-goodies-el/highlight-beyond-fill-column.el
Sorry, we could not display the entire diff because it was too big.
View
54 .gitmodules
@@ -1,54 +0,0 @@
-[submodule "elisp/git-emacs"]
- path = elisp/git-emacs
- url = git://github.com/tsgates/git-emacs.git
-[submodule "elisp/rinari"]
- path = elisp/rinari
- url = git://github.com/eschulte/rinari.git
-[submodule "elisp/gist"]
- path = elisp/gist
- url = git://github.com/diasjorge/gist.el.git
-[submodule "elisp/cucumber"]
- path = elisp/cucumber
- url = git://github.com/michaelklishin/cucumber.el.git
-[submodule "elisp/jekyll"]
- path = elisp/jekyll
- url = git@github.com:diasjorge/jekyll.el.git
-[submodule "elisp/auto-complete"]
- path = elisp/auto-complete
- url = git://github.com/m2ym/auto-complete.git
-[submodule "elisp/inf-ruby-bond"]
- path = elisp/inf-ruby-bond
- url = http://github.com/pd/inf-ruby-bond.git
-[submodule "elisp/zencoding"]
- path = elisp/zencoding
- url = git://github.com/chrisdone/zencoding.git
-[submodule "elisp/rvm"]
- path = elisp/rvm
- url = git://github.com/senny/rvm.el.git
-[submodule "elisp/haml-mode"]
- path = elisp/haml-mode
- url = git://github.com/nex3/haml-mode.git
-[submodule "elisp/sass-mode"]
- path = elisp/sass-mode
- url = git://github.com/nex3/sass-mode.git
-[submodule "elisp/magit"]
- path = elisp/magit
- url = git://github.com/magit/magit.git
-[submodule "elisp/nxhtml"]
- path = elisp/nxhtml
- url = https://github.com/emacsmirror/nxhtml.git
-[submodule "elisp/ruby-test-mode"]
- path = elisp/ruby-test-mode
- url = git@github.com:diasjorge/ruby-test-mode.git
-[submodule "elisp/yaml-mode"]
- path = elisp/yaml-mode
- url = git@github.com:diasjorge/yaml-mode.git
-[submodule "elisp/solarized"]
- path = elisp/solarized
- url = https://github.com/sellout/emacs-color-theme-solarized.git
-[submodule "elisp/clojure-mode"]
- path = elisp/clojure-mode
- url = git://github.com/technomancy/clojure-mode.git
-[submodule "elisp/find-file-in-project"]
- path = elisp/find-file-in-project
- url = git://github.com/technomancy/find-file-in-project.git
View
0  abbrev_defs
No changes.
View
65 elisp/customization_functions.el → custom_functions.el
@@ -18,7 +18,7 @@
(interactive "p")
(end-of-line)
(open-line arg)
- (forward-line)
+ (next-line 1)
(when newline-and-indent
(indent-according-to-mode)))
@@ -85,16 +85,55 @@
(switch-to-buffer-other-window (current-buffer))
(ruby-test-toggle-implementation-and-specification))
-(defun ruby-generate-tags()
+(defun rinari-generate-tags()
(interactive)
- (let ((root (ffip-project-root)))
- (let ((my-tags-file (concat root "TAGS")))
- (message "Regenerating TAGS file: %s" my-tags-file)
- (if (file-exists-p my-tags-file)
- (delete-file my-tags-file))
- (shell-command
- (format "find %s -iname '*.rb' | grep -v db | xargs ctags -a -e -f %s"
- root my-tags-file))
- (if (get-file-buffer my-tags-file)
- (kill-buffer (get-file-buffer my-tags-file)))
- (visit-tags-table my-tags-file))))
+ (let ((my-tags-file (concat (rinari-root) "TAGS"))
+ (root (rinari-root)))
+ (message "Regenerating TAGS file: %s" my-tags-file)
+ (if (file-exists-p my-tags-file)
+ (delete-file my-tags-file))
+ (shell-command
+ (format "find %s -iname '*.rb' | grep -v db | xargs ctags -a -e -f %s"
+ root my-tags-file))
+ (if (get-file-buffer my-tags-file)
+ (kill-buffer (get-file-buffer my-tags-file)))
+ (visit-tags-table my-tags-file)))
+
+;; HAML
+(defun haml-convert-erb-file (rhtmlFile)
+ "Convert an erb file to haml and opens a new buffer"
+ (interactive "fSelect erb file: \n")
+ (let ((hamlFile (replace-regexp-in-string ".erb" ".haml" rhtmlFile)))
+ (let ((comando (concat "html2haml -e "
+ rhtmlFile
+ " "
+ hamlFile)))
+ (shell-command comando)
+ (find-file hamlFile))))
+
+(defun haml-convert-region (beg end)
+ "Convert selected region to haml"
+ (interactive "r")
+ (let ((comando "html2haml -r -s"))
+ (shell-command-on-region beg end comando (buffer-name) t)))
+
+(defun haml-to-html-region (beg end)
+ "Convert selected region to html"
+ (interactive "r")
+ (let ((comando "haml -s -c"))
+ (shell-command-on-region beg end comando (buffer-name) t)))
+
+(defun haml-convert-buffer ()
+ "Convert selected buffer to haml"
+ (interactive)
+ (let ((nuevoarchivo
+ (replace-regexp-in-string "r?html\\(.erb\\)?$" "haml"
+ (buffer-file-name))))
+ (haml-convert-region (point-min) (point-max))
+ (write-file nuevoarchivo)))
+
+(defun sass-convert-region (beg end)
+ "Convert selected region to sass"
+ (interactive "r")
+ (let ((comando "css2sass -s"))
+ (shell-command-on-region beg end comando (buffer-name) t)))
1  elisp/auto-complete
@@ -1 +0,0 @@
-Subproject commit 5e7e67aca82e70c0d44cc2dd783a9922dc99e380
View
123 elisp/autotest.el
@@ -1,123 +0,0 @@
-;;; autotest.el - ZenTest's autotest integration with emacs.
-
-;; Copyright (C) 2006-2007 by Ryan Davis
-
-;; Author: Ryan Davis <ryand-ruby@zenspider.com>
-;; Version 1.0
-;; Keywords: testing, ruby, convenience
-;; Created: 2006-11-17
-;; Compatibility: Emacs 22, 21?
-;; URL(en): http://seattlerb.rubyforge.org/
-;; by Ryan Davis - ryan-ruby@zenspider.com
-
-;;; The MIT License:
-
-;; http://en.wikipedia.org/wiki/MIT_License
-;;
-;; Permission is hereby granted, free of charge, to any person obtaining
-;; a copy of this software and associated documentation files (the
-;; "Software"), to deal in the Software without restriction, including
-;; without limitation the rights to use, copy, modify, merge, publish,
-;; distribute, sublicense, and/or sell copies of the Software, and to
-;; permit persons to whom the Software is furnished to do so, subject to
-;; the following conditions:
-
-;; The above copyright notice and this permission notice shall be
-;; included in all copies or substantial portions of the Software.
-
-;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-;;; Commentary:
-
-;; Sets up an autotest buffer and provides convenience methods.
-
-;;; History:
-;; 1.0.0 - 2008-09-25 - Added an extra regexp for rspec/mspec. 1.0.0 release.
-;; 1.0b4 - 2007-09-25 - Added autotest-use-ui and autotest-command vars.
-;; 1.0b3 - 2007-05-10 - emacs compatibility fixes and improved regexps.
-;; 1.0b2 - 2007-04-03 - added autotest plugin / communication support
-;; 1.0b1 - 2007-03-06 - initial release
-
-(require 'shell)
-
-(defcustom autotest-use-ui nil
- "Should we use test-unit's UI?"
- :group 'autotest
- :type '(boolean))
-
-(defcustom autotest-command "autotest"
- "Command name to use to execute autotest."
- :group 'autotest
- :type '(string))
-
-(defun autotest ()
- "Fire up an instance of autotest in its own buffer with shell bindings and compile-mode highlighting and linking."
- (interactive)
- (let ((buffer (shell "*autotest*")))
-
- (define-key shell-mode-map "\C-c\C-a" 'autotest-switch)
-
- (set (make-local-variable 'comint-output-filter-functions)
- '(comint-truncate-buffer
- comint-postoutput-scroll-to-bottom
- ansi-color-process-output
- ))
- (set (make-local-variable 'comint-buffer-maximum-size) 5000)
- (set (make-local-variable 'comint-scroll-show-maximum-output) t)
- (set (make-local-variable 'comint-scroll-to-bottom-on-output) t)
-
- (set (make-local-variable 'compilation-error-regexp-alist)
- '(
- ("^ +\\(#{RAILS_ROOT}/\\)?\\([^(:]+\\):\\([0-9]+\\)" 2 3)
- ("\\[\\(.*\\):\\([0-9]+\\)\\]:$" 1 2)
- ("^ *\\([[+]\\)?\\([^:
-]+\\):\\([0-9]+\\):" 2 3)
- ("^.* at \\([^:]*\\):\\([0-9]+\\)$" 1 2)
- ))
- (ansi-color-for-comint-mode-on)
- (compilation-shell-minor-mode)
- (comint-send-string buffer (concat autotest-command "\n"))))
-
-(defun autotest-switch ()
- "Switch back and forth between autotest and the previous buffer"
- (interactive)
- (if (equal "*autotest*" (buffer-name))
- (switch-to-buffer (other-buffer))
- (switch-to-buffer "*autotest*")))
-
-(eval-when-compile
- (require 'unit-test nil t))
-
-(if (and autotest-use-ui (require 'unit-test nil t))
- (progn
- (message "starting emacs server for autotest")
- (setq unit-test-colours (acons "gray" "#999999" unit-test-colours))
- (setq unit-test-colours (acons "dark-gray" "#666666" unit-test-colours))
- (setq unit-test-running-xpm (unit-test-dot "gray"))
- (server-start)
- (defun autotest-update (status)
- "Updates all buffer's modeline with the current test status."
- (interactive "S")
- (let ((autotest-map (make-sparse-keymap)))
- (define-key autotest-map [mode-line mouse-1] 'autotest-switch)
- (mapcar (lambda (buffer)
- (with-current-buffer buffer
- (if (eq status 'quit)
- (show-test-none)
- (progn
- (show-test-status status)
- (put-text-property
- 0 3
- 'keymap autotest-map
- (car mode-line-buffer-identification))))))
- (remove-if 'minibufferp (buffer-list))))
- status))
- (message "unit-test not found, not starting autotest/emacs integration"))
-
-(provide 'autotest)
View
7 elisp/clojure-mode/.gitignore
@@ -1,7 +0,0 @@
-# temporary files
-*~
-*\#*\#
-*.\#*
-
-# Emacs byte-compiled files
-*.elc
View
56 elisp/clojure-mode/README.md
@@ -1,56 +0,0 @@
-# Clojure Mode
-
-Provides Emacs font-lock, indentation, and navigation for the
-[Clojure language](http://clojure.org).
-
-## Installation
-
-It's easiest to install and keep Clojure Mode updated using
-[package.el](http://bit.ly/pkg-el23).
-
- ;; add to ~/.emacs.d/init.el if you aren't already using Marmalade.
- (require 'package)
- (add-to-list 'package-archives
- '("marmalade" . "http://marmalade-repo.org/packages/"))
- (package-initialize)
-
- M-x eval-buffer
-
- M-x package-install clojure-mode
-
-If you use a version of Emacs prior to 24 that doesn't include
-package.el, you can get it from http://bit.ly/pkg-el23. If you have an
-older package.el installed from tromey.com, you should upgrade in
-order to support installation from multiple sources.
-
-Of course, it's possible to just place it on your load-path and
-require it as well if you don't mind missing out on
-byte-compilation and autoloads.
-
-## Paredit
-
-Using clojure-mode with paredit is highly recommended. It is also
-available using package.el from the above archive.
-
-Use paredit as you normally would with any other mode; for instance:
-
- ;; (require 'paredit) if you didn't install via package.el
- (defun turn-on-paredit () (paredit-mode 1))
- (add-hook 'clojure-mode-hook 'turn-on-paredit)
-
-## SLIME
-
-You can use [Leiningen](http://github.com/technomancy/leiningen) for
-better interaction with subprocesses via SLIME.
-
- $ wget https://github.com/technomancy/leiningen/raw/stable/bin/lein
- [place the "lein" script on your $PATH and make it executable]
- $ lein plugin install swank-clojure 1.3.1
-
- M-x clojure-jack-in # from inside a project
-
-## License
-
-Copyright © 2007-2011 Jeffrey Chu, Lennart Staflin, Phil Hagelberg
-
-Distributed under the GNU General Public License; see C-h t to view.
View
938 elisp/clojure-mode/clojure-mode.el
@@ -1,938 +0,0 @@
-;;; clojure-mode.el --- Major mode for Clojure code
-
-;; Copyright (C) 2007-2011 Jeffrey Chu, Lennart Staflin, Phil Hagelberg
-;;
-;; Authors: Jeffrey Chu <jochu0@gmail.com>
-;; Lennart Staflin <lenst@lysator.liu.se>
-;; Phil Hagelberg <technomancy@gmail.com>
-;; URL: http://github.com/technomancy/clojure-mode
-;; Version: 1.10.0
-;; Keywords: languages, lisp
-
-;; This file is not part of GNU Emacs.
-
-;;; Commentary:
-
-;; Provides font-lock, indentation, and navigation for the Clojure
-;; language. (http://clojure.org)
-
-;; Users of older Emacs (pre-22) should get version 1.4:
-;; http://github.com/technomancy/clojure-mode/tree/1.4
-
-;;; Installation:
-
-;; Use package.el. You'll need to add Marmalade to your archives:
-
-;; (require 'package)
-;; (add-to-list 'package-archives
-;; '("marmalade" . "http://marmalade-repo.org/packages/"))
-
-;; If you use a version of Emacs prior to 24 that doesn't include
-;; package.el, you can get it from http://bit.ly/pkg-el23. If you have
-;; an older package.el installed from tromey.com, you should upgrade
-;; in order to support installation from multiple sources.
-
-;; Of course, it's possible to just place it on your load-path and
-;; require it as well if you don't mind missing out on
-;; byte-compilation and autoloads.
-
-;; Using clojure-mode with paredit is highly recommended. It is also
-;; available using package.el from the above archive.
-
-;; Use paredit as you normally would with any other mode; for instance:
-;;
-;; ;; require or autoload paredit-mode
-;; (defun turn-on-paredit () (paredit-mode 1))
-;; (add-hook 'clojure-mode-hook 'turn-on-paredit)
-
-;; See Swank Clojure (http://github.com/technomancy/swank-clojure) for
-;; better interaction with subprocesses via SLIME.
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License
-;; as published by the Free Software Foundation; either version 3
-;; of the License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Code:
-
-(require 'cl)
-
-(defgroup clojure-mode nil
- "A mode for Clojure"
- :prefix "clojure-mode-"
- :group 'applications)
-
-(defcustom clojure-mode-font-lock-comment-sexp nil
- "Set to non-nil in order to enable font-lock of (comment...)
-forms. This option is experimental. Changing this will require a
-restart (ie. M-x clojure-mode) of existing clojure mode buffers."
- :type 'boolean
- :group 'clojure-mode)
-
-(defcustom clojure-mode-load-command "(clojure.core/load-file \"%s\")\n"
- "*Format-string for building a Clojure expression to load a file.
-This format string should use `%s' to substitute a file name
-and should result in a Clojure expression that will command the inferior
-Clojure to load that file."
- :type 'string
- :group 'clojure-mode)
-
-(defcustom clojure-mode-use-backtracking-indent t
- "Set to non-nil to enable backtracking/context sensitive indentation."
- :type 'boolean
- :group 'clojure-mode)
-
-(defcustom clojure-max-backtracking 3
- "Maximum amount to backtrack up a list to check for context."
- :type 'integer
- :group 'clojure-mode)
-
-(defvar clojure-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map lisp-mode-shared-map)
- (define-key map "\e\C-x" 'lisp-eval-defun)
- (define-key map "\C-x\C-e" 'lisp-eval-last-sexp)
- (define-key map "\C-c\C-e" 'lisp-eval-last-sexp)
- (define-key map "\C-c\C-l" 'clojure-load-file)
- (define-key map "\C-c\C-r" 'lisp-eval-region)
- (define-key map "\C-c\C-z" 'run-lisp)
- (define-key map (kbd "RET") 'reindent-then-newline-and-indent)
- (define-key map (kbd "C-c t") 'clojure-jump-to-test)
- map)
- "Keymap for Clojure mode. Inherits from `lisp-mode-shared-map'.")
-
-(defvar clojure-mode-syntax-table
- (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table)))
- (modify-syntax-entry ?~ "' " table)
- ;; can't safely make commas whitespace since it will apply even
- ;; inside string literals--ick!
- ;; (modify-syntax-entry ?, " " table)
- (modify-syntax-entry ?\{ "(}" table)
- (modify-syntax-entry ?\} "){" table)
- (modify-syntax-entry ?\[ "(]" table)
- (modify-syntax-entry ?\] ")[" table)
- (modify-syntax-entry ?^ "'" table)
- table))
-
-(defvar clojure-mode-abbrev-table nil
- "Abbrev table used in clojure-mode buffers.")
-
-(define-abbrev-table 'clojure-mode-abbrev-table ())
-
-(defvar clojure-prev-l/c-dir/file nil
- "Record last directory and file used in loading or compiling.
-This holds a cons cell of the form `(DIRECTORY . FILE)'
-describing the last `clojure-load-file' or `clojure-compile-file' command.")
-
-(defvar clojure-test-ns-segment-position -1
- "Which segment of the ns is \"test\" inserted in your test name convention.
-
-Customize this depending on your project's conventions. Negative
-numbers count from the end:
-
- leiningen.compile -> leiningen.test.compile (uses 1)
- clojure.http.client -> clojure.http.test.client (uses -1)")
-
-(defun clojure-mode-version ()
- "Currently package.el doesn't support prerelease version numbers."
- "1.10.0")
-
-;;;###autoload
-(defun clojure-mode ()
- "Major mode for editing Clojure code - similar to Lisp mode.
-Commands:
-Delete converts tabs to spaces as it moves back.
-Blank lines separate paragraphs. Semicolons start comments.
-\\{clojure-mode-map}
-Note that `run-lisp' may be used either to start an inferior Lisp job
-or to switch back to an existing one.
-
-Entry to this mode calls the value of `clojure-mode-hook'
-if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (use-local-map clojure-mode-map)
- (setq mode-name "Clojure"
- major-mode 'clojure-mode
- imenu-create-index-function
- (lambda ()
- (imenu--generic-function '((nil clojure-match-next-def 0))))
- local-abbrev-table clojure-mode-abbrev-table
- indent-tabs-mode nil)
- (lisp-mode-variables nil)
- (set-syntax-table clojure-mode-syntax-table)
- (set (make-local-variable 'comment-start-skip)
- "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
- (set (make-local-variable 'lisp-indent-function)
- 'clojure-indent-function)
- (when (< emacs-major-version 24)
- (set (make-local-variable 'forward-sexp-function)
- 'clojure-forward-sexp))
- (set (make-local-variable 'lisp-doc-string-elt-property)
- 'clojure-doc-string-elt)
-
- (clojure-mode-font-lock-setup)
-
- (run-mode-hooks 'clojure-mode-hook)
- (run-hooks 'prog-mode-hook)
-
- ;; Enable curly braces when paredit is enabled in clojure-mode-hook
- (when (and (featurep 'paredit) paredit-mode (>= paredit-version 21))
- (define-key clojure-mode-map "{" 'paredit-open-curly)
- (define-key clojure-mode-map "}" 'paredit-close-curly)))
-
-(defun clojure-load-file (file-name)
- "Load a Lisp file into the inferior Lisp process."
- (interactive (comint-get-source "Load Clojure file: "
- clojure-prev-l/c-dir/file
- '(clojure-mode) t))
- (comint-check-source file-name) ; Check to see if buffer needs saved.
- (setq clojure-prev-l/c-dir/file (cons (file-name-directory file-name)
- (file-name-nondirectory file-name)))
- (comint-send-string (inferior-lisp-proc)
- (format clojure-mode-load-command file-name))
- (switch-to-lisp t))
-
-
-
-(defun clojure-match-next-def ()
- "Scans the buffer backwards for the next top-level definition.
-Called by `imenu--generic-function'."
- (when (re-search-backward "^\\s *(def\\S *[ \n\t]+" nil t)
- (save-excursion
- (goto-char (match-end 0))
- (when (looking-at "#?\\^")
- (let (forward-sexp-function) ; using the built-in one
- (forward-sexp))) ; skip the metadata
- (re-search-forward "[^ \n\t)]+"))))
-
-(defun clojure-mode-font-lock-setup ()
- "Configures font-lock for editing Clojure code."
- (interactive)
- (set (make-local-variable 'font-lock-multiline) t)
- (add-to-list 'font-lock-extend-region-functions
- 'clojure-font-lock-extend-region-def t)
-
- (when clojure-mode-font-lock-comment-sexp
- (add-to-list 'font-lock-extend-region-functions
- 'clojure-font-lock-extend-region-comment t)
- (make-local-variable 'clojure-font-lock-keywords)
- (add-to-list 'clojure-font-lock-keywords
- 'clojure-font-lock-mark-comment t)
- (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
-
- (setq font-lock-defaults
- '(clojure-font-lock-keywords ; keywords
- nil nil
- (("+-*/.<>=!?$%_&~^:@" . "w")) ; syntax alist
- nil
- (font-lock-mark-block-function . mark-defun)
- (font-lock-syntactic-face-function
- . lisp-font-lock-syntactic-face-function))))
-
-(defun clojure-font-lock-def-at-point (point)
- "Find the position range between the top-most def* and the
-fourth element afterwards. Note that this means there's no
-gaurantee of proper font locking in def* forms that are not at
-top-level."
- (goto-char point)
- (condition-case nil
- (beginning-of-defun)
- (error nil))
-
- (let ((beg-def (point)))
- (when (and (not (= point beg-def))
- (looking-at "(def"))
- (condition-case nil
- (progn
- ;; move forward as much as possible until failure (or success)
- (forward-char)
- (dotimes (i 4)
- (forward-sexp)))
- (error nil))
- (cons beg-def (point)))))
-
-(defun clojure-font-lock-extend-region-def ()
- "Move fontification boundaries to always include the first four
-elements of a def* forms."
- (let ((changed nil))
- (let ((def (clojure-font-lock-def-at-point font-lock-beg)))
- (when def
- (destructuring-bind (def-beg . def-end) def
- (when (and (< def-beg font-lock-beg)
- (< font-lock-beg def-end))
- (setq font-lock-beg def-beg
- changed t)))))
-
- (let ((def (clojure-font-lock-def-at-point font-lock-end)))
- (when def
- (destructuring-bind (def-beg . def-end) def
- (when (and (< def-beg font-lock-end)
- (< font-lock-end def-end))
- (setq font-lock-end def-end
- changed t)))))
- changed))
-
-(defun clojure-font-lock-extend-region-comment ()
- "Move fontification boundaries to always contain
- entire (comment ..) sexp. Does not work if you have a
- white-space between ( and comment, but that is omitted to make
- this run faster."
- (let ((changed nil))
- (goto-char font-lock-beg)
- (condition-case nil (beginning-of-defun) (error nil))
- (let ((pos (re-search-forward "(comment\\>" font-lock-end t)))
- (when pos
- (forward-char -8)
- (when (< (point) font-lock-beg)
- (setq font-lock-beg (point)
- changed t))
- (condition-case nil (forward-sexp) (error nil))
- (when (> (point) font-lock-end)
- (setq font-lock-end (point)
- changed t))))
- changed))
-
-(defun clojure-font-lock-mark-comment (limit)
- "Marks all (comment ..) forms with font-lock-comment-face."
- (let (pos)
- (while (and (< (point) limit)
- (setq pos (re-search-forward "(comment\\>" limit t)))
- (when pos
- (forward-char -8)
- (condition-case nil
- (add-text-properties (1+ (point)) (progn
- (forward-sexp) (1- (point)))
- '(face font-lock-comment-face multiline t))
- (error (forward-char 8))))))
- nil)
-
-(defconst clojure-font-lock-keywords
- (eval-when-compile
- `( ;; Definitions.
- (,(concat "(\\(?:clojure.core/\\)?\\("
- (regexp-opt '("defn" "defn-" "def" "def-" "defonce"
- "defmulti" "defmethod" "defmacro"
- "defstruct" "deftype" "defprotocol"
- "defrecord" "deftest"
- "slice" "def\\[a-z\\]"
- "defalias" "defhinted" "defmacro-"
- "defn-memo" "defnk" "defonce-"
- "defstruct-" "defunbound" "defunbound-"
- "defvar" "defvar-"))
- ;; Function declarations.
- "\\)\\>"
- ;; Any whitespace
- "[ \r\n\t]*"
- ;; Possibly type or metadata
- "\\(?:#?^\\(?:{[^}]*}\\|\\sw+\\)[ \r\n\t]*\\)*"
- "\\(\\sw+\\)?")
- (1 font-lock-keyword-face)
- (2 font-lock-function-name-face nil t))
- ;; Deprecated functions
- (,(concat
- "(\\(?:clojure.core/\\)?"
- (regexp-opt
- '("add-watcher" "remove-watcher" "add-classpath") t)
- "\\>")
- 1 font-lock-warning-face)
- ;; Control structures
- (,(concat
- "(\\(?:clojure.core/\\)?"
- (regexp-opt
- '("let" "letfn" "do"
- "case" "cond" "condp"
- "for" "loop" "recur"
- "when" "when-not" "when-let" "when-first"
- "if" "if-let" "if-not"
- "." ".." "->" "->>" "doto"
- "and" "or"
- "dosync" "doseq" "dotimes" "dorun" "doall"
- "load" "import" "unimport" "ns" "in-ns" "refer"
- "try" "catch" "finally" "throw"
- "with-open" "with-local-vars" "binding"
- "gen-class" "gen-and-load-class" "gen-and-save-class"
- "handler-case" "handle") t)
- "\\>")
- 1 font-lock-builtin-face)
- ;; Built-ins
- (,(concat
- "(\\(?:clojure.core/\\)?"
- (regexp-opt
- '("*" "*1" "*2" "*3" "*agent*"
- "*allow-unresolved-vars*" "*assert*" "*clojure-version*" "*command-line-args*" "*compile-files*"
- "*compile-path*" "*e" "*err*" "*file*" "*flush-on-newline*"
- "*in*" "*macro-meta*" "*math-context*" "*ns*" "*out*"
- "*print-dup*" "*print-length*" "*print-level*" "*print-meta*" "*print-readably*"
- "*read-eval*" "*source-path*" "*use-context-classloader*" "*warn-on-reflection*" "+"
- "-" "/"
- "<" "<=" "=" "==" ">"
- ">=" "accessor" "aclone"
- "agent" "agent-errors" "aget" "alength" "alias"
- "all-ns" "alter" "alter-meta!" "alter-var-root" "amap"
- "ancestors" "and" "apply" "areduce" "array-map"
- "aset" "aset-boolean" "aset-byte" "aset-char" "aset-double"
- "aset-float" "aset-int" "aset-long" "aset-short" "assert"
- "assoc" "assoc!" "assoc-in" "associative?" "atom"
- "await" "await-for" "await1" "bases" "bean"
- "bigdec" "bigint" "binding" "bit-and" "bit-and-not"
- "bit-clear" "bit-flip" "bit-not" "bit-or" "bit-set"
- "bit-shift-left" "bit-shift-right" "bit-test" "bit-xor" "boolean"
- "boolean-array" "booleans" "bound-fn" "bound-fn*" "butlast"
- "byte" "byte-array" "bytes" "case" "cast" "char"
- "char-array" "char-escape-string" "char-name-string" "char?" "chars"
- "chunk" "chunk-append" "chunk-buffer" "chunk-cons" "chunk-first"
- "chunk-next" "chunk-rest" "chunked-seq?" "class" "class?"
- "clear-agent-errors" "clojure-version" "coll?" "comment" "commute"
- "comp" "comparator" "compare" "compare-and-set!" "compile"
- "complement" "concat" "cond" "condp" "conj"
- "conj!" "cons" "constantly" "construct-proxy" "contains?"
- "count" "counted?" "create-ns" "create-struct" "cycle"
- "dec" "decimal?" "declare" "definline" "defmacro"
- "defmethod" "defmulti" "defn" "defn-" "defonce"
- "defstruct" "delay" "delay?" "deliver" "deref"
- "derive" "descendants" "destructure" "disj" "disj!"
- "dissoc" "dissoc!" "distinct" "distinct?" "doall"
- "doc" "dorun" "doseq" "dosync" "dotimes"
- "doto" "double" "double-array" "doubles" "drop"
- "drop-last" "drop-while" "empty" "empty?" "ensure"
- "enumeration-seq" "eval" "even?" "every?"
- "extend" "extend-protocol" "extend-type" "extends?" "extenders"
- "false?" "ffirst" "file-seq" "filter" "find" "find-doc"
- "find-ns" "find-var" "first" "float" "float-array"
- "float?" "floats" "flush" "fn" "fn?"
- "fnext" "for" "force" "format" "future"
- "future-call" "future-cancel" "future-cancelled?" "future-done?" "future?"
- "gen-class" "gen-interface" "gensym" "get" "get-in"
- "get-method" "get-proxy-class" "get-thread-bindings" "get-validator" "hash"
- "hash-map" "hash-set" "identical?" "identity" "if-let"
- "if-not" "ifn?" "import" "in-ns" "inc"
- "init-proxy" "instance?" "int" "int-array" "integer?"
- "interleave" "intern" "interpose" "into" "into-array"
- "ints" "io!" "isa?" "iterate" "iterator-seq"
- "juxt" "key" "keys" "keyword" "keyword?"
- "last" "lazy-cat" "lazy-seq" "let" "letfn"
- "line-seq" "list" "list*" "list?" "load"
- "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"
- "merge" "merge-with" "meta" "method-sig" "methods"
- "min" "min-key" "mod" "name" "namespace"
- "neg?" "newline" "next" "nfirst" "nil?"
- "nnext" "not" "not-any?" "not-empty" "not-every?"
- "not=" "ns" "ns-aliases" "ns-imports" "ns-interns"
- "ns-map" "ns-name" "ns-publics" "ns-refers" "ns-resolve"
- "ns-unalias" "ns-unmap" "nth" "nthnext" "num"
- "number?" "odd?" "or" "parents" "partial"
- "partition" "pcalls" "peek" "persistent!" "pmap"
- "pop" "pop!" "pop-thread-bindings" "pos?" "pr"
- "pr-str" "prefer-method" "prefers" "primitives-classnames" "print"
- "print-ctor" "print-doc" "print-dup" "print-method" "print-namespace-doc"
- "print-simple" "print-special-doc" "print-str" "printf" "println"
- "println-str" "prn" "prn-str" "promise" "proxy"
- "proxy-call-with-super" "proxy-mappings" "proxy-name" "proxy-super" "push-thread-bindings"
- "pvalues" "quot" "rand" "rand-int" "range"
- "ratio?" "rational?" "rationalize" "re-find" "re-groups"
- "re-matcher" "re-matches" "re-pattern" "re-seq" "read"
- "read-line" "read-string" "reify" "reduce" "ref" "ref-history-count"
- "ref-max-history" "ref-min-history" "ref-set" "refer" "refer-clojure"
- "release-pending-sends" "rem" "remove" "remove-method" "remove-ns"
- "repeat" "repeatedly" "replace" "replicate"
- "require" "reset!" "reset-meta!" "resolve" "rest"
- "resultset-seq" "reverse" "reversible?" "rseq" "rsubseq"
- "satisfies?" "second" "select-keys" "send" "send-off" "seq"
- "seq?" "seque" "sequence" "sequential?" "set"
- "set-validator!" "set?" "short" "short-array" "shorts"
- "shutdown-agents" "slurp" "some" "sort" "sort-by"
- "sorted-map" "sorted-map-by" "sorted-set" "sorted-set-by" "sorted?"
- "special-form-anchor" "special-symbol?" "split-at" "split-with" "str"
- "stream?" "string?" "struct" "struct-map" "subs"
- "subseq" "subvec" "supers" "swap!" "symbol"
- "symbol?" "sync" "syntax-symbol-anchor" "take" "take-last"
- "take-nth" "take-while" "test" "the-ns" "time"
- "to-array" "to-array-2d" "trampoline" "transient" "tree-seq"
- "true?" "type" "unchecked-add" "unchecked-dec" "unchecked-divide"
- "unchecked-inc" "unchecked-multiply" "unchecked-negate" "unchecked-remainder" "unchecked-subtract"
- "underive" "unquote" "unquote-splicing" "update-in" "update-proxy"
- "use" "val" "vals" "var-get" "var-set"
- "var?" "vary-meta" "vec" "vector" "vector?"
- "when" "when-first" "when-let" "when-not" "while"
- "with-bindings" "with-bindings*" "with-in-str" "with-loading-context" "with-local-vars"
- "with-meta" "with-open" "with-out-str" "with-precision" "xml-seq"
- ) t)
- "\\>")
- 1 font-lock-variable-name-face)
- ;; (fn name? args ...)
- (,(concat "(\\(?:clojure.core/\\)?\\(fn\\)[ \t]+"
- ;; Possibly type
- "\\(?:#?^\\sw+[ \t]*\\)?"
- ;; Possibly name
- "\\(\\sw+\\)?" )
- (1 font-lock-keyword-face)
- (2 font-lock-function-name-face nil t))
- ;;Other namespaces in clojure.jar
- (,(concat
- "(\\(?:\.*/\\)?"
- (regexp-opt
- '(;; clojure.inspector
- "atom?" "collection-tag" "get-child" "get-child-count" "inspect"
- "inspect-table" "inspect-tree" "is-leaf" "list-model" "list-provider"
- ;; clojure.main
- "load-script" "main" "repl" "repl-caught" "repl-exception"
- "repl-prompt" "repl-read" "skip-if-eol" "skip-whitespace" "with-bindings"
- ;; clojure.set
- "difference" "index" "intersection" "join" "map-invert"
- "project" "rename" "rename-keys" "select" "union"
- ;; clojure.stacktrace
- "e" "print-cause-trace" "print-stack-trace" "print-throwable" "print-trace-element"
- ;; clojure.template
- "do-template" "apply-template"
- ;; clojure.test
- "*initial-report-counters*" "*load-tests*" "*report-counters*" "*stack-trace-depth*" "*test-out*"
- "*testing-contexts*" "*testing-vars*" "are" "assert-any" "assert-expr"
- "assert-predicate" "compose-fixtures" "deftest" "deftest-" "file-position"
- "function?" "get-possibly-unbound-var" "inc-report-counter" "is" "join-fixtures"
- "report" "run-all-tests" "run-tests" "set-test" "successful?"
- "test-all-vars" "test-ns" "test-var" "testing" "testing-contexts-str"
- "testing-vars-str" "try-expr" "use-fixtures" "with-test" "with-test-out"
- ;; clojure.walk
- "keywordize-keys" "macroexpand-all" "postwalk" "postwalk-demo" "postwalk-replace"
- "prewalk" "prewalk-demo" "prewalk-replace" "stringify-keys" "walk"
- ;; clojure.xml
- "*current*" "*sb*" "*stack*" "*state*" "attrs"
- "content" "content-handler" "element" "emit" "emit-element"
- ;; clojure.zip
- "append-child" "branch?" "children" "down" "edit"
- "end?" "insert-child" "insert-left" "insert-right" "left"
- "leftmost" "lefts" "make-node" "next" "node"
- "path" "prev" "remove" "replace" "right"
- "rightmost" "rights" "root" "seq-zip" "up"
- ) t)
- "\\>")
- 1 font-lock-type-face)
- ;; Constant values (keywords), including as metadata e.g. ^:static
- ("\\<^?:\\(\\sw\\|#\\)+\\>" 0 font-lock-constant-face)
- ;; Meta type annotation #^Type or ^Type
- ("#?^\\sw+" 0 font-lock-type-face)
- ("\\<io\\!\\>" 0 font-lock-warning-face)
-
- ;;Java interop highlighting
- ("\\<\\.[a-z][a-zA-Z0-9]*\\>" 0 font-lock-preprocessor-face) ;; .foo .barBaz .qux01
- ("\\<[A-Z][a-zA-Z0-9]*/[a-zA-Z0-9/$_]+\\>" 0 font-lock-preprocessor-face) ;; Foo Bar$Baz Qux_
- ("\\<[a-zA-Z]+\\.[a-zA-Z0-9._]*[A-Z]+[a-zA-Z0-9/.$]*\\>" 0 font-lock-preprocessor-face) ;; Foo/Bar foo.bar.Baz foo.Bar/baz
- ("[a-z]*[A-Z]+[a-z][a-zA-Z0-9$]*\\>" 0 font-lock-preprocessor-face) ;; fooBar
- ("\\<[A-Z][a-zA-Z0-9$]*\\.\\>" 0 font-lock-preprocessor-face))) ;; Foo. BarBaz. Qux$Quux. Corge9.
-
-
- "Default expressions to highlight in Clojure mode.")
-
-;; Docstring positions
-(put 'defn 'clojure-doc-string-elt 2)
-(put 'defn- 'clojure-doc-string-elt 2)
-(put 'defmulti 'clojure-doc-string-elt 2)
-(put 'defmacro 'clojure-doc-string-elt 2)
-(put 'definline 'clojure-doc-string-elt 2)
-(put 'defprotocol 'clojure-doc-string-elt 2)
-
-;; Docstring positions - contrib
-(put 'defalias 'clojure-doc-string-elt 3)
-(put 'defmacro- 'clojure-doc-string-elt 2)
-(put 'defn-memo 'clojure-doc-string-elt 2)
-(put 'defnk 'clojure-doc-string-elt 2)
-(put 'defonce- 'clojure-doc-string-elt 3)
-(put 'defunbound 'clojure-doc-string-elt 2)
-(put 'defunbound- 'clojure-doc-string-elt 2)
-(put 'defvar 'clojure-doc-string-elt 3)
-(put 'defvar- 'clojure-doc-string-elt 3)
-
-
-
-(defun clojure-forward-sexp (n)
- "Treat record literals like #user.Foo[1] and #user.Foo{:size 1}
-as a single sexp so that slime will send them properly. Arguably
-this behavior is unintuitive for the user pressing (eg) C-M-f
-himself, but since these are single objects I think it's right."
- (let ((dir (if (> n 0) 1 -1))
- (forward-sexp-function nil)) ; force the built-in version
- (while (not (zerop n))
- (forward-sexp dir)
- (when (save-excursion ; move back to see if we're in a record literal
- (and
- (condition-case nil
- (progn (backward-sexp) 't)
- ('scan-error nil))
- (looking-at "#\\w")))
- (forward-sexp dir)) ; if so, jump over it
- (setq n (- n dir)))))
-
-(defun clojure-indent-function (indent-point state)
- "This function is the normal value of the variable `lisp-indent-function'.
-It is used when indenting a line within a function call, to see if the
-called function says anything special about how to indent the line.
-
-INDENT-POINT is the position where the user typed TAB, or equivalent.
-Point is located at the point to indent under (for default indentation);
-STATE is the `parse-partial-sexp' state for that position.
-
-If the current line is in a call to a Lisp function
-which has a non-nil property `lisp-indent-function',
-that specifies how to do the indentation. The property value can be
-* `defun', meaning indent `defun'-style;
-* an integer N, meaning indent the first N arguments specially
- like ordinary function arguments and then indent any further
- arguments like a body;
-* a function to call just as this function was called.
- If that function returns nil, that means it doesn't specify
- the indentation.
-
-This function also returns nil meaning don't specify the indentation."
- (let ((normal-indent (current-column)))
- (goto-char (1+ (elt state 1)))
- (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
- (if (and (elt state 2)
- (not (looking-at "\\sw\\|\\s_")))
- ;; car of form doesn't seem to be a symbol
- (progn
- (if (not (> (save-excursion (forward-line 1) (point))
- calculate-lisp-indent-last-sexp))
- (progn (goto-char calculate-lisp-indent-last-sexp)
- (beginning-of-line)
- (parse-partial-sexp (point)
- calculate-lisp-indent-last-sexp 0 t)))
- ;; Indent under the list or under the first sexp on the same
- ;; line as calculate-lisp-indent-last-sexp. Note that first
- ;; thing on that line has to be complete sexp since we are
- ;; inside the innermost containing sexp.
- (backward-prefix-chars)
- (if (and (eq (char-after (point)) ?\[)
- (eq (char-after (elt state 1)) ?\())
- (+ (current-column) 2) ;; this is probably inside a defn
- (current-column)))
- (let ((function (buffer-substring (point)
- (progn (forward-sexp 1) (point))))
- (open-paren (elt state 1))
- method)
- (setq method (get (intern-soft function) 'clojure-indent-function))
-
- (cond ((member (char-after open-paren) '(?\[ ?\{))
- (goto-char open-paren)
- (1+ (current-column)))
- ((or (eq method 'defun)
- (and (null method)
- (> (length function) 3)
- (string-match "\\`\\(?:\\S +/\\)?def\\|with-"
- function)))
- (lisp-indent-defform state indent-point))
-
- ((integerp method)
- (lisp-indent-specform method state
- indent-point normal-indent))
- (method
- (funcall method indent-point state))
- (clojure-mode-use-backtracking-indent
- (clojure-backtracking-indent
- indent-point state normal-indent)))))))
-
-(defun clojure-backtracking-indent (indent-point state normal-indent)
- "Experimental backtracking support. Will upwards in an sexp to
-check for contextual indenting."
- (let (indent (path) (depth 0))
- (goto-char (elt state 1))
- (while (and (not indent)
- (< depth clojure-max-backtracking))
- (let ((containing-sexp (point)))
- (parse-partial-sexp (1+ containing-sexp) indent-point 1 t)
- (when (looking-at "\\sw\\|\\s_")
- (let* ((start (point))
- (fn (buffer-substring start (progn (forward-sexp 1) (point))))
- (meth (get (intern-soft fn) 'clojure-backtracking-indent)))
- (let ((n 0))
- (when (< (point) indent-point)
- (condition-case ()
- (progn
- (forward-sexp 1)
- (while (< (point) indent-point)
- (parse-partial-sexp (point) indent-point 1 t)
- (incf n)
- (forward-sexp 1)))
- (error nil)))
- (push n path))
- (when meth
- (let ((def meth))
- (dolist (p path)
- (if (and (listp def)
- (< p (length def)))
- (setq def (nth p def))
- (if (listp def)
- (setq def (car (last def)))
- (setq def nil))))
- (goto-char (elt state 1))
- (when def
- (setq indent (+ (current-column) def)))))))
- (goto-char containing-sexp)
- (condition-case ()
- (progn
- (backward-up-list 1)
- (incf depth))
- (error (setq depth clojure-max-backtracking)))))
- indent))
-
-;; clojure backtracking indent is experimental and the format for these
-;; entries are subject to change
-(put 'implement 'clojure-backtracking-indent '(4 (2)))
-(put 'letfn 'clojure-backtracking-indent '((2) 2))
-(put 'proxy 'clojure-backtracking-indent '(4 4 (2)))
-(put 'reify 'clojure-backtracking-indent '((2)))
-(put 'deftype 'clojure-backtracking-indent '(4 4 (2)))
-(put 'defrecord 'clojure-backtracking-indent '(4 4 (2)))
-(put 'defprotocol 'clojure-backtracking-indent '(4 (2)))
-(put 'extend-type 'clojure-backtracking-indent '(4 (2)))
-(put 'extend-protocol 'clojure-backtracking-indent '(4 (2)))
-
-(defun put-clojure-indent (sym indent)
- (put sym 'clojure-indent-function indent))
-
-(defmacro define-clojure-indent (&rest kvs)
- `(progn
- ,@(mapcar (lambda (x) `(put-clojure-indent
- (quote ,(first x)) ,(second x))) kvs)))
-
-(defun add-custom-clojure-indents (name value)
- (setq clojure-defun-indents value)
- (mapcar (lambda (x)
- (put-clojure-indent x 'defun))
- value))
-
-(defcustom clojure-defun-indents nil
- "List of symbols to give defun-style indentation to in Clojure
-code, in addition to those that are built-in. You can use this to
-get emacs to indent your own macros the same as it does the
-built-ins like with-open. To set manually from lisp code,
-use (put-clojure-indent 'some-symbol 'defun)."
- :type '(repeat symbol)
- :group 'clojure-mode
- :set 'add-custom-clojure-indents)
-
-(define-clojure-indent
- ;; built-ins
- (ns 1)
- (fn 'defun)
- (def 'defun)
- (defn 'defun)
- (bound-fn 'defun)
- (if 1)
- (if-not 1)
- (case 1)
- (condp 2)
- (when 1)
- (while 1)
- (when-not 1)
- (when-first 1)
- (do 0)
- (future 0)
- (comment 0)
- (doto 1)
- (locking 1)
- (proxy 2)
- (with-open 1)
- (with-precision 1)
- (with-local-vars 1)
-
- (reify 'defun)
- (deftype 2)
- (defrecord 2)
- (defprotocol 1)
- (extend 1)
- (extend-protocol 1)
- (extend-type 1)
-
- (try 0)
- (catch 2)
-
- ;; binding forms
- (let 1)
- (letfn 1)
- (binding 1)
- (loop 1)
- (for 1)
- (doseq 1)
- (dotimes 1)
- (when-let 1)
- (if-let 1)
-
- ;; data structures
- (defstruct 1)
- (struct-map 1)
- (assoc 1)
-
- (defmethod 'defun)
-
- ;; clojure.test
- (testing 1)
- (deftest 'defun)
-
- ;; contrib
- (handler-case 1)
- (handle 1)
- (dotrace 1)
- (deftrace 'defun))
-
-
-
-(defconst clojure-namespace-name-regex
- (rx line-start
- "("
- (zero-or-one (group (regexp "clojure.core/")))
- (zero-or-one (submatch "in-"))
- "ns"
- (zero-or-one "+")
- (one-or-more (any whitespace "\n"))
- (zero-or-more (or (submatch (zero-or-one "#")
- "^{"
- (zero-or-more (not (any "}")))
- "}")
- (zero-or-more "^:"
- (one-or-more (not (any whitespace)))))
- (one-or-more (any whitespace "\n")))
- ;; why is this here? oh (in-ns 'foo) or (ns+ :user)
- (zero-or-one (any ":'"))
- (group (one-or-more (not (any "()\"" whitespace))) word-end)))
-
-;; for testing clojure-namespace-name-regex, you can evaluate this code and make
-;; sure foo (or whatever the namespace name is) shows up in results. some of
-;; these currently fail.
-;; (mapcar (lambda (s) (let ((n (string-match clojure-namespace-name-regex s)))
-;; (if n (match-string 4 s))))
-;; '("(ns foo)"
-;; "(ns
-;; foo)"
-;; "(ns foo.baz)"
-;; "(ns ^:bar foo)"
-;; "(ns ^:bar ^:baz foo)"
-;; "(ns ^{:bar true} foo)"
-;; "(ns #^{:bar true} foo)"
-;; "(ns #^{:fail {}} foo)"
-;; "(ns ^{:fail2 {}} foo.baz)"
-;; "(ns ^{} foo)"
-;; "(ns ^{:skip-wiki true}
-;; aleph.netty
-;; "
-;; "(ns
-;; foo)"
-;; "foo"))
-
-
-
-(defun clojure-insert-ns-form ()
- (interactive)
- (goto-char (point-min))
- (let* ((rel (car (last (split-string buffer-file-name "src/\\|test/"))))
- (relative (car (split-string rel "\\.clj")))
- (segments (split-string relative "/")))
- (insert (format "(ns %s)" (mapconcat #'identity segments ".")))))
-
-
-;;; Slime help
-
-(defvar clojure-project-root-file "project.clj")
-
-(defvar clojure-swank-command "lein jack-in %s")
-
-;;;###autoload
-(defun clojure-jack-in ()
- (interactive)
- (setq slime-net-coding-system 'utf-8-unix)
- (lexical-let ((port (- 65535 (mod (caddr (current-time)) 4096)))
- (dir default-directory))
- (when (get-buffer "*swank*")
- (kill-buffer "*swank*"))
- (let* ((swank-cmd (format clojure-swank-command port))
- (proc (start-process-shell-command "swank" "*swank*" swank-cmd)))
- (set-process-filter (get-buffer-process "*swank*")
- (lambda (process output)
- (with-current-buffer "*swank*"
- (insert output))
- (when (string-match "proceed to jack in" output)
- (with-current-buffer "*swank*"
- (kill-region (save-excursion
- (goto-char (point-max))
- (search-backward "slime-load-hook")
- (forward-line)
- (point))
- (point-max)))
- (eval-buffer "*swank*")
- (slime-connect "localhost" port)
- (with-current-buffer (slime-output-buffer t)
- (setq default-directory dir))
- (set-process-filter process nil))))))
- (message "Starting swank server..."))
-
-(defun clojure-find-ns ()
- (let ((regexp clojure-namespace-name-regex))
- (save-excursion
- (when (or (re-search-backward regexp nil t)
- (re-search-forward regexp nil t))
- (match-string-no-properties 4)))))
-
-(defalias 'clojure-find-package 'clojure-find-ns)
-
-(defun clojure-enable-slime ()
- (slime-mode t)
- (set (make-local-variable 'slime-find-buffer-package-function)
- 'clojure-find-ns))
-
-;;;###autoload
-(defun clojure-enable-slime-on-existing-buffers ()
- (interactive)
- (add-hook 'clojure-mode-hook 'clojure-enable-slime)
- (save-window-excursion
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (when (eq major-mode 'clojure-mode)
- (clojure-enable-slime))))))
-
-;; Test navigation:
-
-(defun clojure-underscores-for-hyphens (namespace)
- (replace-regexp-in-string "-" "_" namespace))
-
-(defun clojure-test-for (namespace)
- (let* ((namespace (clojure-underscores-for-hyphens namespace))
- (segments (split-string namespace "\\."))
- (before (subseq segments 0 clojure-test-ns-segment-position))
- (after (subseq segments clojure-test-ns-segment-position))
- (test-segments (append before (list "test") after)))
- (mapconcat 'identity test-segments "/")))
-
-(defun clojure-jump-to-test ()
- "Jump from implementation file to test."
- (interactive)
- (find-file (format "%s/test/%s.clj"
- (locate-dominating-file buffer-file-name "src/")
- (clojure-test-for (clojure-find-ns)))))
-
-;;;###autoload
-(add-hook 'slime-connected-hook 'clojure-enable-slime-on-existing-buffers)
-
-
-
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
-(add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode))
-(add-to-list 'interpreter-mode-alist '("cake" . clojure-mode))
-
-(provide 'clojure-mode)
-;;; clojure-mode.el ends here
View
437 elisp/clojure-mode/clojure-test-mode.el
@@ -1,437 +0,0 @@
-;;; clojure-test-mode.el --- Minor mode for Clojure tests
-
-;; Copyright (C) 2009-2011 Phil Hagelberg
-
-;; Author: Phil Hagelberg <technomancy@gmail.com>
-;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode
-;; Version: 1.5.6
-;; Keywords: languages, lisp, test
-;; Package-Requires: ((slime "20091016") (clojure-mode "1.7"))
-
-;; This file is not part of GNU Emacs.
-
-;;; Commentary:
-
-;; This file provides support for running Clojure tests (using the
-;; clojure.test framework) via SLIME and seeing feedback in the test
-;; buffer about which tests failed or errored.
-
-;;; Installation:
-
-;; Use package.el. You'll need to add Marmalade to your archives:
-
-;; (require 'package)
-;; (add-to-list 'package-archives
-;; '("marmalade" . "http://marmalade-repo.org/packages/"))
-
-;; If you use a version of Emacs prior to 24 that doesn't include
-;; package.el, you can get it from http://bit.ly/pkg-el23. If you have
-;; an older package.el installed from tromey.com, you should upgrade
-;; in order to support installation from multiple sources.
-
-;; This library does not currently support clojure.contrib.test-is
-;; from Clojure Contrib's 1.0-compatibility branch. If you need it,
-;; please use version 1.2 of clojure-test-mode:
-
-;; http://github.com/technomancy/clojure-mode/tree/test-1.2
-
-;;; Usage:
-
-;; Once you have a SLIME session active, you can run the tests in the
-;; 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.
-
-;;; History:
-
-;; 1.0: 2009-03-12
-;; * Initial Release
-
-;; 1.1: 2009-04-28
-;; * Fix to work with latest version of test-is. (circa Clojure 1.0)
-
-;; 1.2: 2009-05-19
-;; * Add clojure-test-jump-to-(test|implementation).
-
-;; 1.3: 2009-11-10
-;; * Update to use clojure.test instead of clojure.contrib.test-is.
-;; * Fix bug suppressing test report output in repl.
-
-;; 1.4: 2010-05-13
-;; * Fix jump-to-test
-;; * Update to work with Clojure 1.2.
-;; * Added next/prev problem.
-;; * Depend upon slime, not swank-clojure.
-;; * Don't move the mark when activating.
-
-;; 1.5: 2010-09-16
-;; * Allow customization of clojure-test-ns-segment-position.
-;; * Fixes for Clojure 1.2.
-;; * Check for active slime connection.
-;; * Fix test toggling with negative segment-position.
-
-;; 1.5.1: 2010-11-27
-;; * Add marker between each test run.
-
-;; 1.5.2: 2011-03-11
-;; * Make clojure-test-run-tests force reload. Requires swank-clojure 1.3.0.
-
-;; 1.5.3 2011-03-14
-;; * Fix clojure-test-run-test to use fixtures.
-
-;; 1.5.4 2011-03-16
-;; * Fix clojure-test-run-tests to wait until tests are reloaded.
-
-;; 1.5.5 2011-04-08
-;; * Fix coloring/reporting
-;; * Don't trigger slime-connected-hook.
-
-;; 1.5.6 2011-06-15
-;; * Remove heinous clojure.test/report monkeypatch.
-
-;;; TODO:
-
-;; * Prefix arg to jump-to-impl should open in other window
-;; * Put Testing indicator in modeline while tests are running
-;; * Implement next-problem command
-;; * Error messages need line number.
-;; * Currently show-message needs point to be on the line with the
-;; "is" invocation; this could be cleaned up.
-
-;;; Code:
-
-(require 'clojure-mode)
-(require 'cl)
-(require 'slime)
-(require 'which-func)
-
-;; Faces
-
-(defface clojure-test-failure-face
- '((((class color) (background light))
- :background "orange red") ;; TODO: Hard to read strings over this.
- (((class color) (background dark))
- :background "firebrick"))
- "Face for failures in Clojure tests."
- :group 'clojure-test-mode)
-
-(defface clojure-test-error-face
- '((((class color) (background light))
- :background "orange1")
- (((class color) (background dark))
- :background "orange4"))
- "Face for errors in Clojure tests."
- :group 'clojure-test-mode)
-
-(defface clojure-test-success-face
- '((((class color) (background light))
- :foreground "black"
- :background "green")
- (((class color) (background dark))
- :foreground "black"
- :background "green"))
- "Face for success in Clojure tests."
- :group 'clojure-test-mode)
-
-;; Counts
-
-(defvar clojure-test-count 0)
-(defvar clojure-test-failure-count 0)
-(defvar clojure-test-error-count 0)
-
-;; Consts
-
-(defconst clojure-test-ignore-results
- '(:end-test-ns :begin-test-var :end-test-var)
- "Results from test-is that we don't use")
-
-;; Support Functions
-
-(defun clojure-test-eval (string &optional handler)
- (slime-eval-async `(swank:eval-and-grab-output ,string)
- (or handler #'identity)))
-
-(defun clojure-test-eval-sync (string)
- (slime-eval `(swank:eval-and-grab-output ,string)))
-
-(defun clojure-test-load-reporting ()
- "Redefine the test-is report function to store results in metadata."
- (when (eq (compare-strings "clojure" 0 7 (slime-connection-name) 0 7) t)
- (clojure-test-eval-sync
- "(ns clojure.test.mode
- (:use [clojure.test :only [file-position *testing-vars* *test-out*
- join-fixtures *report-counters* do-report
- test-var *initial-report-counters*]]))
-
- (defn report [event]
- (if-let [current-test (last clojure.test/*testing-vars*)]
- (alter-meta! current-test
- assoc :status (conj (:status (meta current-test))
- [(:type event) (:message event)
- (str (:expected event))
- (str (:actual event))
- (if (and (= (:major *clojure-version*) 1)
- (< (:minor *clojure-version*) 2))
- ((file-position 2) 1)
- (if (= (:type event) :error)
- ((file-position 3) 1)
- (:line event)))])))
- (binding [*test-out* *out*]
- ((.getRoot #'clojure.test/report) event)))
-
- (defn clojure-test-mode-test-one-var [test-ns test-name]
- (let [v (ns-resolve test-ns test-name)
- once-fixture-fn (join-fixtures (::once-fixtures (meta (find-ns test-ns))))
- each-fixture-fn (join-fixtures (::each-fixtures (meta (find-ns test-ns))))]
- (once-fixture-fn
- (fn []
- (when (:test (meta v))
- (each-fixture-fn (fn [] (test-var v))))))))
-
- ;; adapted from test-ns
- (defn clojure-test-mode-test-one-in-ns [ns test-name]
- (binding [*report-counters* (ref *initial-report-counters*)]
- (let [ns-obj (the-ns ns)]
- (do-report {:type :begin-test-ns, :ns ns-obj})
- ;; If the namespace has a test-ns-hook function, call that:
- (if-let [v (find-var (symbol (str (ns-name ns-obj)) \"test-ns-hook\"))]
- ((var-get v))
- ;; Otherwise, just test every var in the namespace.
- (clojure-test-mode-test-one-var ns test-name))
- (do-report {:type :end-test-ns, :ns ns-obj}))
- (do-report (assoc @*report-counters* :type :summary)))) ")))
-
-(defun clojure-test-get-results (result)
- (clojure-test-eval
- (concat "(map #(cons (str (:name (meta %)))
- (:status (meta %))) (vals (ns-interns '"
- (slime-current-package) ")))")
- #'clojure-test-extract-results))
-
-(defun clojure-test-echo-results ()
- (message
- (propertize
- (format "Ran %s tests. %s failures, %s errors."
- clojure-test-count clojure-test-failure-count
- clojure-test-error-count)
- 'face
- (cond ((not (= clojure-test-error-count 0)) 'clojure-test-error-face)
- ((not (= clojure-test-failure-count 0)) 'clojure-test-failure-face)
- (t 'clojure-test-success-face)))))
-
-(defun clojure-test-extract-results (results)
- (let ((result-vars (read (cadr results))))
- ;; slime-eval-async hands us a cons with a useless car
- (mapc #'clojure-test-extract-result result-vars)
- (slime-repl-emit (concat "\n" (make-string (1- (window-width)) ?=) "\n"))
- (clojure-test-echo-results)))
-
-(defun clojure-test-extract-result (result)
- "Parse the result from a single test. May contain multiple is blocks."
- (dolist (is-result (rest result))
- (unless (member (aref is-result 0) clojure-test-ignore-results)
- (incf clojure-test-count)
- (destructuring-bind (event msg expected actual line) (coerce is-result 'list)
- (if (equal :fail event)
- (progn (incf clojure-test-failure-count)
- (clojure-test-highlight-problem
- line event (format "Expected %s, got %s" expected actual)))
- (when (equal :error event)
- (incf clojure-test-error-count)
- (clojure-test-highlight-problem line event actual)))))))
-
-
-(defun clojure-test-highlight-problem (line event message)
- (save-excursion
- (goto-line line)
- (let ((beg (point)))
- (end-of-line)
- (let ((overlay (make-overlay beg (point))))
- (overlay-put overlay 'face (if (equal event :fail)
- 'clojure-test-failure-face
- 'clojure-test-error-face))
- (overlay-put overlay 'message message)))))
-
-;; Problem navigation
-(defun clojure-test-find-next-problem (here)
- "Go to the next position with an overlay message.
-Retuns the problem overlay if such a position is found, otherwise nil."
- (let ((current-overlays (overlays-at here))
- (next-overlays (next-overlay-change here)))
- (while (and (not (equal next-overlays (point-max)))
- (or
- (not (overlays-at next-overlays))
- (equal (overlays-at next-overlays)
- current-overlays)))
- (setq next-overlays (next-overlay-change next-overlays)))
- (if (not (equal next-overlays (point-max)))
- (overlay-start (car (overlays-at next-overlays))))))
-
-(defun clojure-test-find-previous-problem (here)
- "Go to the next position with the `clojure-test-problem' text property.
-Retuns the problem overlay if such a position is found, otherwise nil."
- (let ((current-overlays (overlays-at here))
- (previous-overlays (previous-overlay-change here)))
- (while (and (not (equal previous-overlays (point-min)))
- (or
- (not (overlays-at previous-overlays))
- (equal (overlays-at previous-overlays)
- current-overlays)))
- (setq previous-overlays (previous-overlay-change previous-overlays)))
- (if (not (equal previous-overlays (point-min)))
- (overlay-start (car (overlays-at previous-overlays))))))
-
-;; File navigation
-
-(defun clojure-test-implementation-for (namespace)
- (let* ((namespace (clojure-underscores-for-hyphens namespace))
- (segments (split-string namespace "\\."))
- (test-position
- (if (> 0 clojure-test-ns-segment-position)
- (1- (+ (length segments) clojure-test-ns-segment-position))
- clojure-test-ns-segment-position))
- (before (subseq segments 0 test-position))
- (after (subseq segments (1+ test-position)))
- (impl-segments (append before after)))
- (mapconcat 'identity impl-segments "/")))
-
-;; Commands
-
-(defun clojure-test-run-tests ()
- "Run all the tests in the current namespace."
- (interactive)
- (save-some-buffers nil (lambda () (equal major-mode 'clojure-mode)))
- (message "Testing...")
- (clojure-test-clear
- (lambda (&rest args)
- ;; clojure-test-eval will wrap in with-out-str
- (slime-eval-async `(swank:load-file
- ,(slime-to-lisp-filename
- (expand-file-name (buffer-file-name))))
- (lambda (&rest args)
- (slime-eval-async '(swank:interactive-eval
- "(binding [clojure.test/report
- clojure.test.mode/report]
- (clojure.test/run-tests))")
- #'clojure-test-get-results))))))
-
-(defun clojure-test-run-test ()
- "Run the test at point."
- (interactive)
- (save-some-buffers nil (lambda () (equal major-mode 'clojure-mode)))
- (clojure-test-clear
- (lambda (&rest args)
- (let* ((f (which-function))
- (test-name (if (listp f) (first f) f)))
- (slime-eval-async
- `(swank:interactive-eval
- ,(format "(binding [clojure.test/report clojure.test.mode/report]
- (load-file \"%s\")
- (clojure.test.mode/clojure-test-mode-test-one-in-ns '%s '%s)
- (cons (:name (meta (var %s))) (:status (meta (var %s)))))"
- (buffer-file-name)
- (slime-current-package) test-name
- test-name test-name))
- (lambda (result-str)
- (let ((result (read result-str)))
- (if (cdr result)
- (clojure-test-extract-result result)
- (message "Not in a test.")))))))))
-
-(defun clojure-test-show-result ()
- "Show the result of the test under point."
- (interactive)
- (let ((overlay (find-if (lambda (o) (overlay-get o 'message))
- (overlays-at (point)))))
- (if overlay
- (message (replace-regexp-in-string "%" "%%"
- (overlay-get overlay 'message))))))
-
-(defun clojure-test-clear (&optional callback)
- "Remove overlays and clear stored results."
- (interactive)
- (remove-overlays)
- (setq clojure-test-count 0
- clojure-test-failure-count 0
- clojure-test-error-count 0)
- (clojure-test-eval
- "(doseq [t (vals (ns-interns *ns*))]
- (alter-meta! t assoc :status [])
- (alter-meta! t assoc :test nil))"
- callback))
-
-(defun clojure-test-next-problem ()
- "Go to and describe the next test problem in the buffer."
- (interactive)
- (let* ((here (point))
- (problem (clojure-test-find-next-problem here)))
- (if problem
- (goto-char problem)
- (goto-char here)
- (message "No next problem."))))
-
-(defun clojure-test-previous-problem ()
- "Go to and describe the previous compiler problem in the buffer."
- (interactive)
- (let* ((here (point))
- (problem (clojure-test-find-previous-problem here)))
- (if problem
- (goto-char problem)
- (goto-char here)
- (message "No previous problem."))))
-
-(defun clojure-test-jump-to-implementation ()
- "Jump from test file to implementation."
- (interactive)
- (find-file (format "%s/src/%s.clj"
- (locate-dominating-file buffer-file-name "src/")
- (clojure-test-implementation-for (clojure-find-package)))))
-
-(defvar clojure-test-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-,") 'clojure-test-run-tests)
- (define-key map (kbd "C-c ,") 'clojure-test-run-tests)
- (define-key map (kbd "C-c M-,") 'clojure-test-run-test)
- (define-key map (kbd "C-c C-'") 'clojure-test-show-result)
- (define-key map (kbd "C-c '") 'clojure-test-show-result)
- (define-key map (kbd "C-c k") 'clojure-test-clear)
- (define-key map (kbd "C-c t") 'clojure-test-jump-to-implementation)
- (define-key map (kbd "M-p") 'clojure-test-previous-problem)
- (define-key map (kbd "M-n") 'clojure-test-next-problem)
- map)
- "Keymap for Clojure test mode.")
-
-;;;###autoload
-(define-minor-mode clojure-test-mode
- "A minor mode for running Clojure tests."
- nil " Test" clojure-test-mode-map
- (when (slime-connected-p)
- (clojure-test-load-reporting)))
-
-(add-hook 'slime-connected-hook 'clojure-test-load-reporting)
-
-;;;###autoload
-(progn
- (defun clojure-test-maybe-enable ()
- "Enable clojure-test-mode if the current buffer contains a namespace
-with a \"test.\" bit on it."
- (let ((ns (clojure-find-package))) ; defined in clojure-mode.el
- (when (search "test." ns)
- (save-window-excursion
- (clojure-test-mode t)))))
- (add-hook 'clojure-mode-hook 'clojure-test-maybe-enable))
-
-(provide 'clojure-test-mode)
-;;; clojure-test-mode.el ends here
View
34 elisp/clojure-mode/test.clj
@@ -1,34 +0,0 @@
-(ns clojure-mode.test
- (:use [clojure.test]))
-
-(deftest test-str
- (is (= "o hai" (str "o" "hai"))))
-
-(deftest test-errs
- (is (({} :hi)))
- (is (str "This one doesn't actually error."))
- (is (= 0 (/ 9 0))))
-
-(deftest test-bad-math
- (is (= 0 (* 8 2)))
- (is (= 5 (+ 2 2))))
-
-(deftest test-something-that-actually-works
- (is (= 1 1)))
-
-;; For debugging
-;; (map #(cons (str (:name (meta %))) (:status (meta %))) (vals (ns-interns *ns*)))
-;; (insert (pp the-result))
-
-(comment ;; for indentation
- (with-hi heya
- somebuddy)
-
- (deftoggle cap
- gabba)
-
- (couch/with-db hi
- your-db)
-
- (clo/defguppy gurgle
- minnow))
View
31 elisp/color-theme/AUTHORS
@@ -1,31 +0,0 @@
-
- *****************************************
- AUTHORS
- *****************************************
-
-NOTE: NEVER send bug reports, help and feature requests directly to the
- authors !
-
-Original code and ideas by Jonadab the Unsightly One
-
-Current Maintainers:
- * Xavier Maillard (release manager) <zedek@gnu.org>
- * Brian Palmer <bpalmer@gmail.com>
-
-Previous maintainers:
- * (1999 2000) Jonadab the Unsightly One <jonadab@bright.net>
- * (2000, 2001, 2002, 2003) Alex Schroeder <alex@gnu.org>
-
-Contributors
-
- * Deepak Goel <deego@glue.umd.edu>
- * S. Pokrovsky <pok@nbsp.nsk.su> for ideas and discussion
- * Gordon Messmer <gordon@dragonsdawn.net> for ideas and discussion.
- * Sriram Karra <karra@cs.utah.edu> for the color-theme-submit stuff.
- * Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl> for the spec-filter idea.
- * Brian Palmer for color-theme-library ideas and code
-
-Note: all the users that contributed their color themes. See CREDITS.themes
- for a complete listing of them.
-
-Thank you all of you !
View
71 elisp/color-theme/BUGS
@@ -1,71 +0,0 @@
-This is the list of common problems.
-
-Emacs 20.7: Some faces are created using copy-face; these faces are
-not printed correctly using M-x color-theme-print. They will have
-(nil) in their spec. M-x customize-face has the same problem.
-
-Example:
-
-(copy-face 'bold 'new-bold)
-(color-theme-spec 'bold)
- => (bold ((t (:bold t))))
-(color-theme-spec 'new-bold)
- => (new-bold ((t (nil))))
-
-XEmacs 21.1: Some faces are defined using a certain font instead of
-of the correct attribute. They will have (nil) in their spec.
-M-x customize-face has the same problem.
-
-Example:
-
-(color-theme-spec 'bold)
- => (bold ((t (nil))))
-
-XEmacs 21.2 and up, Emacs 21: Not compatible with the custom-theme
-mode. It should be easy to transform the color-theme source into
-custom-theme source, however.
-
-If you are running XEmacs, then only foreground and background color
-of the default face and only the background color of the text-cursor
-face will used. This is due to the fact that these three pieces of
-information are stored as frame parameters in Emacs.
-
-If you are running XEmacs, variables cannot have a frame-local
-binding. Therefore, if color-theme-is-global is set to nil, the
-variable settings in a color theme are ignored.
-
-Using Emacs and a non-nil value for color-theme-is-global will
-install a new color theme for all frames. Using XEmacs and a non-nil
-value for color-theme-is-global will install a new color theme only
-on those frames that are not using a local color theme.
-
-If your system does not define the color names used, you will get the
-error "undefined color". See the output of `list-colors-display' for
-a list of colors defined on your display.
-
-The :box, :height, and other new attributes will be honored in Emacs
-21, but when you print such a color-theme on Emacs 20 or XEmacs 21,
-the information will get lost. So don't do that. Furthermore,
-customizing these faces may end up showing you a lisp expression
-instead of the real widgets on Emacs 20 or XEmacs 21 because these
-attributes are not understood.
-
-:inverse-video handling differs in Emacs and XEmacs. We therefore do
-away with it. When printing a color-theme, the inverse-video
-attribute should be handled correctly without ever appearing in color
-themes. For maintenance, the following might be usefull for
-query-replace-regexp.
-:background "\([^"]*\)"\(.*\):foreground "\([^"]*\)"\(.*\) :inverse-video t
-:background "\3"\2:foreground "\1"\4
-
-In XEmacs 21.1, some of the face tests don't work. Example:
-(custom-face-bold 'bold) returns nil on my system. A bug report was
-submitted.
-
-Emacs 20 users will loose with new color themes, because these will
-set the colors of the default face only, leaving frame background
-untouched. In Emacs 20, the colors of the default face and of the
-frame could be changed independently. In Emacs 21, this is no longer
-true. New color themes will not be made backwards compatible.
-
-This release was superficially tested with Emacs 21.x/22.x and XEmacs 21.4.
View
342 elisp/color-theme/COPYING
@@ -1,342 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
View
121 elisp/color-theme/ChangeLog
@@ -1,121 +0,0 @@
-2006-05-28 Xavier Maillard <zedek@gnu.org>
-
- * Version 6.6.0 is released
-
- * Tagged source with RELEASE_6-6-0 for "Back in the business" release
-
- * HAGKING, BUGS, README: New files.
-
- * color-theme.el (color-theme-libraries): Changed docstring.
- (define-color-theme): Reworked macro to properly define themes.
- (color-theme-initialize): Actually does what expected.
- (color-theme-theme): Removed this useless variable.
-
- Removed commentary section (splitted into specific files)
-
- * Makefile.defs (DEBNAME): Changed default value to reveal all
- needed informations
- (LASTUPLOAD): New version.
- (CVSMODULE, CVSBRANCH, CVSROOT): New variables used to
- prepare a release.
-
- * Makefile (dist, dist-prepare, debian,
- tarball, realease, upload, $TARBALL, $DEBNAME): New targets.
- (distclean): Delete old build traces (files, package, etc...)
-
- * debian/control: Changed Maintainer informations.
-
- * debian/emacsen-startup: Safely load autoloads file or die if tests fail.
-
- * debian/rules: Fixed bad package construction.
-
- * debian/emacsen-install: Handle theme files installation correctfully.
-
-2006-05-27 Xavier Maillard <zedek@gnu.org>
-
- * debian: New directory. Contains all stuff to build a neat and
- cool color-theme-el Debian package.
-
- * AUTHORS: New file.
-
- * color-theme-autoloads.in: Ditto..
-
- * Makefile.defs: Ditto.
-
- * Makefile: Ditto.
-
- * color-theme.el (replace-in-string): New function. Used in define-color-theme
- (color-theme-directory): New variable.
- (color-theme-libraries): Changed default value to color-theme
- official theme directory
- (color-theme-load-all-themes): New variable.
- (color-theme-initialize): Load theme files defined either in
- color-theme-libraries or color-theme-directory.
-
-2006-05-22 Xavier Maillard <zedek@gnu.org>
-
- * color-theme-library.el: make bytecompiler happy.
-
- * color-theme.el (color-theme-initialize, color-theme-select)
- (color-theme-describe, color-theme-install-at-mouse)
- (color-theme-install-at-point)
- (color-theme-install-at-point-for-current-frame)
- (color-theme-print, color-theme-analyze-defun)
- (color-theme-make-snapshot, color-theme-compare)