Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unexpected autoloads #71

Merged
merged 1 commit into from
Feb 15, 2015
Merged

Remove unexpected autoloads #71

merged 1 commit into from
Feb 15, 2015

Conversation

wasamasa
Copy link

@wasamasa wasamasa commented Feb 2, 2015

To quote the Emacs Lisp manual:

Simply loading a package should not change Emacs's editing
behavior. Include a command or commands to enable and disable the
feature, or to invoke it.

This convention is mandatory for any file that includes custom
definitions. If fixing such a file to follow this convention requires
an incompatible change, go ahead and make the incompatible change;
don't postpone it.

To quote the Emacs Lisp manual:

> Simply loading a package should not change Emacs's editing
> behavior. Include a command or commands to enable and disable the
> feature, or to invoke it.

> This convention is mandatory for any file that includes custom
> definitions.  If fixing such a file to follow this convention requires
> an incompatible change, go ahead and make the incompatible change;
> don't postpone it.
@wasamasa
Copy link
Author

wasamasa commented Feb 2, 2015

I've stumbled over this because enh-ruby-mode errored out for me (with error in process filter: undefined method 'size' for nil:NilClass: /home/wasa/.emacs.d/elpa/enh-ruby-mode-20140616.1718/ruby/erm_buffer.rb:261:in 'on_eol'), I've tried using vanilla ruby-mode and enabling it gave me enh-ruby-mode again. That kind of thing shouldn't happen, especially not considering the README tells you to add it yourself to the auto-mode-alist.

@zenspider
Copy link
Owner

If you can consistently repro that error, I'd like a repro and/or a fix for it first.

@zenspider zenspider self-assigned this Feb 2, 2015
@wasamasa
Copy link
Author

wasamasa commented Feb 2, 2015

I cannot reproduce the error I've mentioned (I did a Ruby upgrade from 2.1 to 2.2 and that's pretty much everything that might have caused it, it sounds like #69 since it later went away without any clear reason) and worse, cannot debug the ruby portions involved as long as enh-ruby-mode is loaded first and prevents a major mode change (presumably because it is attaching itself to the change-major-mode-hook and failure in this hook prevents changing it from happening).

The only way I can stop this from happening is putting something in my Emacs configuration which undoes this autoloaded change (which shouldn't have happened in the first place) or removing the package alltogether. Both are subpar, I'd rather keep the package and toggle whether I want to use it or not by having a line in my configuration automatically using it for a filetype which I can comment out for debugging purposes.

@wasamasa
Copy link
Author

I've tried downgrading my Ruby installation to 2.1 and that magically solved all errors I've had, so perhaps something got deprecated in 2.1 and removed in 2.2.

@wasamasa
Copy link
Author

Further discussion on #ruby revealed that it might be not Ruby that changed, but rather Ripper. All I can say so far is that something in the parser calls on_nl nil and that trips it out.

@wasamasa
Copy link
Author

Well, now that the source of the error is fixed, what about this pull request itself?

zenspider added a commit that referenced this pull request Feb 15, 2015
@zenspider zenspider merged commit e6c3c47 into zenspider:master Feb 15, 2015
@zenspider
Copy link
Owner

Hrm... I just merged this, but I'm starting to disagree with it. Adding entries to auto-mode-alist isn't "changing Emacs's editing behavior". It is changing mode switching, but not editing.

Other progmodes that add to auto-mode-alist: bat-mode, cc-mode, python-mode, ruby-mode, vera-mode, vhdl-mode. I'm sure there is more because my regexp was quiet naive.

@wasamasa
Copy link
Author

All of these are built-in. I guess what I'm concerned about is that this changes an already existing association and that's what's making it unexpected.

A similiar situation happened with js2-mode. Its author is aware that Emacs is already using js-mode and therefore doesn't automatically override auto-mode-alist. In fact, there's packages using js2-mode as library due to its parsing abilities, the very same could be done with this one.

Repository owner locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants