[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18113] Another ruby-mode.el patch: quicker here-doc detection

From: Nathan Weizenbaum <nex342@...>
Date: 2008-08-04 01:32:42 UTC
List: ruby-core #18113
Hi again,

Attached is a patch that modifies my here-doc code to stop it from 
checking for here-docs during normal typing unless a string (or 
here-doc) has already been opened, and is also faster at finding here 
docs when they do exist.

- Nathan

Attachments (1)

here-doc-speedy.diff (2.22 KB, text/x-diff)
Index: misc/ruby-mode.el
===================================================================
--- misc/ruby-mode.el	(revision 18324)
+++ misc/ruby-mode.el	(working copy)
@@ -67,8 +67,8 @@
             (let ((match (match-string 1)))
               (if (and match (> (length match) 0))
                   (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
-                          contents "\\(\\1\\|\\2\\)")
-                (concat "-?\\([\"']\\|\\)" contents "\\1"))))))
+                          contents "\\b\\(\\1\\|\\2\\)")
+                (concat "-?\\([\"']\\|\\)" contents "\\b\\1"))))))
 
 (defconst ruby-delimiter
   (concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
@@ -1096,17 +1096,17 @@
         (string-to-syntax "|"))))
 
   (defun ruby-here-doc-end-syntax ()
-    (save-excursion
-      (goto-char (match-end 0))
-      (let ((old-point (point))
-            (beg-exists (re-search-backward (ruby-here-doc-beg-match) nil t))
-            (eol (save-excursion (end-of-line) (point))))
-        (if (and beg-exists ; If there is a heredoc that matches this line...
-                 (null (syntax-ppss-context (syntax-ppss))) ; And that's not inside a heredoc/string/comment...
-                 (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...
-                        (not (re-search-forward ruby-here-doc-beg-re eol t)))
-                 (eq old-point (ruby-here-doc-find-end old-point))) ; And it ends at this point...
-            (string-to-syntax "|")))))
+    (let ((pss (syntax-ppss)))
+      (when (eq (syntax-ppss-context pss) 'string)
+        (save-excursion
+          (goto-char (nth 8 pss))
+          (let ((eol (point)))
+            (beginning-of-line)
+            (if (and (re-search-forward (ruby-here-doc-beg-match) eol t) ; If there is a heredoc that matches this line...
+                     (null (syntax-ppss-context (syntax-ppss))) ; And that's not inside a heredoc/string/comment...
+                     (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...
+                            (not (re-search-forward ruby-here-doc-beg-re eol t))))
+                (string-to-syntax "|")))))))
 
   (if (featurep 'xemacs)
       (put 'ruby-mode 'font-lock-defaults

In This Thread

Prev Next