Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Apr 25, 2012
2 parents 75f2d1f + efffa56 commit 0334ade
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 39 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
README
flymake-csslint-*.tar
flymake-csslint-pkg.el
flymake-csslint.info
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.PHONY: all clean install

ARCHIVE_NAME:=flymake-csslint
VERSION:=$(shell emacs --batch --eval "(with-temp-buffer \
(require 'package)\
(insert-file \"$(ARCHIVE_NAME).el\")\
(princ (aref (package-buffer-info) 3)))")
PACKAGE_NAME:=$(ARCHIVE_NAME)-$(VERSION)

all: $(PACKAGE_NAME).tar

$(ARCHIVE_NAME).info: README.md
pandoc -t texinfo $^ | makeinfo -o $@

README: README.md
pandoc --atx-headers -t plain -o $@ $^

# requires package-build.el from https://github.com/milkypostman/melpa
# to be available in your emacs load-path
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
emacs --batch --user `whoami` --eval "(progn \
(require 'package-build) \
(pb/write-pkg-file \
\"$(ARCHIVE_NAME)-pkg.el\" \
(with-temp-buffer \
(insert-file \"$(ARCHIVE_NAME).el\") \
(package-buffer-info))))"

# create a tar ball in package.el format for uploading to http://marmalade-repo.org
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir
tar -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^

install: $(PACKAGE_NAME).tar
emacs --batch --user `whoami` --eval "(progn \
(package-initialize)\
(package-install-file \"`pwd`/$(PACKAGE_NAME).tar\"))"

clean:
$(RM) $(ARCHIVE_NAME)-*.tar $(ARCHIVE_NAME)-pkg.el README $(ARCHIVE_NAME).info
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
# flymake-csslint.el
# flymake-csslint

To use [CSSLint](https://github.com/stubbornella/csslint) with emacs,
you will need CSSLint installed and available on your path. You should
be able to do
flymake-csslint.el is an [Emacs](http://www.gnu.org/software/emacs)
integration of [CSSLint](https://github.com/stubbornella/csslint). The
implementation is very much based on
[flymake-jshint.el](http://marmalade-repo.org/packages/flymake-jshint)
by [Wilfred Hughes](http://wilfred.me.uk).

$ csslint
## Installation and usage

without problem. To do this, you can install node.js, npm and
csslint by doing the following:
The easiest way to install flymake-csslint is probably to install it
via the ELPA archive at
[Marmalade](http://marmalade-repo.org/packages/flymake-csslint).

$ apt-get install nodejs # or your distro / OS equivalent
$ curl http://npmjs.org/install.sh | sh
$ npm install -g csslint
ELPA (package.el) is part of Emacs 24. For Emacs 23 see
[Marmalade](http://marmalade-repo.org) for installation instructions.

flymake-csslint.el is very much based on flymake-jshint.el by
[Wilfred Hughes](<me@wilfred.me.uk>).
If you don't install via ELPA make sure that flymake-csslint.el is in
your load-path and require the library

## Usage
(add-to-list 'load-path "~/.emacs.d/path/to/flymake-csslint")
(require 'flymake-csslint)

Add to your emacs config:
## Requirements

(require 'flymake-csslint)
(add-hook 'css-mode-hook 'flymake-mode)
To use [CSSLint](https://github.com/stubbornella/csslint) with emacs,
you will need to have a command line version of CSSLint installed, see
installation instructions at
https://github.com/stubbornella/csslint/wiki/Command-line-interface.

making sure that flymake-csslint.el is on your load-path. If not,
also add to your config:
If the `csslint` executable is not available on your PATH your need to
configure the flymake-csslint-program variable and let it point to the
executable.

(add-to-list 'load-path "~/.emacs.d/path/to/flymake-csslint.el")
M-x customize-variable <RET> flymake-csslint-program <RET>

## Debugging

If CSSLint isn't working for any reason, execute

M-x set-variable flymake-log-level <RET> 3
M-x set-variable <RET> flymake-log-level <RET> 3 <RET>

and you will see what is going wrong listed in the *Messages*
buffer.

## Development of flymake-csslint

flymake-csslint.el is developed at
[GitHub](https://github.com/arnested/flymake-csslint). Feature
requests, ideas, bug reports, and pull request are more that welcome!
18 changes: 18 additions & 0 deletions dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.

File: dir, Node: Top This is the top of the INFO tree

This (the Directory node) gives a menu of major topics.
Typing "q" exits, "?" lists all Info commands, "d" returns here,
"h" gives a primer for first-timers,
"mEmacs<Return>" visits the Emacs manual, etc.

In Emacs, you can click mouse button 2 on a menu item or cross reference
to select it.

* Menu:

Programming
* Flymake CSSLint: (flymake-csslint). Making flymake work with CSSLint.
50 changes: 31 additions & 19 deletions flymake-csslint.el
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
;;; flymake-csslint.el --- making flymake work with CSSLint

;; Copyright (C) 2011, 2012 Arne Jørgensen <arne@arnested.dk>
;; Copyright (C) 2011 Wilfred Hughes <me@wilfred.me.uk>
;; Copyright (C) 2011 Arne Jørgensen <arne@arnested.dk>

;; Author: Arne Jørgensen <arne@arnested.dk>
;; URL: https://github.com/arnested/flymake-csslint
;; Created: 1 December 2011
;; Version: 1.0.1
;; Version: 1.1.0
;; Package-Requires: ((flymake "0.3"))
;; Keywords: flymake, csslint, css

Expand Down Expand Up @@ -70,28 +70,40 @@

(require 'flymake)

(defgroup flymake-csslint nil
"Flymake CCSlint configuration."
:group 'flymake)

(defcustom flymake-csslint-program (executable-find "csslint")
"Name of the CSSLint program."
:type '(choice (file :tag "Location of csslint")
(const :tag "csslint is not installed"))
:group 'flymake-csslint)

;;;###autoload
(defun flymake-csslint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(if (fboundp 'flymake-create-temp-copy)
'flymake-create-temp-copy
'flymake-create-temp-inplace)))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "csslint" (list "--format=compact" local-file))))

(setq flymake-allowed-file-name-masks
(cons '(".+\\.css$"
flymake-csslint-init
flymake-simple-cleanup
flymake-get-real-file-name)
flymake-allowed-file-name-masks))

(setq flymake-err-line-patterns
(cons '("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$"
1 2 3 4)
flymake-err-line-patterns))

; load flymake automatically in CSS mode
(add-hook 'css-mode-hook 'flymake-mode)
(list flymake-csslint-program (list "--format=compact" local-file))))

;;;###autoload
(eval-after-load 'flymake
'(progn
(add-to-list 'flymake-allowed-file-name-masks
'(".+\\.css$"
flymake-csslint-init
flymake-simple-cleanup
flymake-get-real-file-name))
(add-to-list 'flymake-err-line-patterns
'("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$"
1 2 3 4))
;; load flymake automatically in CSS mode
(add-hook 'css-mode-hook (lambda() (flymake-mode 1)) t)))



Expand Down

0 comments on commit 0334ade

Please sign in to comment.