[BUG] ruby.el

I noticed that the symbol :confused: 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

···

--
Brian Schröder
http://www.brian-schroeder.de/

Hi,

At Sun, 14 Nov 2004 01:27:44 +0900,
Brian Schröder wrote in [ruby-talk:120177]:

I noticed that the symbol :confused: 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 ?:slight_smile: (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 "\\.\\.\\.?")

--
Nobu Nakada

Yes it helped, thanks a lot.

Regards,

Brian

···

On Sun, 14 Nov 2004 15:25:22 +0900 nobu.nokada@softhome.net wrote:

Hi,

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

Does this patch help?

[snip]

--
Brian Schröder
http://www.brian-schroeder.de/

Hi,

···

In message "Re: [BUG] ruby.el" on Sun, 14 Nov 2004 15:25:22 +0900, nobu.nokada@softhome.net writes:

At Sun, 14 Nov 2004 01:27:44 +0900,
Brian Schröder wrote in [ruby-talk:120177]:

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

Does this patch help?

Can you commit?

              matz.