chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] using flymake with chicken


From: Daniel Leslie
Subject: Re: [Chicken-users] using flymake with chicken
Date: Fri, 23 Nov 2012 14:09:34 -0800

Oh excellent!

You may be able to remove the need for the shell script by running something like:

(shell-command-to-string (format "csi -SAv \"%s\" || true" option-or-filename))

Thanks,
-Dan


On Fri, Nov 23, 2012 at 11:05 AM, Felix <address@hidden> wrote:
Hello!


Attached is a first go at flymake[1] support for Scheme code.
It is derived from flymake-lua.el and very simple.

Put chicken-flymake in your PATH, make it executable, load flymake-chicken.el
into your emacs, open some .scm file and do

  M-x flymake-chicken-mode

Now, lines containing scrutinizer warnings (and other errors that show
a line number) are highlighted.

I have not used this seriously yet, but it's sort of weirdly cool ...

I have added the code to the git repository (see the "scripts" and "misc"
subdirectories).

Suggestions are welcome.


cheers,
felix

[1] http://www.emacswiki.org/emacs/FlyMake

;;;; flymake for CHICKEN

;; Taken from:
;; https://github.com/sroccaserra/emacs/blob/master/flymake-lua.el

;;
;; Flymake for Lua
;;
;; Usage:
;; (require 'flymake-lua)
;; (add-hook 'lua-mode-hook 'flymake-lua-load)
;;
;; Note: litterally stolen from Steve Purcell's Flymake Ruby.
;; See http://github.com/purcell/emacs.d/blob/master/site-lisp/flymake-ruby/flymake-ruby.el
;;

(require 'flymake)

(defgroup flymake-chicken nil
  "Flymake Chicken Customizations")

(defcustom flymake-chicken-program "chicken-flymake"
  "How to invoke csc."
  :type 'file
  :group 'flymake-chicken)

(defun flymake-create-temp-in-system-tempdir (filename prefix)
  (make-temp-file (or prefix "flymake-chicken")))

(defun flymake-chicken-init ()
  (list flymake-chicken-program
        (list (flymake-init-create-temp-buffer-copy
               'flymake-create-temp-in-system-tempdir))))

(defvar flymake-chicken-allowed-file-name-masks
  '(("\\.scm\\'" flymake-chicken-init)))

(defvar flymake-chicken-err-line-patterns
  '((" *(\\(.+\\):\\([0-9]+\\)) *"
     1 2)
    ("\\(Error\\|Warning\\|Note\\): *(line \\([0-9.]*\\))"
     nil 2)))

;(defvar flymake-lua-err-line-patterns
;  '(("^.*luac[0-9.]*\\(.exe\\)?: *\\(.*\\):\\([0-9]+\\): \\(.*\\)$"
;        2 3 nil 4)))

;;;###autoload
(defun flymake-chicken-mode ()
  (interactive)
  (when (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
    (set (make-local-variable 'flymake-allowed-file-name-masks) flymake-chicken-allowed-file-name-masks)
    (set (make-local-variable 'flymake-err-line-patterns) flymake-chicken-err-line-patterns)
    (flymake-mode t)))

(provide 'flymake-chicken)

#!/bin/sh
#
# usage: chicken-flymake OPTION-OR-FILENAME ...

csc -SAv "$@" || true

_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]