[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[BUG] ruby.el

Brian Schröder

11/13/2004 4:28:00 PM

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

--
Brian Schröder
http://www.brian-sch...



2 Answers

nobu.nokada

11/14/2004 6:25:00 AM

0

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 "\\.\\.\\.?")


--
Nobu Nakada



Brian Schröder

11/14/2004 6:47:00 PM

0

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 :/ kills emacs ruby parsing.
>
> Does this patch help?
>
> [snip]

Yes it helped, thanks a lot.

Regards,

Brian


--
Brian Schröder
http://www.brian-sch...