Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use variables instead of hard-coding (thanks Stan)

  • Loading branch information...
commit 330b0a75bc1be3c929df13fd18a2791f89e2eae9 1 parent 2b2014c
niels giesen authored
Showing with 20 additions and 21 deletions.
  1. +20 −21 css-check.el
View
41 css-check.el
@@ -187,26 +187,25 @@ When non-nil return value is the path to local csstidy.\n
(current-buffer)))
(save-buffer))
(let* ((file (buffer-file-name))
- (cmd (format "csstidy %s /dev/null" file))
- (res (shell-command-to-string cmd)))
- (switch-to-buffer "*css-check*")
- (let (buffer-read-only)
- (erase-buffer)
- (insert res)
- (goto-char (point-min))
- (while (re-search-forward "^[[:digit:]]+" nil t)
- (put-text-property (match-beginning 0)
- (match-end 0)
- 'face 'css-check-unapplied-face)
- (put-text-property (match-beginning 0)
- (match-end 0)
- 'keymap 'highlight
- ))
- (goto-char (point-min))
- (forward-line 5)
- (setq css-file file)
- (use-local-map css-check-map))
- (setq buffer-read-only t)))
-
+ (cmd (format "%s %s %S" css-check-csstidy-path file null-device)))
+ (with-current-buffer (get-buffer-create "*css-check*")
+ (let (buffer-read-only)
+ (erase-buffer)
+ (save-excursion
+ (call-process-shell-command cmd nil t t))
+ (while (re-search-forward "^[[:digit:]]+" nil t)
+ (put-text-property (match-beginning 0)
+ (match-end 0)
+ 'face 'css-check-unapplied-face)
+ (put-text-property (match-beginning 0)
+ (match-end 0)
+ 'keymap 'highlight
+ ))
+ (goto-char (point-min))
+ (forward-line 5)
+ (setq css-file file)
+ (use-local-map css-check-map))
+ (setq buffer-read-only t))))
+
(provide 'css-check)
;; css-check.el ends here
Please sign in to comment.
Something went wrong with that request. Please try again.