Skip to content

Commit 0334ade

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 75f2d1f + efffa56 commit 0334ade

File tree

5 files changed

+124
-39
lines changed

5 files changed

+124
-39
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README
2+
flymake-csslint-*.tar
3+
flymake-csslint-pkg.el
4+
flymake-csslint.info

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.PHONY: all clean install
2+
3+
ARCHIVE_NAME:=flymake-csslint
4+
VERSION:=$(shell emacs --batch --eval "(with-temp-buffer \
5+
(require 'package)\
6+
(insert-file \"$(ARCHIVE_NAME).el\")\
7+
(princ (aref (package-buffer-info) 3)))")
8+
PACKAGE_NAME:=$(ARCHIVE_NAME)-$(VERSION)
9+
10+
all: $(PACKAGE_NAME).tar
11+
12+
$(ARCHIVE_NAME).info: README.md
13+
pandoc -t texinfo $^ | makeinfo -o $@
14+
15+
README: README.md
16+
pandoc --atx-headers -t plain -o $@ $^
17+
18+
# requires package-build.el from https://github.com/milkypostman/melpa
19+
# to be available in your emacs load-path
20+
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
21+
emacs --batch --user `whoami` --eval "(progn \
22+
(require 'package-build) \
23+
(pb/write-pkg-file \
24+
\"$(ARCHIVE_NAME)-pkg.el\" \
25+
(with-temp-buffer \
26+
(insert-file \"$(ARCHIVE_NAME).el\") \
27+
(package-buffer-info))))"
28+
29+
# create a tar ball in package.el format for uploading to http://marmalade-repo.org
30+
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir
31+
tar -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^
32+
33+
install: $(PACKAGE_NAME).tar
34+
emacs --batch --user `whoami` --eval "(progn \
35+
(package-initialize)\
36+
(package-install-file \"`pwd`/$(PACKAGE_NAME).tar\"))"
37+
38+
clean:
39+
$(RM) $(ARCHIVE_NAME)-*.tar $(ARCHIVE_NAME)-pkg.el README $(ARCHIVE_NAME).info

README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
1-
# flymake-csslint.el
1+
# flymake-csslint
22

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

7-
$ csslint
9+
## Installation and usage
810

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

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

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

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

21-
Add to your emacs config:
24+
## Requirements
2225

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

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

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

3137
## Debugging
3238

3339
If CSSLint isn't working for any reason, execute
3440

35-
M-x set-variable flymake-log-level <RET> 3
41+
M-x set-variable <RET> flymake-log-level <RET> 3 <RET>
3642

3743
and you will see what is going wrong listed in the *Messages*
3844
buffer.
45+
46+
## Development of flymake-csslint
47+
48+
flymake-csslint.el is developed at
49+
[GitHub](https://github.com/arnested/flymake-csslint). Feature
50+
requests, ideas, bug reports, and pull request are more that welcome!

dir

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This is the file .../info/dir, which contains the
2+
topmost node of the Info hierarchy, called (dir)Top.
3+
The first time you invoke Info you start off looking at this node.
4+

5+
File: dir, Node: Top This is the top of the INFO tree
6+
7+
This (the Directory node) gives a menu of major topics.
8+
Typing "q" exits, "?" lists all Info commands, "d" returns here,
9+
"h" gives a primer for first-timers,
10+
"mEmacs<Return>" visits the Emacs manual, etc.
11+
12+
In Emacs, you can click mouse button 2 on a menu item or cross reference
13+
to select it.
14+
15+
* Menu:
16+
17+
Programming
18+
* Flymake CSSLint: (flymake-csslint). Making flymake work with CSSLint.

flymake-csslint.el

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
;;; flymake-csslint.el --- making flymake work with CSSLint
22

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

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

@@ -70,28 +70,40 @@
7070

7171
(require 'flymake)
7272

73+
(defgroup flymake-csslint nil
74+
"Flymake CCSlint configuration."
75+
:group 'flymake)
76+
77+
(defcustom flymake-csslint-program (executable-find "csslint")
78+
"Name of the CSSLint program."
79+
:type '(choice (file :tag "Location of csslint")
80+
(const :tag "csslint is not installed"))
81+
:group 'flymake-csslint)
82+
83+
;;;###autoload
7384
(defun flymake-csslint-init ()
7485
(let* ((temp-file (flymake-init-create-temp-buffer-copy
75-
'flymake-create-temp-inplace))
86+
(if (fboundp 'flymake-create-temp-copy)
87+
'flymake-create-temp-copy
88+
'flymake-create-temp-inplace)))
7689
(local-file (file-relative-name
7790
temp-file
7891
(file-name-directory buffer-file-name))))
79-
(list "csslint" (list "--format=compact" local-file))))
80-
81-
(setq flymake-allowed-file-name-masks
82-
(cons '(".+\\.css$"
83-
flymake-csslint-init
84-
flymake-simple-cleanup
85-
flymake-get-real-file-name)
86-
flymake-allowed-file-name-masks))
87-
88-
(setq flymake-err-line-patterns
89-
(cons '("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$"
90-
1 2 3 4)
91-
flymake-err-line-patterns))
92-
93-
; load flymake automatically in CSS mode
94-
(add-hook 'css-mode-hook 'flymake-mode)
92+
(list flymake-csslint-program (list "--format=compact" local-file))))
93+
94+
;;;###autoload
95+
(eval-after-load 'flymake
96+
'(progn
97+
(add-to-list 'flymake-allowed-file-name-masks
98+
'(".+\\.css$"
99+
flymake-csslint-init
100+
flymake-simple-cleanup
101+
flymake-get-real-file-name))
102+
(add-to-list 'flymake-err-line-patterns
103+
'("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$"
104+
1 2 3 4))
105+
;; load flymake automatically in CSS mode
106+
(add-hook 'css-mode-hook (lambda() (flymake-mode 1)) t)))
95107

96108

97109

0 commit comments

Comments
 (0)