[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107650: * lisp/progmodes/ruby-mode.e
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107650: * lisp/progmodes/ruby-mode.el: Don't confuse "end:" for "end". |
Date: |
Wed, 21 Mar 2012 14:33:07 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107650
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10786
author: Dmitry Gutov <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-03-21 14:33:07 -0400
message:
* lisp/progmodes/ruby-mode.el: Don't confuse "end:" for "end".
(ruby-block-end-re, ruby-delimiter, ruby-parse-partial)
(ruby-beginning-of-indent): Be more careful with the difference
between word-boundary and symbol boundary.
(ruby-mode-syntax-table): Make : a symbol constituent.
modified:
lisp/ChangeLog
lisp/progmodes/ruby-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-03-21 18:27:05 +0000
+++ b/lisp/ChangeLog 2012-03-21 18:33:07 +0000
@@ -1,3 +1,11 @@
+2012-03-21 Dmitry Gutov <address@hidden>
+
+ * progmodes/ruby-mode.el: Don't confuse "end:" for "end" (bug#10786).
+ (ruby-block-end-re, ruby-delimiter, ruby-parse-partial)
+ (ruby-beginning-of-indent): Be more careful with the difference
+ between word-boundary and symbol boundary.
+ (ruby-mode-syntax-table): Make : a symbol constituent.
+
2012-03-21 Andreas Politz <address@hidden>
* outline.el (outline-flag-region): Evaporate overlays (bug#10789).
=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el 2012-01-19 07:21:25 +0000
+++ b/lisp/progmodes/ruby-mode.el 2012-03-21 18:33:07 +0000
@@ -96,7 +96,7 @@
(regexp-opt (append ruby-modifier-beg-keywords ruby-block-op-keywords))
"Regexp to match hanging block modifiers.")
-(defconst ruby-block-end-re "\\<end\\>")
+(defconst ruby-block-end-re "\\_<end\\_>")
(eval-and-compile
(defconst ruby-here-doc-beg-re
@@ -115,9 +115,9 @@
(match-string 6)))))
(defconst ruby-delimiter
- (concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
+ (concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\_<\\("
ruby-block-beg-re
- "\\)\\>\\|" ruby-block-end-re
+ "\\)\\_>\\|" ruby-block-end-re
"\\|^=begin\\|" ruby-here-doc-beg-re))
(defconst ruby-negative
@@ -166,6 +166,7 @@
(modify-syntax-entry ?$ "." table)
(modify-syntax-entry ?? "_" table)
(modify-syntax-entry ?_ "_" table)
+ (modify-syntax-entry ?: "_" table)
(modify-syntax-entry ?< "." table)
(modify-syntax-entry ?> "." table)
(modify-syntax-entry ?& "." table)
@@ -565,7 +566,7 @@
(setq nest (cons (cons nil pnt) nest))
(setq depth (1+ depth))))
(goto-char (match-end 0)))
- ((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
+ ((looking-at (concat "\\_<\\(" ruby-block-beg-re "\\)\\_>"))
(and
(save-match-data
(or (not (looking-at (concat "do" ruby-keyword-end-re)))
@@ -864,7 +865,7 @@
;; It seems like it should move to the line where indentation should deepen,
;; but ruby-indent-beg-re only accounts for whitespace before class, module
and def,
;; so this will only match other block beginners at the beginning of the
line.
- (and (re-search-backward (concat "^\\(" ruby-indent-beg-re "\\)\\b") nil
'move)
+ (and (re-search-backward (concat "^\\(" ruby-indent-beg-re "\\)\\_>") nil
'move)
(beginning-of-line)))
(defun ruby-move-to-block (n)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107650: * lisp/progmodes/ruby-mode.el: Don't confuse "end:" for "end".,
Stefan Monnier <=