summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--misc/ruby-mode.el8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a9dae5224..435041fa54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 12 12:49:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-here-doc-beg-match): fix for here-doc
+ which ends with an underscore.
+
Tue Jan 12 09:58:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* hash.c: need to include errno.h for EINVAL.
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 70acd7266b..cbf944c2ab 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -121,13 +121,15 @@
(match-string 6)))))
(defun ruby-here-doc-beg-match ()
- (let ((contents (regexp-quote (concat (match-string 2) (match-string 3)))))
+ (let ((contents (concat
+ (regexp-quote (concat (match-string 2) (match-string 3)))
+ (if (string= (match-string 3) "_") "\\B" "\\b"))))
(concat "<<"
(let ((match (match-string 1)))
(if (and match (> (length match) 0))
(concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
- contents "\\b\\(\\1\\|\\2\\)")
- (concat "-?\\([\"']\\|\\)" contents "\\b\\1"))))))
+ contents "\\(\\1\\|\\2\\)")
+ (concat "-?\\([\"']\\|\\)" contents "\\1"))))))
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("