From 97a1d656f8deb0363921fc9d3a5a98d61dbceef5 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 31 May 2010 09:22:25 +0000 Subject: [PATCH] * misc/ruby-mode.el (ruby-mode-set-encoding): skip shebang line always regardless of ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ misc/ruby-mode.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e2f3345a07..73154960f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon May 31 18:22:23 2010 Nobuyoshi Nakada + + * misc/ruby-mode.el (ruby-mode-set-encoding): skip shebang line + always regardless of ruby. + Mon May 31 15:07:18 2010 NARUSE, Yui * file.c (file_expand_path): Refix r28102: this breaks diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index a72fabe0e6..a5a9d91bf2 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -342,7 +342,7 @@ Also ignores spaces after parenthesis when 'space." (cdr (assq coding-system ruby-encoding-map))) coding-system)) "ascii-8bit")) - (if (looking-at "^#![^\n]*ruby") (beginning-of-line 2)) + (unless (looking-at "^#![^\n]*ruby") (beginning-of-line 2)) (cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)\\s *\\(;\\|-\*-\\)") (unless (string= (match-string 2) coding-system) (goto-char (match-beginning 2))