mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* misc/ruby-mode.el (ruby-mode-set-encoding): updates magic comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4102378f79
commit
f7ed47355e
3 changed files with 29 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Jan 29 00:10:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* misc/ruby-mode.el (ruby-mode-set-encoding): updates magic comment.
|
||||
|
||||
Mon Jan 28 23:47:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* parse.y (rb_id2str, ripper_initialize, Init_ripper):
|
||||
|
|
|
@ -234,21 +234,34 @@ Also ignores spaces after parenthesis when 'space."
|
|||
(make-local-variable 'paragraph-ignore-fill-prefix)
|
||||
(setq paragraph-ignore-fill-prefix t))
|
||||
|
||||
(eval-when-compile
|
||||
(unless (fboundp 'coding-system-to-mime-charset)
|
||||
(defun coding-system-to-mime-charset (coding-system)
|
||||
(coding-system-change-eol-conversion coding-system nil))))
|
||||
|
||||
(defun ruby-mode-set-encoding ()
|
||||
(save-excursion
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "[^\0-\177]" nil t)
|
||||
(goto-char (point-min))
|
||||
(if (looking-at "^#![^\n]*ruby") (beginning-of-line 2))
|
||||
(unless (looking-at "\s*#\.*coding\s*[:=]")
|
||||
(insert "# -*- coding: "
|
||||
(let ((coding-system (coding-system-to-mime-charset (or coding-system-for-write
|
||||
buffer-file-coding-system))))
|
||||
(if coding-system
|
||||
(symbol-name coding-system)
|
||||
"ascii-8bit"))
|
||||
" -*-\n")))))
|
||||
(let ((coding-system
|
||||
(coding-system-to-mime-charset
|
||||
(or coding-system-for-write
|
||||
buffer-file-coding-system))))
|
||||
(setq coding-system
|
||||
(if coding-system
|
||||
(symbol-name coding-system)
|
||||
"ascii-8bit"))
|
||||
(if (looking-at "^#![^\n]*ruby") (beginning-of-line 2))
|
||||
(cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]+\\)")
|
||||
(unless (string= (match-string 2) coding-system)
|
||||
(goto-char (match-beginning 2))
|
||||
(delete-region (point) (match-end 2))
|
||||
(insert coding-system)))
|
||||
((looking-at "\\s *#.*coding\\s *[:=]"))
|
||||
(t (insert "# -*- coding: " coding-system " -*-\n"))
|
||||
)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun ruby-mode ()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2008-01-28"
|
||||
#define RUBY_RELEASE_DATE "2008-01-29"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20080128
|
||||
#define RUBY_RELEASE_CODE 20080129
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2008
|
||||
#define RUBY_RELEASE_MONTH 1
|
||||
#define RUBY_RELEASE_DAY 28
|
||||
#define RUBY_RELEASE_DAY 29
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Add table
Reference in a new issue