On Fri, 08 Oct 2004 09:14:56 +0900, Brian Schröäer wrote:
> 
> If a program could guide where I look that would be nice. Therefore also
> an external program or an xemacs plugin would be nice to me.
> 
> And just to clarify: This is in no way urgent or very important to me, I
> just liked the idea ;)
> 

Here is a simple emacs function that does the job:

(defun ruby-check-ends ()
  (interactive)
  (let (loose-end)
    (save-excursion
      (goto-char (point-min))
      (while (and (not loose-end)
		  (re-search-forward "^[ \t]*\\(end\\)[ \t\n]" nil t))
	(goto-char (match-beginning 1))
	(if (not (eq (current-column) (ruby-calculate-indent)))
	    (setq loose-end (point)))
	(forward-char)))
    (cond (loose-end
	   (goto-char loose-end)
	   (message "indentation of end is not correct")))))

It may not work correctly if you use a different style then the
one emacs is set up to, but you will probably use this for your code
anyway.

Regards,
Kristof