[#10193] String.ord — David Flanagan <david@...>

Hi,

41 messages 2007/02/05
[#10197] Re: String.ord — Yukihiro Matsumoto <matz@...> 2007/02/06

Hi,

[#10198] Re: String.ord — David Flanagan <david@...> 2007/02/06

Yukihiro Matsumoto wrote:

[#10199] Re: String.ord — Daniel Berger <djberg96@...> 2007/02/06

David Flanagan wrote:

[#10200] Re: String.ord — David Flanagan <david@...> 2007/02/06

Daniel Berger wrote:

[#10208] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10213] Re: String.ord — David Flanagan <david@...> 2007/02/06

Nikolai Weibull wrote:

[#10215] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10216] Re: String.ord — David Flanagan <david@...> 2007/02/07

Nikolai Weibull wrote:

[#10288] Socket library should support abstract unix sockets — <noreply@...>

Bugs item #8597, was opened at 2007-02-13 16:10

12 messages 2007/02/13

[#10321] File.basename fails on Windows root paths — <noreply@...>

Bugs item #8676, was opened at 2007-02-15 10:09

11 messages 2007/02/15

[#10323] Trouble with xmlrpc — James Edward Gray II <james@...>

Some of the Ruby code used by TextMate makes use of xmlrpc/

31 messages 2007/02/15
[#10324] Re: Trouble with xmlrpc — "Berger, Daniel" <Daniel.Berger@...> 2007/02/15

> -----Original Message-----

[#10326] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/15

On Feb 15, 2007, at 1:29 PM, Berger, Daniel wrote:

[#10342] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

While I am complaining about xmlrpc, we have another issue. It's

[#10343] Re: Trouble with xmlrpc — Alex Young <alex@...> 2007/02/16

James Edward Gray II wrote:

[#10344] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

On Feb 16, 2007, at 12:08 PM, Alex Young wrote:

(new) PATCH: Emacs support for 'ruby-debug' (rdebug)

From: Martin Nordholts <enselic@...>
Date: 2007-02-27 23:39:09 UTC
List: ruby-core #10447
This is a patch against trunk that also changes ./misc/README. The patch
is attached in this mail.

- Martin

Attachments (1)

rdebug.patch (6.72 KB, text/x-diff)
Index: misc/rdebug.el
===================================================================
--- misc/rdebug.el	(revision 0)
+++ misc/rdebug.el	(revision 0)
@@ -0,0 +1,150 @@
+;;  This file adds support for ruby-debug (rdebug) in Emacs.
+;;  Copyright (C) 2007 Martin Nordholts <enselic@gmail.com>
+;;
+;;  This file is based on 'rubydb3x.el' that comes with Ruby which is
+;;  Copyright (C) Yukihiro Matsumoto aka Matz
+;;
+;;  This program is free software; you can redistribute it and/or
+;;  modify it under the terms of the GNU General Public License
+;;  as published by the Free Software Foundation; either version 2
+;;  of the License, or (at your option) any later version.
+;;
+;;  This program is distributed in the hope that it will be useful,
+;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;  GNU General Public License for more details.
+;;
+;;  You should have received a copy of the GNU General Public License
+;;  along with this program; if not, write to the Free Software
+;;  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+;;
+;;  Installation:
+;;  -------------
+;;
+;;    1.  Make sure you have ruby-debug on your system (test by running
+;;        the commmand 'rdebug -v' in a shell).
+;;
+;;    2.  Copy this file into e.g. ~/.elisp and make sure this is in
+;;        your ~/.emacs:
+;;
+;;          (add-to-list 'load-path "~/.elisp")
+;;          (load-library "rdebug")
+;;
+;;        you can then start the debugger with M-x rdebug
+;;
+;;    3.  Setup convenient keybindings etc. This is what I have:
+;;
+;;          (global-set-key [f9] 'gud-step)
+;;          (global-set-key [f10] 'gud-next)
+;;          (global-set-key [f11] 'gud-cont)
+;;
+;;          (global-set-key "\C-c\C-d" 'rdebug)
+;;
+;;    4. Debug like crazy!
+;;
+;;  Bugs:
+;;  -----
+;;
+;;    Basic functionality works fine, though I'm pretty sure this is not solid proof.
+
+(require 'gud)
+(provide 'rdebug)
+
+;; ======================================================================
+;; rdebug functions
+
+;;; History of argument lists passed to rdebug.
+(defvar gud-rdebug-history nil)
+
+(if (fboundp 'gud-overload-functions)
+    (defun gud-rdebug-massage-args (file args)
+      (cons file args))
+  (defun gud-rdebug-massage-args (file args)
+    args))
+
+;; There's no guarantee that Emacs will hand the filter the entire
+;; marker at once; it could be broken up across several strings.  We
+;; might even receive a big chunk with several markers in it.  If we
+;; receive a chunk of text which looks like it might contain the
+;; beginning of a marker, we save it here between calls to the
+;; filter.
+(defvar gud-rdebug-marker-acc "")
+(make-variable-buffer-local 'gud-rdebug-marker-acc)
+
+(defun gud-rdebug-marker-filter (string)
+  (setq gud-rdebug-marker-acc (concat gud-rdebug-marker-acc string))
+  (let ((output ""))
+
+    ;; Process all the complete markers in this chunk.
+    (while (string-match "\\([^:\n]*\\):\\([0-9]+\\):.*\n"
+			 gud-rdebug-marker-acc)
+      (setq
+
+       ;; Extract the frame position from the marker.
+       gud-last-frame
+       (cons (substring gud-rdebug-marker-acc (match-beginning 1) (match-end 1))
+	     (string-to-int (substring gud-rdebug-marker-acc
+				       (match-beginning 2)
+				       (match-end 2))))
+
+
+       ;; Append any text before the marker to the output we're going
+       ;; to return - we don't include the marker in this text.
+       output (concat output
+		      (substring gud-rdebug-marker-acc 0 (match-beginning 0)))
+       
+       ;; Set the accumulator to the remaining text.
+       gud-rdebug-marker-acc (substring gud-rdebug-marker-acc (match-end 0))))
+    
+    (setq output (concat output gud-rdebug-marker-acc)
+	  gud-rdebug-marker-acc "")
+    
+    output))
+
+(defun gud-rdebug-find-file (f)
+  (save-excursion
+    (let ((buf (find-file-noselect f)))
+      (set-buffer buf)
+;;      (gud-make-debug-menu)
+      buf)))
+
+(defvar rdebug-command-name "rdebug"
+  "File name for executing rdebug.")
+
+;;;###autoload
+(defun rdebug (command-line)
+  "Run rdebug on program FILE in buffer *gud-FILE*.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger."
+  (interactive
+   (list (read-from-minibuffer "Run rdebug (like this): "
+			       (if (consp gud-rdebug-history)
+				   (car gud-rdebug-history)
+				 (concat rdebug-command-name " "))
+			       nil nil
+			       '(gud-rdebug-history . 1))))
+  
+  (if (not (fboundp 'gud-overload-functions))
+      (gud-common-init command-line 'gud-rdebug-massage-args
+		       'gud-rdebug-marker-filter 'gud-rdebug-find-file)
+    (gud-overload-functions '((gud-massage-args . gud-rdebug-massage-args)
+			      (gud-marker-filter . gud-rdebug-marker-filter)
+			      (gud-find-file . gud-rdebug-find-file)))
+    (gud-common-init command-line rdebug-command-name))
+  
+  (gud-def gud-break  "break %d%f:%l"   "\C-b" "Set breakpoint at current line in current file.")
+;  (gud-def gud-remove "delete %d%f:%l"  "\C-d" "Remove breakpoint at current line in current file.")
+  (gud-def gud-step   "step"            "\C-s" "Step one source line with display.")
+  (gud-def gud-next   "next"            "\C-n" "Step one line (skip functions).")
+  (gud-def gud-cont   "cont"            "\C-r" "Continue with display.")
+  (gud-def gud-finish "finish"          "\C-f" "Finish executing current function.")
+  (gud-def gud-up     "up %p"           "<" "Up N stack frames (numeric arg).")
+  (gud-def gud-down   "down %p"         ">" "Down N stack frames (numeric arg).")
+  (gud-def gud-print  "p %e"            "\C-p" "Evaluate ruby expression at point.")
+
+  (setq comint-prompt-regexp "^(rdb:-) ")
+  (if (boundp 'comint-last-output-start)
+      (set-marker comint-last-output-start (point)))
+  (set (make-local-variable 'paragraph-start) comint-prompt-regexp)
+  (run-hooks 'rdebug-mode-hook)
+  )
Index: misc/README
===================================================================
--- misc/README	(revision 11927)
+++ misc/README	(arbetskopia)
@@ -1,6 +1,7 @@
-README		this file
-inf-ruby.el	program to run ruby under emacs
-ruby-mode.el	ruby mode for emacs
-rubydb2x.el	ruby debugger support for emacs 19.2x or before
-rubydb3x.el	ruby debugger support for emacs 19.3x or later
-ruby-electric.el emacs minor mode providing electric commands
+README            this file
+inf-ruby.el       program to run ruby under emacs
+ruby-mode.el      ruby mode for emacs
+rubydb2x.el       ruby debugger support for emacs 19.2x or before
+rubydb3x.el       ruby debugger support for emacs 19.3x or later
+ruby-electric.el  emacs minor mode providing electric commands
+rdebug.el         ruby-debug (rdebug) support for emacs 19.3x or later

In This Thread