[BUG] ruby.el

B

Brian Schröder

I noticed that the symbol :/ kills emacs ruby parsing.

After the line:

result << Term.new(op1, op2, :/) if op2.value != 1.0

indentation is no longer working, even though this is valid ruby code.

Using :'/' is a workaround for this.

Regards,

Brian
 
N

nobu.nokada

Hi,

At Sun, 14 Nov 2004 01:27:44 +0900,
Brian Schröder wrote in [ruby-talk:120177]:
I noticed that the symbol :/ kills emacs ruby parsing.

Does this patch help?


Index: misc/ruby-mode.el
===================================================================
RCS file: /cvs/ruby/src/ruby/misc/ruby-mode.el,v
retrieving revision 1.84
diff -U2 -p -d -r1.84 ruby-mode.el
--- misc/ruby-mode.el 29 Oct 2004 08:08:16 -0000 1.84
+++ misc/ruby-mode.el 14 Nov 2004 06:23:30 -0000
@@ -294,8 +294,9 @@ The variable ruby-indent-level controls

(defun ruby-special-char-p (&optional pnt)
- (let ((c (char-before (or pnt (point)))))
+ (setq pnt (or pnt (point)))
+ (let ((c (char-before pnt)) (b (and (< (point-min) pnt) (char-before (1- pnt)))))
(cond ((or (eq c ??) (eq c ?$)))
- ((eq c ?\\)
- (eq (char-before (1- (or pnt (point)))) ??)))))
+ ((and (eq c ?:) (or (not b) (eq (char-syntax b) ? ))))
+ ((eq c ?\\) (eq b ??)))))

(defun ruby-expr-beg (&optional option)
@@ -504,5 +505,9 @@ The variable ruby-indent-level controls
(setq depth (1+ depth)))
(goto-char pnt))
- ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*\\)?")
+ ((looking-at ":\\(['\"]\\)\\(\\\\.\\|[^\\\\]\\)*\\1")
+ (goto-char (match-end 0)))
+ ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\)")
+ (goto-char (match-end 0)))
+ ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?")
(goto-char (match-end 0)))
((or (looking-at "\\.\\.\\.?")
 
B

Brian Schröder

On Sun, 14 Nov 2004 15:25:22 +0900
Hi,

At Sun, 14 Nov 2004 01:27:44 +0900,
Brian Schröder wrote in [ruby-talk:120177]:
I noticed that the symbol :/ kills emacs ruby parsing.

Does this patch help?

[snip]

Yes it helped, thanks a lot.

Regards,

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top