Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@
[submodule "vendor/elixir-mode"]
path = vendor/elixir-mode
url = git@github.com:elixir-lang/emacs-elixir.git
[submodule "vendor/flycheck"]
path = vendor/flycheck
url = https://github.com/flycheck/flycheck.git
6 changes: 5 additions & 1 deletion bundles/erlang/bundle.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
(setq exec-path (cons erlang-bin-dir exec-path))

(defun cabbage-erlang-mode-hook ()
(require 'erlang-flymake)
(local-set-key (kbd "C-c C-l") 'erlang-compile))

;; customizations
(eval-after-load 'erlang
(add-hook 'erlang-mode-hook 'cabbage-erlang-mode-hook))

(require 'erlang-start)))

(when (cabbage-flycheck-active-p)
(cabbage-flycheck-init)
(add-hook 'erlang-mode-hook 'flycheck-mode)
(add-hook 'erlang-mode-hook 'cabbage-flycheck-keybindings))
6 changes: 6 additions & 0 deletions bundles/flycheck/bundle.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(cabbage-vendor 'flycheck)

(defun cabbage-flycheck-keybindings ()
(local-set-key (kbd "C-c f n") 'flycheck-next-error)
(local-set-key (kbd "C-c f p") 'flycheck-previous-error)
(local-set-key (kbd "C-c f l") 'flycheck-list-errors))
74 changes: 4 additions & 70 deletions bundles/javascript/bundle.el
Original file line number Diff line number Diff line change
@@ -1,47 +1,18 @@
;; Configuration

(defcustom cabbage-javascript-jslint-enabled nil
"Enable flymake with jslint"
:type 'boolean
:group 'cabbage)

(defcustom cabbage-javascript-jslint-executable-path
(or (executable-find "jsl")
(concat cabbage-repository "bin/jsl-0.3.0-mac/jsl"))
"path to the js-lint executable"
:type 'string
:group 'cabbage)

;;;; -------------------------------------
;;;; Bundle
(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js-mode))


;; Defuns

(defun cabbage-javascript-jslint-compile ()
(interactive)
(compile (format "%s -process %s" cabbage-javascript-jslint-executable-path (buffer-file-name))))

;; Setup

(defun cabbage-javascript-keybindings ()
(local-set-key (kbd "C-§") 'flymake-goto-next-error))
(add-hook 'js-mode-hook 'cabbage-javascript-keybindings)


(defun cabbage-javascript-configure-indenting ()
(setq js-indent-level 2
javascript-indent-level 2
js-auto-indent-flag nil))
(add-hook 'js-mode-hook 'cabbage-javascript-configure-indenting)


(defun cabbage-javascript-set-pairs ()
(cabbage--set-pairs '("(" "{" "[" "\"" "'")))
(add-hook 'js-mode-hook 'cabbage-javascript-set-pairs)


(defun cabbage-javascript-fix-fontlock ()
(font-lock-add-keywords
'js-mode
Expand All @@ -58,44 +29,7 @@
'(progn
(cabbage-javascript-fix-fontlock)))


(defun cabbage-javascript--configure-jslint ()
(when (executable-find cabbage-javascript-jslint-executable-path)
(require 'flymake)
(defun cabbage-javascript-flymake-jslint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list cabbage-javascript-jslint-executable-path
(list "-process" local-file))))

(setq flymake-allowed-file-name-masks
(cons '(".+\\.js$"
cabbage-javascript-flymake-jslint-init
flymake-simple-cleanup
flymake-get-real-file-name)
flymake-allowed-file-name-masks))

(setq flymake-err-line-patterns
(cons '("^Lint at line \\([[:digit:]]+\\) character \\([[:digit:]]+\\): \\(.+\\)$"
nil 1 2 3)
flymake-err-line-patterns))

(defun cabbage-javascript-enable-flymake-mode ()
(if (executable-find cabbage-javascript-jslint-executable-path)
(flymake-mode t)))
(add-hook 'js-mode-hook 'cabbage-javascript-enable-flymake-mode)

(add-hook 'js-mode-hook 'cabbage-flymake-init)))

(eval-after-load 'js
'(progn
(when cabbage-javascript-jslint-enabled
(cabbage-javascript--configure-jslint))))


(eval-after-load 'mode-compile
'(progn
(add-to-list 'mode-compile-modes-alist '(js-mode . (senny-jslint-compile kill-compilation)))))
(when (cabbage-flycheck-active-p)
(cabbage-flycheck-init)
(add-hook 'js-mode-hook 'cabbage-flycheck-keybindings)
(add-hook 'js-mode-hook 'flycheck-mode))
6 changes: 0 additions & 6 deletions bundles/javascript/readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# javascript bundle

The javascript bundle configures emacs for coding javascript.


## Features

* [flymake](http://flymake.sourceforge.net/) validation for javascript
files using the cabbage built-in javascript linter.
27 changes: 5 additions & 22 deletions bundles/latex/bundle.el
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
;; configurations

(defcustom cabbage-latex-enable-flymake
t
"Enable flymake. Uses texify by default."
:type 'boolean
:group 'cabbage)

(defcustom cabbage-latex-flymake-use-chktex
t
"If t, flymake uses chktext instead of texify in latex mode."
:type 'boolean
:group 'cabbage)


;;;; -------------------------------------
;;;; Bundle

Expand All @@ -27,13 +12,6 @@
(define-key latex-mode-map (kbd "C-c 2") 'cabbage-latex-open-pdf)
(define-key latex-mode-map (kbd "C-c 3") 'cabbage-latex-cleanup)))


;; flymake

(when (and cabbage-latex-enable-flymake (cabbage-flymake-active-p))
(cabbage-load-bundle-dependencies "latex" '("flymake.el")))


;; funs

(defun cabbage-latex-pdflatex-build (&optional nonstop)
Expand Down Expand Up @@ -69,3 +47,8 @@
(mapcar (lambda (x) (shell-command (concat "rm " basename x)))
(list ".aux" ".lof" ".log" ".lot" ".pdf" ".toc")))
(message "Deleted temp files and pdf"))

(when (cabbage-flycheck-active-p)
(cabbage-flycheck-init)
(add-hook 'latex-mode-hook 'flycheck-mode)
(add-hook 'latex-mode-hook 'cabbage-flycheck-keybindings))
41 changes: 0 additions & 41 deletions bundles/latex/flymake.el

This file was deleted.

14 changes: 0 additions & 14 deletions bundles/latex/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@

Configures emacs for coding LaTeX.


## Features

* Configures [flymake](http://flymake.sourceforge.net/) validation
using [chktex](http://www.nongnu.org/chktex/).

* Adds bindings for converting a LaTeX file to a PDF and display it.


## Configuration options

* `cabbage-latex-enable-flymake`: If `t` (default), emacs will try to
set up flymake validation.

* `cabbage-latex-flymake-use-chktex`: If `t` (default), cabbage
reconfigures the flymake validation to use "chktex". The chktex
executable has to be in the `PATH`. If it is `nil`, `texify` is
used.


# Functions / bindings

* `cabbage-latex-pdflatex-build` (`C-c 1`): convert the current LaTeX
Expand Down
8 changes: 5 additions & 3 deletions bundles/php/bundle.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
(when (and buffer-file-name (string-match "Test.php$" buffer-file-name))
(setq cabbage-testing-execute-function 'cabbage-phpunit-run-single-file)))

(when (cabbage-flymake-active-p)
(cabbage-load-bundle-dependencies "php" '("flymake")))

(add-hook 'php-mode-hook 'cabbage-php-mode-hook)

(when (cabbage-flycheck-active-p)
(cabbage-flycheck-init)
(add-hook 'php-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'cabbage-flycheck-keybindings))
34 changes: 0 additions & 34 deletions bundles/php/flymake.el

This file was deleted.

14 changes: 0 additions & 14 deletions bundles/plone/bundle.el
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,6 @@ then prompts for a file. Expects to be within a package
(add-to-list 'auto-mode-alist '("\\.[zc]?pt$" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.zcml$" . nxml-mode))


(defun cabbage-plone--xml-flymake ()
(when (and (cabbage-bundle-active-p 'xml)
cabbage-xml-flymake-enabled
(executable-find "xml"))

(add-to-list 'flymake-allowed-file-name-masks
'("\\.[zc]?pt$" flymake-xml-init))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.zcml$" flymake-xml-init))))

(add-hook 'nxml-mode-hook 'cabbage-plone--xml-flymake)


(defun cabbage-plone--python-bindings ()
(define-key python-mode-map (kbd "C-M-<return>") 'cabbage-plone-goto-defition)
(define-key python-mode-map (kbd "C-M-S-<return>") 'cabbage-plone-lookup-import))
Expand Down
1 change: 0 additions & 1 deletion bundles/plone/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ especially when using
## Features

* Configures modes for .zcml, .?pt and .po[t] files.
* Configures flymake (pyflakes, xml-startlet)
* Provides shortcuts for finding files when using buildout.
* Configures pdb-mode, so that zope can be run within emacs.
* Reload code using
Expand Down
Loading