* misc/ruby-mode.el (ruby-encoding-map, ruby-use-encoding-map): added
to customize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
668af7e99d
commit
05eeb60259
@ -1,3 +1,8 @@
|
|||||||
|
Fri Mar 14 11:24:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-encoding-map, ruby-use-encoding-map): added
|
||||||
|
to customize.
|
||||||
|
|
||||||
Fri Mar 14 10:37:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Fri Mar 14 10:37:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
|
||||||
|
@ -162,6 +162,14 @@ Also ignores spaces after parenthesis when 'space."
|
|||||||
"Default deep indent style."
|
"Default deep indent style."
|
||||||
:options '(t nil space) :group 'ruby)
|
:options '(t nil space) :group 'ruby)
|
||||||
|
|
||||||
|
(defcustom ruby-encoding-map '((shift_jis . cp932))
|
||||||
|
"Alist to map encoding name from emacs to ruby."
|
||||||
|
:group 'ruby)
|
||||||
|
|
||||||
|
(defcustom ruby-use-encoding-map t
|
||||||
|
"*Use `ruby-encoding-map' to set encoding magic comment if this is non-nil."
|
||||||
|
:type 'boolean :group 'ruby)
|
||||||
|
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(defun ruby-imenu-create-index-in-block (prefix beg end)
|
(defun ruby-imenu-create-index-in-block (prefix beg end)
|
||||||
(let ((index-alist '()) (case-fold-search nil)
|
(let ((index-alist '()) (case-fold-search nil)
|
||||||
@ -251,11 +259,11 @@ Also ignores spaces after parenthesis when 'space."
|
|||||||
buffer-file-coding-system))))
|
buffer-file-coding-system))))
|
||||||
(setq coding-system
|
(setq coding-system
|
||||||
(if coding-system
|
(if coding-system
|
||||||
(symbol-name coding-system)
|
(symbol-name
|
||||||
|
(or (and ruby-use-encoding-map
|
||||||
|
(cdr (assq coding-system ruby-encoding-map)))
|
||||||
|
coding-system))
|
||||||
"ascii-8bit"))
|
"ascii-8bit"))
|
||||||
;; special treat for compatibility with -Ks
|
|
||||||
(if (string-equal coding-system "shift_jis")
|
|
||||||
(setq coding-system "cp932"))
|
|
||||||
(if (looking-at "^#![^\n]*ruby") (beginning-of-line 2))
|
(if (looking-at "^#![^\n]*ruby") (beginning-of-line 2))
|
||||||
(cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]+\\)")
|
(cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]+\\)")
|
||||||
(unless (string= (match-string 2) coding-system)
|
(unless (string= (match-string 2) coding-system)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user