CVS update by graaff packages/xemacs-packages/ruby-modes, inf-ruby.el, ruby-mode.el.upstream ...

[email protected]
Newsgroups gmane.emacs.xemacs.cvs
Message-ID <[email protected]>
  User: graaff  
  Date: 09/07/24 11:35:44

  Modified:    packages/xemacs-packages/ruby-modes ChangeLog Makefile
                        inf-ruby.el inf-ruby.el.upstream ruby-mode.el
                        ruby-mode.el.upstream
Log:
Sync to elisp distributed with ruby 1.8.7.

Revision  Changes    Path
1.13      +4 -0      XEmacs/packages/xemacs-packages/ruby-modes/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- ChangeLog	2009/07/20 19:02:24	1.12
+++ ChangeLog	2009/07/24 09:35:39	1.13
@@ -1,3 +1,7 @@
+2009-07-24  Hans de Graaff  <[email protected]>
+
+	* Sync with upstream 1.8.7
+
 2009-07-20  Norbert Koch  <[email protected]>
 
 	* Makefile (VERSION): XEmacs package 1.03 released.



1.12      +1 -1      XEmacs/packages/xemacs-packages/ruby-modes/Makefile

Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- Makefile	2009/07/20 19:02:24	1.11
+++ Makefile	2009/07/24 09:35:39	1.12
@@ -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 <[email protected]>
 PACKAGE = ruby-modes
 PKG_TYPE = regular



1.5       +14 -6     XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el

Index: inf-ruby.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- inf-ruby.el	2009/07/19 08:18:14	1.4
+++ inf-ruby.el	2009/07/24 09:35:39	1.5
@@ -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.



1.4       +14 -6     XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el.upstream

Index: inf-ruby.el.upstream
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/inf-ruby.el.upstream,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- inf-ruby.el.upstream	2009/07/19 08:18:14	1.3
+++ inf-ruby.el.upstream	2009/07/24 09:35:39	1.4
@@ -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.



1.5       +33 -35    XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el

Index: ruby-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- ruby-mode.el	2009/07/19 08:18:15	1.4
+++ ruby-mode.el	2009/07/24 09:35:39	1.5
@@ -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,8 +265,13 @@ The variable `ruby-indent-level' control
   (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
     (beginning-of-line)
@@ -393,6 +398,8 @@ The variable `ruby-indent-level' control
 	 (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 @@ The variable `ruby-indent-level' control
 	  (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 @@ The variable `ruby-indent-level' control
 	 (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 @@ The variable `ruby-indent-level' control
        ((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 @@ An end of a defun is found by moving for
 (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 @@ An end of a defun is found by moving for
 				   (?:
 				    (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 @@ balanced expression is found."
 	  ;; ?' ?" ?` 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)



1.4       +33 -35    XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el.upstream

Index: ruby-mode.el.upstream
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ruby-modes/ruby-mode.el.upstream,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ruby-mode.el.upstream	2009/07/19 08:18:15	1.3
+++ ruby-mode.el.upstream	2009/07/24 09:35:39	1.4
@@ -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,8 +255,13 @@ The variable ruby-indent-level controls 
   (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
     (beginning-of-line)
@@ -383,6 +388,8 @@ The variable ruby-indent-level controls 
 	 (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 @@ The variable ruby-indent-level controls 
 	  (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 @@ The variable ruby-indent-level controls 
 	 (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 @@ The variable ruby-indent-level controls 
        ((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 @@ An end of a defun is found by moving for
 (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 @@ An end of a defun is found by moving for
 				   (?:
 				    (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 @@ balanced expression is found."
 	  ;; ?' ?" ?` 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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.