From 42ebc34ea8f93efe5b23c0124691207f32055666 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 27 Mar 2014 08:53:13 +0200 Subject: [PATCH] Fix bug#17097 * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don't propertize `?' or `!' as symbol constituent when after colon. --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/ruby-mode.el | 1 + test/indent/ruby.rb | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb256740a0..ff76cadf94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-27 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): + Don't propertize `?' or `!' as symbol constituent when after + colon. (Bug#17097) + 2014-03-27 Juanma Barranquero * frameset.el (frameset--restore-frame): Remove workaround for bug#14795 diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2b8f2fa686..7219221d4e 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1812,6 +1812,7 @@ It will be properly highlighted even when the call omits parens.") ("[!?]" (0 (unless (save-excursion (or (nth 8 (syntax-ppss (match-beginning 0))) + (eq (char-before) ?:) (let (parse-sexp-lookup-properties) (zerop (skip-syntax-backward "w_"))) (memq (preceding-char) '(?@ ?$)))) diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 9948243314..fb341ee7ba 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -148,6 +148,11 @@ if something == :== ) end +# Bug#17097 +if x == :!= + something +end + # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html d = 4 + 5 + # no '\' needed 6 + 7 -- 2.20.1