[#35036] Intentional Programming — "John" <nojgoalbyspam@...>

Hi all

17 messages 2002/03/01

[#35112] RDoc question — Michael Davis <mdavis@...>

I have a question about RDoc. I would like to reference an external

17 messages 2002/03/02

[#35162] string to array and back — Ron Jeffries <ronjeffries@...>

I am needing to convert strings to arrays of bytes and back. I see pack and

19 messages 2002/03/03

[#35364] file reading impossibly slow? — Ron Jeffries <ronjeffries@...>

So I'm doing this benchmark to work with my set program. Part of the problem is

18 messages 2002/03/07

[#35429] Interesting link on static/dynamic typing... — Robert Feldt <feldt@...>

...relevant to Ruby compared to other languages discussion:

25 messages 2002/03/08
[#35441] Re: Interesting link on static/dynamic typing... — Paul Brannan <paul@...> 2002/03/08

On Fri, Mar 08, 2002 at 05:34:43PM +0900, Robert Feldt wrote:

[#35460] Spam, ruby-talk, and me — Dave Thomas <Dave@...>

14 messages 2002/03/08

[#35537] Confusion — David Corbin <dcorbin@...>

The following is from my debugging through xmlc.rb

16 messages 2002/03/10

[#35579] RE: WIN32OLE and LDAP — "Morris, Chris" <chris.morris@...>

> The new version 0.4.2 of Win32OLE has WIN32OLE.bind method.

16 messages 2002/03/11

[#35652] Method type 'abstract' — Peter Hickman <peter@...>

The one thing I miss in Ruby is the abstract class method to go along

15 messages 2002/03/12

[#35653] Some potential RCRs — "Bob Alexander" <bobalex@...>

Here are a few thing I am considering submitting as RCRs. I'm looking for comments to help decide whether to make them official, so please let know what you think is good and bad about these...

50 messages 2002/03/12
[#35672] Re: Some potential RCRs — matz@... (Yukihiro Matsumoto) 2002/03/12

Hi,

[#35683] Re: Some potential RCRs — Massimiliano Mirra <list@...> 2002/03/12

On Wed, Mar 13, 2002 at 03:58:01AM +0900, Yukihiro Matsumoto wrote:

[#35697] Re: Some potential RCRs — David Alan Black <dblack@...> 2002/03/13

Hello --

[#35694] rpkg 0.3 — Massimiliano Mirra <list@...>

14 messages 2002/03/13
[#35699] RE: [ANN] rpkg 0.3 — <james@...> 2002/03/13

>

[#35787] testunit - setup -> set_up ? — "Morris, Chris" <chris.morris@...>

I'm just starting to use testunit instead of rubyunit ... I noticed with an

21 messages 2002/03/13
[#35793] RE: testunit - setup -> set_up ? — "Nathaniel Talbott" <nathaniel@...> 2002/03/13

Morris, Chris [mailto:chris.morris@snelling.com] wrote:

[#35796] Re: testunit - setup -> set_up ? — Dave Thomas <Dave@...> 2002/03/13

"Nathaniel Talbott" <nathaniel@talbott.ws> writes:

[#35797] RE: testunit - setup -> set_up ? — "Nathaniel Talbott" <nathaniel@...> 2002/03/13

dave@thomases.com [mailto:dave@thomases.com] wrote:

[#35898] camelCase and underscore_style — "Morris, Chris" <chris.morris@...>

First, a question. If underscore_style is the Ruby norm for methods and the

20 messages 2002/03/15
[#35924] Re: camelCase and underscore_style — "Guy N. Hurst" <gnhurst@...> 2002/03/15

Phil Tomson wrote:

[#35930] RE: camelCase and underscore_style — "Nathaniel Talbott" <nathaniel@...> 2002/03/16

Guy N. Hurst [mailto:gnhurst@hurstlinks.com] wrote:

[#35989] ANN: Locana GUI and GUI Builder version 0.81 — Michael Davis <mdavis@...>

I am pleased to announce release 0.81 of Locana. Locana is a GUI

16 messages 2002/03/16

[#35992] XPath — Michael Schuerig <schuerig@...>

27 messages 2002/03/16

[#36034] Mini Rant: Indenting — Thomas Hurst <tom.hurst@...>

Why is it that I see *so* much code like:

14 messages 2002/03/17

[#36049] web templating for static sites? — Massimiliano Mirra <list@...>

I'm using the Template Toolkit for generating static web sites and I

42 messages 2002/03/17
[#36426] web standars (was: web templating for static sites?) — Tobias Reif <tobiasreif@...> 2002/03/20

Albert Wagner wrote:

[#36052] Xml Serialization for Ruby — "Chris Morris" <chrismo@...>

=Xml Serialization for Ruby

20 messages 2002/03/17
[#36059] Re: [ANN] Xml Serialization for Ruby — Massimiliano Mirra <list@...> 2002/03/17

On Mon, Mar 18, 2002 at 05:20:56AM +0900, Chris Morris wrote:

[#36067] eval/Module question — David Corbin <dcorbin@...>

If I have a String src that is similar to the following:

13 messages 2002/03/18

[#36157] Development of Windows version of Ruby — ptkwt@...1.aracnet.com (Phil Tomson)

Now that we've dumped the cygwin requirement for the Windows version of

63 messages 2002/03/18
[#36330] Re: Development of Windows version of Ruby — Ron Jeffries <ronjeffries@...> 2002/03/19

On Tue, 19 Mar 2002 14:05:27 GMT, "Albert L. Wagner" <alwagner@uark.edu> wrote:

[#36431] Re: Development of Windows version of Ruby — Dennis Newbold <dennisn@...> 2002/03/20

[#36458] Windows version of Ruby (proposals) — ptkwt@... (Phil Tomson) 2002/03/21

Dennis Newbold <dennisn@pe.net> wrote in message news:<Pine.GSO.3.96.1020320113603.22242B-100000@shell2>...

[#36482] RE: Windows version of Ruby (proposals) — "Christian Boos" <cboos@...> 2002/03/21

Some thoughts on the 2 first Windows issues, plus a 4th one...

[#36496] Re: Windows version of Ruby (proposals) — Dave Thomas <Dave@...> 2002/03/21

"Christian Boos" <cboos@bct-technology.com> writes:

[#36510] Re: Windows version of Ruby (proposals) — nobu.nokada@... 2002/03/21

Hi,

[#36514] Re: Windows version of Ruby (proposals) — Dave Thomas <Dave@...> 2002/03/21

nobu.nokada@softhome.net writes:

[#36518] Re: Windows version of Ruby (proposals) — nobu.nokada@... 2002/03/21

Hi,

[#36211] dots in Dir.entries — matz@... (Yukihiro Matsumoto)

Hi,

22 messages 2002/03/19

[#36231] style choice — Ron Jeffries <ronjeffries@...>

A style question for the community ... which of the following do you prefer, and

18 messages 2002/03/19

[#36345] ANN: REXML 2.0 — Sean Russell <ser@...>

I have a feeling there will only be three major revisions of REXML. Version

19 messages 2002/03/20

[#36610] Re: Windows version of Ruby (proposals) — Ron Jeffries <ronjeffries@...>

On Thu, 21 Mar 2002 14:11:55 GMT, Dave Thomas <Dave@PragmaticProgrammer.com> wrote:

16 messages 2002/03/22

[#36645] Ruby for Mac OS 10.1 — Jim Freeze <jim@...>

Hi:

28 messages 2002/03/23

[#36768] Re: Difference between 'do' and 'begin' — Clemens Hintze <c.hintze@...>

In <slrna9ulvi.f2h.mwg@fluffy.isd.dp.ua> Wladimir Mutel <mwg@fluffy.isd.dp.ua> writes:

23 messages 2002/03/26
[#36783] RE: Difference between 'do' and 'begin' — <james@...> 2002/03/26

[#36792] Re: Difference between 'do' and 'begin' — Kent Dahl <kentda@...> 2002/03/26

james@rubyxml.com wrote:

[#36808] Error calling Tk in a loop — <james@...>

I'm trying to write some code that pops up a Tk window when for certain

15 messages 2002/03/26

[#36841] RE: Windows version of Ruby (proposals) — "Andres Hidalgo" <sol123@...>

I believe that Ruby has a place in windows (Office), I happened to have

14 messages 2002/03/27

[#36863] Hash.new(Hash.new) doesn't use Hash.new as default value — "Jonas Delfs" <jonas@...>

Hi -

18 messages 2002/03/27

[#37080] Why isn't Math object-oriented? — Bil Kleb <W.L.Kleb@...>

So I'm reading along in the Pixaxe book (yet again), and I am told

15 messages 2002/03/30

[#37121] String#begins?(s) — timsuth@... (Tim Sutherland)

class String

24 messages 2002/03/31

[patch] update to (X)Emacs modes

From: Ville Skytt<ville.skytta@...>
Date: 2002-03-16 13:32:52 UTC
List: ruby-talk #35964
Hello, 

attached is a patch with some trivial changes to ruby-mode.el and
inf-ruby.el, mainly to enable configuration of these modes through the
customization menu, as well as some little documentation tuneups.  I did
this while I was adding these to XEmacs prog-modes package, see
http://cvs.xemacs.org/viewcvs.cgi/XEmacs/packages/xemacs-packages/prog-modes/

The patch is against ruby-mode.el version 1.25.2.8 and inf-ruby.el
version 1.3.  Note that I have messed around with the CVS-generated tags
in the top of ruby-mode.el, please ignore these changes.  They are there
only because otherwise the XEmacs CVS would clobber them. 

It would be cool if someone could add Ruby's copyright statement (or
just the GPL, whatever the policy is) into the top of all misc/*.el
files so people browsing the XEmacs CVS repository and/or source files
would have a better idea where do they come from. 

I will be adding rubydb3x.el to XEmacs soonish, too. 

-- 
Ville Skytt
ville.skytta@xemacs.org

Attachments (2)

inf-ruby.patch (8.13 KB, text/x-diff)
--- inf-ruby.el.orig	Thu Feb 28 02:06:41 2002
+++ inf-ruby.el	Thu Feb 28 10:46:33 2002
@@ -72,35 +72,37 @@
 (require 'comint)
 (require 'ruby-mode)
 
-;;
-;; you may change these variables
-;;
-;(defvar ruby-program-name "rbc --noreadline"
-;  "*Program invoked by the run-ruby command")
-;
-;(defvar inferior-ruby-first-prompt-pattern "^rbc0> *"
-;  "first prompt regex pattern of ruby interpreter.")
-;
-;(defvar inferior-ruby-prompt-pattern "^\\(rbc.[>*\"'] *\\)+"
-;  "prompt regex pattern of ruby interpreter.")
+(defgroup ruby-inferior-mode nil
+  "Major mode for interacting with an inferior ruby (irb) process."
+  :group 'ruby
+  :prefix "inferior-ruby-")
 
 ;;;; for irb
-(defvar ruby-program-name "irb --inf-ruby-mode"
-  "*Program invoked by the run-ruby command")
-
-(defvar inferior-ruby-first-prompt-pattern "^irb(.*)[0-9:]+0> *"
-  "first prompt regex pattern of ruby interpreter.")
-
-(defvar inferior-ruby-prompt-pattern "^\\(irb(.*)[0-9:]+[>*\"'] *\\)+"
-  "prompt regex pattern of ruby interpreter.")
+(defcustom ruby-program-name "irb --inf-ruby-mode"
+  "*Program invoked by the `run-ruby' command."
+  :type 'string
+  :group 'ruby-inferior-mode)
+
+(defcustom inferior-ruby-first-prompt-pattern "^irb(.*)[0-9:]+0> *"
+  "*First prompt regex pattern of ruby interpreter."
+  :type 'regexp
+  :group 'ruby-inferior-mode)
+
+(defcustom inferior-ruby-prompt-pattern "^\\(irb(.*)[0-9:]+[>*\"'] *\\)+"
+  "*Prompt regex pattern of ruby interpreter."
+  :type 'regexp
+  :group 'ruby-inferior-mode)
 
 ;;
 ;; mode variables
 ;;
-(defvar inferior-ruby-mode-hook nil
-  "*Hook for customising inferior-ruby mode.")
+(defcustom inferior-ruby-mode-hook nil
+  "*Hook for customising `inferior-ruby-mode'."
+  :type 'hook
+  :group 'ruby-inferior-mode)
+
 (defvar inferior-ruby-mode-map nil
-  "*Mode map for inferior-ruby-mode")
+  "*Mode map for `inferior-ruby-mode'.")
 
 (cond ((not inferior-ruby-mode-map)
        (setq inferior-ruby-mode-map
@@ -111,8 +113,15 @@
        (define-key inferior-ruby-mode-map "\C-c\C-l" 'ruby-load-file)
 ))
 
+(defcustom inferior-ruby-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
+  "*Input matching this regexp are not saved on the history list.
+Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters."
+  :type 'regexp
+  :group 'ruby-inferior-mode)
+
+;;;###autoload
 (defun inf-ruby-keys ()
-  "Set local key defs for inf-ruby in ruby-mode"
+  "Set local key defs for inf-ruby in `ruby-mode'."
   (define-key ruby-mode-map "\M-\C-x" 'ruby-send-definition)
 ;  (define-key ruby-mode-map "\C-x\C-e" 'ruby-send-last-sexp)
   (define-key ruby-mode-map "\C-c\C-e" 'ruby-send-definition)
@@ -124,7 +133,8 @@
   (define-key ruby-mode-map "\C-c\C-s" 'run-ruby)
 )
 
-(defvar ruby-buffer nil "current ruby (actually irb) process buffer.")
+(defvar ruby-buffer nil
+  "Current ruby (actually irb) process buffer.")
 
 (defun inferior-ruby-mode ()
   "Major mode for interacting with an inferior ruby (irb) process.
@@ -132,32 +142,44 @@
 The following commands are available:
 \\{inferior-ruby-mode-map}
 
-A ruby process can be fired up with M-x run-ruby.
+A ruby process can be fired up with \\[run-ruby].
+
+Customisation:
 
-Customisation: Entry to this mode runs the hooks on comint-mode-hook and
-inferior-ruby-mode-hook (in that order).
+Entry to this mode runs the hooks on `comint-mode-hook' and
+`inferior-ruby-mode-hook' (in that order).
 
 You can send text to the inferior ruby process from other buffers containing
 Ruby source.
-    switch-to-ruby switches the current buffer to the ruby process buffer.
-    ruby-send-definition sends the current definition to the ruby process.
-    ruby-send-region sends the current region to the ruby process.
+    `switch-to-ruby' switches the current buffer to the ruby process buffer.
+    `ruby-send-definition' sends the current definition to the ruby process.
+    `ruby-send-region' sends the current region to the ruby process.
 
-    ruby-send-definition-and-go, ruby-send-region-and-go,
+    `ruby-send-definition-and-go', `ruby-send-region-and-go',
         switch to the ruby process buffer after sending their text.
+
 For information on running multiple processes in multiple buffers, see
-documentation for variable ruby-buffer.
+documentation for variable `ruby-buffer'.
 
 Commands:
-Return after the end of the process' output sends the text from the 
-    end of process to point.
-Return before the end of the process' output copies the sexp ending at point
-    to the end of the process' output, and sends it.
+
+Return after the end of the process' output sends the text from the end of
+process to point.
+
+Return before the end of the process' output copies the sexp ending at
+point to the end of the process' output, and sends it.
+
 Delete converts tabs to spaces as it moves back.
-Tab indents for ruby; with argument, shifts rest
-    of expression rigidly with the current line.
+
+Tab indents for ruby; with argument, shifts rest of expression rigidly with
+the current line.
+
 C-M-q does Tab on each line starting within following expression.
-Paragraphs are separated only by blank lines.  # start comments.
+
+Paragraphs are separated only by blank lines.
+
+# start comments.
+
 If you accidentally suspend your process, use \\[comint-continue-subjob]
 to continue it."
   (interactive)
@@ -175,12 +197,8 @@
   (setq comint-get-old-input (function ruby-get-old-input))
   (run-hooks 'inferior-ruby-mode-hook))
 
-(defvar inferior-ruby-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
-  "*Input matching this regexp are not saved on the history list.
-Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.")
-
 (defun ruby-input-filter (str)
-  "Don't save anything matching inferior-ruby-filter-regexp"
+  "Don't save anything matching `inferior-ruby-filter-regexp'."
   (not (string-match inferior-ruby-filter-regexp str)))
 
 ;; adapted from replace-in-string in XEmacs (subr.el)
@@ -194,7 +212,7 @@
     (concat rtn-str (substring str start))))
 
 (defun ruby-get-old-input ()
-  "Snarf the sexp ending at point"
+  "Snarf the sexp ending at point."
   (save-excursion
     (let ((end (point)))
       (re-search-backward inferior-ruby-first-prompt-pattern)
@@ -215,6 +233,7 @@
 		 (ruby-args-to-list (substring string pos
 						 (length string)))))))))
 
+;;;###autoload
 (defun run-ruby (cmd)
   "Run an inferior Ruby process, input and output via buffer *ruby*.
 If there is a process already running in `*ruby*', switch to that buffer.
@@ -261,7 +280,7 @@
   (interactive "P")
   (if (get-buffer ruby-buffer)
       (pop-to-buffer ruby-buffer)
-      (error "No current process buffer. See variable ruby-buffer."))
+      (error "No current process buffer. See variable `ruby-buffer'."))
   (cond (eob-p
 	 (push-mark)
 	 (goto-char (point-max)))))
@@ -283,14 +302,13 @@
 (defvar ruby-source-modes '(ruby-mode)
   "*Used to determine if a buffer contains Ruby source code.
 If it's loaded into a buffer that is in one of these major modes, it's
-considered a ruby source file by ruby-load-file.
+considered a ruby source file by `ruby-load-file'.
 Used by these commands to determine defaults.")
 
 (defvar ruby-prev-l/c-dir/file nil
   "Caches the last (directory . file) pair.
-Caches the last pair used in the last ruby-load-file command.
-Used for determining the default in the 
-next one.")
+Caches the last pair used in the last `ruby-load-file' command.
+Used for determining the default in the next one.")
 
 (defun ruby-load-file (file-name)
   "Load a Ruby file into the inferior Ruby process."
@@ -305,12 +323,12 @@
 					    "\"\)\n")))
 
 (defun ruby-proc ()
-  "Returns the current ruby process. See variable ruby-buffer."
+  "Returns the current ruby process. See variable `ruby-buffer'."
   (let ((proc (get-buffer-process (if (eq major-mode 'inferior-ruby-mode)
 				      (current-buffer)
 				    ruby-buffer))))
     (or proc
-	(error "No current process. See variable ruby-buffer"))))
+	(error "No current process. See variable `ruby-buffer'."))))
 
 ;;; Do the user's customisation...
 
@@ -320,6 +338,12 @@
 	
 (run-hooks 'inf-ruby-load-hook)
 
+;;;###autoload
+(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
+
+;;;###autoload
+(add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys)))
+
 (provide 'inf-ruby)
 
 ;;; inf-ruby.el ends here
ruby-mode.el.patch (3.23 KB, text/x-diff)
--- ruby-mode.el.orig	Thu Feb 28 10:54:53 2002
+++ ruby-mode.el	Thu Feb 28 10:59:50 2002
@@ -1,18 +1,28 @@
 ;;;
 ;;;  ruby-mode.el -
 ;;;
-;;;  $Author: nobu $
-;;;  $Date: 2002/02/22 11:24:27 $
+;;;  Author: nobu
+;;;  Date: 2002/02/22 11:24:27
 ;;;  created at: Fri Feb  4 14:49:13 JST 1994
 ;;;
 
-(defconst ruby-mode-revision "$Revision: 1.25.2.8 $")
+(defconst ruby-mode-revision "Revision: 1.25.2.8")
 
 (defconst ruby-mode-version
   (progn
    (string-match "[0-9.]+" ruby-mode-revision)
    (substring ruby-mode-revision (match-beginning 0) (match-end 0))))
 
+(defgroup ruby nil
+  "Major mode for editing ruby scripts."
+  :group 'languages
+  :prefix "ruby-")
+
+(defcustom ruby-indent-level 2
+  "*Indentation of ruby statements."
+  :type 'integer
+  :group 'ruby)
+
 (defconst ruby-block-beg-re
   "class\\|module\\|def\\|if\\|unless\\|case\\|while\\|until\\|for\\|begin\\|do"
   )
@@ -66,11 +76,11 @@
 (defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]"))
 
 (defvar ruby-mode-abbrev-table nil
-  "Abbrev table in use in ruby-mode buffers.")
+  "Abbrev table in use in `ruby-mode' buffers.")
 
 (define-abbrev-table 'ruby-mode-abbrev-table ())
 
-(defvar ruby-mode-map nil "Keymap used in ruby mode.")
+(defvar ruby-mode-map nil "Keymap used in `ruby-mode'.")
 
 (if ruby-mode-map
     nil
@@ -90,7 +100,7 @@
   (define-key ruby-mode-map "\C-m" 'newline))
 
 (defvar ruby-mode-syntax-table nil
-  "Syntax table in use in ruby-mode buffers.")
+  "Syntax table in use in `ruby-mode' buffers.")
 
 (if ruby-mode-syntax-table
     ()
@@ -123,9 +133,6 @@
   (modify-syntax-entry ?\] ")[" ruby-mode-syntax-table)
   )
 
-(defvar ruby-indent-level 2
-  "*Indentation of ruby statements.")
-
 (eval-when-compile (require 'cl))
 (defun ruby-imenu-create-index ()
   (let ((index-alist '())
@@ -175,13 +182,14 @@
   (make-local-variable 'paragraph-ignore-fill-prefix)
   (setq paragraph-ignore-fill-prefix t))
 
+;;;###autoload
 (defun ruby-mode ()
   "Major mode for editing ruby scripts.
 \\[ruby-indent-command] properly indents subexpressions of multi-line
 class, module, def, if, while, for, do, and case statements, taking
 nesting into account.
 
-The variable ruby-indent-level controls the amount of indentation.
+The variable `ruby-indent-level' controls the amount of indentation.
 \\{ruby-mode-map}"
   (interactive)
   (kill-all-local-variables)
@@ -642,12 +650,12 @@
   (back-to-indentation))
 
 (defun ruby-beginning-of-block ()
-  "Move backward to next beginning-of-block"
+  "Move backward to next beginning-of-block."
   (interactive)
   (ruby-move-to-block -1))
 
 (defun ruby-end-of-block ()
-  "Move forward to next beginning-of-block"
+  "Move forward to next beginning-of-block."
   (interactive)
   (ruby-move-to-block 1))
 
@@ -837,7 +845,7 @@
      ;; expression expansion
      '("#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)"
        0 font-lock-variable-name-face t))
-    "*Additional expressions to highlight in ruby mode."))
+    "Additional expressions to highlight in `ruby-mode'."))
 
  ((featurep 'hilit19)
   (hilit-set-mode-patterns
@@ -858,5 +866,9 @@
      ("^__END__" nil label))))
  )
 
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
 
 (provide 'ruby-mode)
+
+;;; ruby-mode.el ends here

In This Thread

Prev Next