[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ruby-mode : ruby-mode-set-encoding
From: |
Paul R |
Subject: |
ruby-mode : ruby-mode-set-encoding |
Date: |
Tue, 03 Mar 2009 14:46:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) |
Hello list,
ruby mode is now part of emacs.
There is this particular function :
(defun ruby-mode-set-encoding ()
"Insert a magic comment header with the proper encoding if necessary."
...
and AFAIK only ruby mode use this type of thing. It is added to saving
functions hooks :
(add-hook
(cond ((boundp 'before-save-hook)
(make-local-variable 'before-save-hook)
'before-save-hook)
((boundp 'write-contents-functions) 'write-contents-functions)
((boundp 'write-contents-hooks) 'write-contents-hooks))
'ruby-mode-set-encoding)
I am not sure what the usecase is for this function but it writes
useless cookies in the headers of my ruby files whenever they contain
something else that ascii chars. Reading the code, it seems that the
definition of "necessary" is not very clear.
Does anybody know why this is necessary please ? If it is really
required, I would suggest to add a customizable variable to disable this
magic behaviour.
thanks,
--
Paul
- ruby-mode : ruby-mode-set-encoding,
Paul R <=
- Re: ruby-mode : ruby-mode-set-encoding, Leo, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Stefan Monnier, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Nobuyoshi Nakada, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Stefan Monnier, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Stephen J. Turnbull, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Stefan Monnier, 2009/03/03
- Re: ruby-mode : ruby-mode-set-encoding, Stephen J. Turnbull, 2009/03/04
- Re: ruby-mode : ruby-mode-set-encoding, Stefan Monnier, 2009/03/04
- Re: ruby-mode : ruby-mode-set-encoding, Stephen J. Turnbull, 2009/03/04
- Re: ruby-mode : ruby-mode-set-encoding, Stefan Monnier, 2009/03/04