I've just committed the following patch to ruby-modes to sync with
upstream's ruby 1.8.7.
Index: ChangeLog
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ChangeLog,v
retrieving revision 1.12
diff -u -B -r1.12 ChangeLog
--- ChangeLog 20 Jul 2009 19:02:24 -0000 1.12
+++ ChangeLog 24 Jul 2009 09:34:08 -0000
@@ -1,3 +1,7 @@
+2009-07-24 Hans de Graaff <graaff(a)xemacs.org>
+
+ * Sync with upstream 1.8.7
+
2009-07-20 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.03 released.
Index: Makefile
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/Makefile,v
retrieving revision 1.11
diff -u -B -r1.11 Makefile
--- Makefile 20 Jul 2009 19:02:24 -0000 1.11
+++ Makefile 24 Jul 2009 09:34:08 -0000
@@ -18,7 +18,7 @@
# Boston, MA 02111-1307, USA.
VERSION = 1.03
-AUTHOR_VERSION = 1.8.5_pre4
+AUTHOR_VERSION = 1.8.7
MAINTAINER = Hans de Graaff <graaff(a)xemacs.org>
PACKAGE = ruby-modes
PKG_TYPE = regular
Index: inf-ruby.el
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el,v
retrieving revision 1.4
diff -u -B -r1.4 inf-ruby.el
--- inf-ruby.el 19 Jul 2009 08:18:14 -0000 1.4
+++ inf-ruby.el 24 Jul 2009 09:34:08 -0000
@@ -1,8 +1,8 @@
;;; -*-Emacs-Lisp-*-
;;;
-;;; $Id: inf-ruby.el,v 1.6.2.1 2004/07/27 07:51:28 matz Exp $
-;;; $Author: matz $
-;;; $Date: 2004/07/27 07:51:28 $
+;;; $Id: inf-ruby.el 12031 2007-03-11 10:01:15Z knu $
+;;; $Author: knu $
+;;; $Date: 2007-03-11 19:01:15 +0900 (Sun, 11 Mar 2007) $
;;;
;;; Inferior Ruby Mode - ruby process in a buffer.
;;; adapted from cmuscheme.el
@@ -34,11 +34,19 @@
;;;
;;; HISTORY
;;; senda - 8 Apr 1998: Created.
-;;; $Log: inf-ruby.el,v $
-;;; Revision 1.6.2.1 2004/07/27 07:51:28 matz
+;;; $Log$
+;;; Revision 1.7 2004/07/27 08:11:36 matz
+;;; * eval.c (rb_eval): copy on write for argument local variable
+;;; assignment.
+;;;
+;;; * eval.c (assign): ditto.
+;;;
+;;; * eval.c (rb_call0): update ruby_frame->argv with the default
+;;; value used for the optional arguments.
+;;;
;;; * object.c (Init_Object): "===" calls rb_obj_equal() directly.
;;; [ruby-list:39937]
-;;;
+;;;
;;; Revision 1.6 2002/09/07 14:35:46 nobu
;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
;;; alist for error message from ruby.
Index: inf-ruby.el.upstream
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el.upstream,v
retrieving revision 1.3
diff -u -B -r1.3 inf-ruby.el.upstream
--- inf-ruby.el.upstream 19 Jul 2009 08:18:14 -0000 1.3
+++ inf-ruby.el.upstream 24 Jul 2009 09:34:08 -0000
@@ -1,8 +1,8 @@
;;; -*-Emacs-Lisp-*-
;;;
-;;; $Id: inf-ruby.el,v 1.6.2.1 2004/07/27 07:51:28 matz Exp $
-;;; $Author: matz $
-;;; $Date: 2004/07/27 07:51:28 $
+;;; $Id: inf-ruby.el 12031 2007-03-11 10:01:15Z knu $
+;;; $Author: knu $
+;;; $Date: 2007-03-11 19:01:15 +0900 (Sun, 11 Mar 2007) $
;;;
;;; Inferior Ruby Mode - ruby process in a buffer.
;;; adapted from cmuscheme.el
@@ -34,11 +34,19 @@
;;;
;;; HISTORY
;;; senda - 8 Apr 1998: Created.
-;;; $Log: inf-ruby.el,v $
-;;; Revision 1.6.2.1 2004/07/27 07:51:28 matz
+;;; $Log$
+;;; Revision 1.7 2004/07/27 08:11:36 matz
+;;; * eval.c (rb_eval): copy on write for argument local variable
+;;; assignment.
+;;;
+;;; * eval.c (assign): ditto.
+;;;
+;;; * eval.c (rb_call0): update ruby_frame->argv with the default
+;;; value used for the optional arguments.
+;;;
;;; * object.c (Init_Object): "===" calls rb_obj_equal() directly.
;;; [ruby-list:39937]
-;;;
+;;;
;;; Revision 1.6 2002/09/07 14:35:46 nobu
;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
;;; alist for error message from ruby.
Index: ruby-mode.el
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el,v
retrieving revision 1.4
diff -u -B -r1.4 ruby-mode.el
--- ruby-mode.el 19 Jul 2009 08:18:15 -0000 1.4
+++ ruby-mode.el 24 Jul 2009 09:34:08 -0000
@@ -1,12 +1,12 @@
;;;
;;; ruby-mode.el -
;;;
-;;; $Author: matz $
-;;; $Date: 2005/11/30 15:56:57 $
+;;; $Author: knu $
+;;; $Date: 2008-05-19 00:02:36 +0900 (Mon, 19 May 2008) $
;;; created at: Fri Feb 4 14:49:13 JST 1994
;;;
-(defconst ruby-mode-revision "$Revision: 1.74.2.14 $")
+(defconst ruby-mode-revision "$Revision: 16458 $")
(defconst ruby-mode-version
(progn
@@ -28,7 +28,7 @@
)
(defconst ruby-non-block-do-re
- "\\(while\\|until\\|for\\|rescue\\)\\>"
+ "\\(while\\|until\\|for\\|rescue\\)\\>[^_]"
)
(defconst ruby-indent-beg-re
@@ -55,7 +55,7 @@
(concat ruby-modifier-beg-re "\\|" ruby-block-op-re)
)
-(defconst ruby-block-end-re "end")
+(defconst ruby-block-end-re "\\<end\\>")
(defconst ruby-here-doc-beg-re
"<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\
\([^']+\\)[']\\)")
@@ -71,13 +71,13 @@
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
ruby-block-beg-re
- "\\|" ruby-block-end-re
- "\\)\\>\\|^=begin\\|" ruby-here-doc-beg-re)
+ "\\)\\>\\|" ruby-block-end-re
+ "\\|^=begin\\|" ruby-here-doc-beg-re)
)
(defconst ruby-negative
- (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\("
- ruby-block-end-re "\\)\\>\\|}\\|\\]\\)")
+ (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|"
+ ruby-block-end-re "\\|}\\|\\]\\)")
)
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
@@ -265,7 +265,12 @@
(make-local-variable 'add-log-current-defun-function)
(setq add-log-current-defun-function 'ruby-add-log-current-method)
- (run-hooks 'ruby-mode-hook))
+ (set (make-local-variable 'font-lock-defaults)
'((ruby-font-lock-keywords) nil nil))
+ (set (make-local-variable 'font-lock-keywords)
ruby-font-lock-keywords)
+ (set (make-local-variable 'font-lock-syntax-table)
ruby-font-lock-syntax-table)
+ (set (make-local-variable 'font-lock-syntactic-keywords)
ruby-font-lock-syntactic-keywords)
+
+ (run-mode-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
(save-excursion
@@ -393,6 +398,8 @@
(t
(setq in-string (point))
(goto-char end))))
+ ((looking-at "/=")
+ (goto-char pnt))
((looking-at "/")
(cond
((and (not (eobp)) (ruby-expr-beg 'expr-re))
@@ -462,7 +469,7 @@
(setq depth (1- depth)))
(setq nest (cdr nest))
(goto-char pnt))
- ((looking-at (concat "\\<\\(" ruby-block-end-re
"\\)\\>"))
+ ((looking-at ruby-block-end-re)
(if (or (and (not (bolp))
(progn
(forward-char -1)
@@ -514,8 +521,9 @@
(setq nest (cons (cons nil pnt) nest))
(setq depth (1+ depth)))
(goto-char pnt))
- ((looking-at ":\\(['\"]\\)\\(\\\\.\\|[^\\\\]\\)*\\1")
- (goto-char (match-end 0)))
+ ((looking-at ":\\(['\"]\\)")
+ (goto-char (match-beginning 1))
+ (ruby-forward-string (buffer-substring (match-beginning 1) (match-end
1)) end))
((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\)")
(goto-char (match-end 0)))
((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?")
@@ -533,7 +541,7 @@
((looking-at "<<")
(cond
((and (ruby-expr-beg 'heredoc)
- (looking-at
"<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\sw+\
\)"))
+ (looking-at
"<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\
\sw\\|\\s_\\)+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))
@@ -790,7 +798,8 @@
(defun ruby-move-to-block (n)
(let (start pos done down)
(setq start (ruby-calculate-indent))
- (setq down (looking-at (concat "\\<\\(" (if (< n 0)
ruby-block-end-re ruby-block-beg-re) "\\)\\>")))
+ (setq down (looking-at (if (< n 0) ruby-block-end-re
+ (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
(forward-line n)
(cond
@@ -901,7 +910,7 @@
(?:
(forward-char -1)
(eq (char-before) :)))))
- (if (looking-at (concat "\\<\\(" ruby-block-end-re
"\\)\\>"))
+ (if (looking-at ruby-block-end-re)
(ruby-beginning-of-block))
nil))
(setq i (1- i)))
@@ -1020,30 +1029,19 @@
;; ?' ?" ?` are ascii codes
("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
;; regexps
- ("\\(^\\|[=(,~?:;]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|
until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\
\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
+ ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\
\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s
*\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
(4 (7 . ?/))
(6 (7 . ?/)))
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
- (cond ((featurep 'xemacs)
- (put 'ruby-mode 'font-lock-defaults
- '((ruby-font-lock-keywords)
- nil nil nil
- beginning-of-line
- (font-lock-syntactic-keywords
- . ruby-font-lock-syntactic-keywords))))
- (t
- (add-hook 'ruby-mode-hook
- '(lambda ()
- (make-local-variable 'font-lock-defaults)
- (make-local-variable 'font-lock-keywords)
- (make-local-variable 'font-lock-syntax-table)
- (make-local-variable 'font-lock-syntactic-keywords)
- (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
- (setq font-lock-keywords ruby-font-lock-keywords)
- (setq font-lock-syntax-table ruby-font-lock-syntax-table)
- (setq font-lock-syntactic-keywords
ruby-font-lock-syntactic-keywords)))))
+ (if (featurep 'xemacs)
+ (put 'ruby-mode 'font-lock-defaults
+ '((ruby-font-lock-keywords)
+ nil nil nil
+ beginning-of-line
+ (font-lock-syntactic-keywords
+ . ruby-font-lock-syntactic-keywords))))
(defun ruby-font-lock-docs (limit)
(if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)
Index: ruby-mode.el.upstream
===================================================================
RCS
file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el.upstream,v
retrieving revision 1.3
diff -u -B -r1.3 ruby-mode.el.upstream
--- ruby-mode.el.upstream 19 Jul 2009 08:18:15 -0000 1.3
+++ ruby-mode.el.upstream 24 Jul 2009 09:34:09 -0000
@@ -1,12 +1,12 @@
;;;
;;; ruby-mode.el -
;;;
-;;; $Author: matz $
-;;; $Date: 2005/11/30 15:56:57 $
+;;; $Author: knu $
+;;; $Date: 2008-05-19 00:02:36 +0900 (Mon, 19 May 2008) $
;;; created at: Fri Feb 4 14:49:13 JST 1994
;;;
-(defconst ruby-mode-revision "$Revision: 1.74.2.14 $")
+(defconst ruby-mode-revision "$Revision: 16458 $")
(defconst ruby-mode-version
(progn
@@ -18,7 +18,7 @@
)
(defconst ruby-non-block-do-re
- "\\(while\\|until\\|for\\|rescue\\)\\>"
+ "\\(while\\|until\\|for\\|rescue\\)\\>[^_]"
)
(defconst ruby-indent-beg-re
@@ -45,7 +45,7 @@
(concat ruby-modifier-beg-re "\\|" ruby-block-op-re)
)
-(defconst ruby-block-end-re "end")
+(defconst ruby-block-end-re "\\<end\\>")
(defconst ruby-here-doc-beg-re
"<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\
\([^']+\\)[']\\)")
@@ -61,13 +61,13 @@
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
ruby-block-beg-re
- "\\|" ruby-block-end-re
- "\\)\\>\\|^=begin\\|" ruby-here-doc-beg-re)
+ "\\)\\>\\|" ruby-block-end-re
+ "\\|^=begin\\|" ruby-here-doc-beg-re)
)
(defconst ruby-negative
- (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\("
- ruby-block-end-re "\\)\\>\\|}\\|\\]\\)")
+ (concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|"
+ ruby-block-end-re "\\|}\\|\\]\\)")
)
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
@@ -255,7 +255,12 @@
(make-local-variable 'add-log-current-defun-function)
(setq add-log-current-defun-function 'ruby-add-log-current-method)
- (run-hooks 'ruby-mode-hook))
+ (set (make-local-variable 'font-lock-defaults)
'((ruby-font-lock-keywords) nil nil))
+ (set (make-local-variable 'font-lock-keywords)
ruby-font-lock-keywords)
+ (set (make-local-variable 'font-lock-syntax-table)
ruby-font-lock-syntax-table)
+ (set (make-local-variable 'font-lock-syntactic-keywords)
ruby-font-lock-syntactic-keywords)
+
+ (run-mode-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
(save-excursion
@@ -383,6 +388,8 @@
(t
(setq in-string (point))
(goto-char end))))
+ ((looking-at "/=")
+ (goto-char pnt))
((looking-at "/")
(cond
((and (not (eobp)) (ruby-expr-beg 'expr-re))
@@ -452,7 +459,7 @@
(setq depth (1- depth)))
(setq nest (cdr nest))
(goto-char pnt))
- ((looking-at (concat "\\<\\(" ruby-block-end-re
"\\)\\>"))
+ ((looking-at ruby-block-end-re)
(if (or (and (not (bolp))
(progn
(forward-char -1)
@@ -504,8 +511,9 @@
(setq nest (cons (cons nil pnt) nest))
(setq depth (1+ depth)))
(goto-char pnt))
- ((looking-at ":\\(['\"]\\)\\(\\\\.\\|[^\\\\]\\)*\\1")
- (goto-char (match-end 0)))
+ ((looking-at ":\\(['\"]\\)")
+ (goto-char (match-beginning 1))
+ (ruby-forward-string (buffer-substring (match-beginning 1) (match-end
1)) end))
((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\)")
(goto-char (match-end 0)))
((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?")
@@ -523,7 +531,7 @@
((looking-at "<<")
(cond
((and (ruby-expr-beg 'heredoc)
- (looking-at
"<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\sw+\
\)"))
+ (looking-at
"<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\
\sw\\|\\s_\\)+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))
@@ -780,7 +788,8 @@
(defun ruby-move-to-block (n)
(let (start pos done down)
(setq start (ruby-calculate-indent))
- (setq down (looking-at (concat "\\<\\(" (if (< n 0)
ruby-block-end-re ruby-block-beg-re) "\\)\\>")))
+ (setq down (looking-at (if (< n 0) ruby-block-end-re
+ (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
(forward-line n)
(cond
@@ -891,7 +900,7 @@
(?:
(forward-char -1)
(eq (char-before) :)))))
- (if (looking-at (concat "\\<\\(" ruby-block-end-re
"\\)\\>"))
+ (if (looking-at ruby-block-end-re)
(ruby-beginning-of-block))
nil))
(setq i (1- i)))
@@ -1010,30 +1019,19 @@
;; ?' ?" ?` are ascii codes
("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
;; regexps
- ("\\(^\\|[=(,~?:;]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|
until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\
\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
+ ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\
\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s
*\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
(4 (7 . ?/))
(6 (7 . ?/)))
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
- (cond ((featurep 'xemacs)
- (put 'ruby-mode 'font-lock-defaults
- '((ruby-font-lock-keywords)
- nil nil nil
- beginning-of-line
- (font-lock-syntactic-keywords
- . ruby-font-lock-syntactic-keywords))))
- (t
- (add-hook 'ruby-mode-hook
- '(lambda ()
- (make-local-variable 'font-lock-defaults)
- (make-local-variable 'font-lock-keywords)
- (make-local-variable 'font-lock-syntax-table)
- (make-local-variable 'font-lock-syntactic-keywords)
- (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
- (setq font-lock-keywords ruby-font-lock-keywords)
- (setq font-lock-syntax-table ruby-font-lock-syntax-table)
- (setq font-lock-syntactic-keywords
ruby-font-lock-syntactic-keywords)))))
+ (if (featurep 'xemacs)
+ (put 'ruby-mode 'font-lock-defaults
+ '((ruby-font-lock-keywords)
+ nil nil nil
+ beginning-of-line
+ (font-lock-syntactic-keywords
+ . ruby-font-lock-syntactic-keywords))))
(defun ruby-font-lock-docs (limit)
(if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches