all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ruby-mode : ruby-mode-set-encoding
@ 2009-03-03 13:46 Paul R
  2009-03-03 13:55 ` Leo
  0 siblings, 1 reply; 14+ messages in thread
From: Paul R @ 2009-03-03 13:46 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-03-04 16:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03 13:46 ruby-mode : ruby-mode-set-encoding Paul R
2009-03-03 13:55 ` Leo
2009-03-03 16:30   ` Stefan Monnier
2009-03-04  0:23     ` Nobuyoshi Nakada
2009-03-04  1:14       ` Stefan Monnier
2009-03-04  2:05         ` Stephen J. Turnbull
2009-03-04  4:07           ` Stefan Monnier
2009-03-04  6:10             ` Stephen J. Turnbull
2009-03-04 14:10               ` Stefan Monnier
2009-03-04 15:07                 ` Stephen J. Turnbull
2009-03-04 16:40                   ` Stefan Monnier
2009-03-04  8:25       ` Paul R
2009-03-04 14:13         ` Stefan Monnier
2009-03-04 14:56         ` Nobuyoshi Nakada

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.