[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 :

   (cond ((boundp 'before-save-hook)
          (make-local-variable 'before-save-hook)
         ((boundp 'write-contents-functions) 'write-contents-functions)
         ((boundp 'write-contents-hooks) 'write-contents-hooks))

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]