josteink / emacs-oob-reboot

A project to revitalize Emacs by providing core-friendly changes for an improved out-of-the-box experience
85 stars 9 forks source link

Why not enable company everywhere? #28

Closed angrybacon closed 1 year ago

angrybacon commented 7 years ago

Once we're done agreeing on the scope of this repository and that we can indeed include external packages (see #26), I would enable (global-company-mode). That is to allow path completion even in text-mode inherited modes.

ssunday commented 7 years ago

@angrybacon That'd be fantastic

justinjk007 commented 7 years ago

Yeah, I don't know why is it is bounded to prog-mode, @josteink

phillord commented 7 years ago

The concern is that competion would confuse people. Programmers know what it is in all modes, but it's less clear that more normal people do. And there are normal people using tools like org-mode, for instance. Limiting to prog-mode is conservative I think. Thinking about how to get more evidence to for on with all modes would be my next step.

angrybacon commented 7 years ago

@phillord I understand that the limiting factor here is the most basic of all users. We could just set company-backends to whatever is relevant for said user eg. company-files and whichever backend complete with the buffer content.

phillord commented 7 years ago

@angrybacon Yep. I am sitting on the fence, I am afraid. I just do not know. I have seen new Emacs users, and they want to the autocompletion. But, not programmers? In a text mode? I just do not know. If you have sat behind some new users with company on, and have watched them, then I would be happy. I know that I have not.

angrybacon commented 7 years ago

@phillord I've had the opportunity to show new students (and friends) in my school how to be more efficient with Emacs a few years back. One of the first things they wanted from my configuration was auto-completion indeed, be it for function or variable names, as well as english in comments. Naturally the latter extends to text-mode.

phillord commented 7 years ago

That's good information, but was this after you they saw your emacs? If you turn it on and give it to a new user does it seem natural or confusing, especially, if they are alone.

Another line of evidence would be to look at other editors and see which they use.

angrybacon commented 7 years ago

@phillord So I've asked my girlfriend to copy an article found on the Internet with our current defaults but with company enabled and company-ispell as well.

M-x text-mode RET
M-x global-company-mode RET
M-: (add-to-list 'company-backends 'company-ispell) RET
  • I like the completion thing, makes it easy to type complex words where typos are common
  • Too bad the completion box doesn't appear when deleting characters as well, when mistakenly selecting the wrong candidate for instance
  • There are sometimes duplicates in the list of candidates, eg. "emp" suggests ("empty" "empty)
  • The box takes too long and/or too many characters to show up

That would suggest the following changes to what we currently have (untested and written directly here):

(global-company-mode)
(add-hook 'text-mode-hook
          (lambda ()
            (setq-local 'company-backends '((company-ispell :with company-something)
                                            company-files))))
(setq-default
 company-dabbrev-downcase nil
 company-idle-delay .2
 company-minimum-prefix-length 1)

I'm not so hot on company and its internals, company-something should be whichever backend suggests strings from the current buffer (that's a thing correct?).

What does seem too opinionated here?

angrybacon commented 7 years ago

Also:

phillord commented 7 years ago

@angrybacon That's nice -- user stories and experiences are a good way to go. I might try and replicate this.

Duplicates -- that's a bug, not a usuability issue. If they are there, it needs fixing.

josteink commented 7 years ago

I'm voting against company-ispell.

ispell in general does not work well multiple languages and support for various international languages is poor.

This setting will be annoying for anyone not a native English speaker or constrained to one language only.

Basically this will be a "improved" default people will google for how to disable.

I'm generally against company mode in text-modes, but not as strongly as it coupled with ispell. That would be a usability disaster for me.

jackrusher commented 7 years ago

I'm not psyched for defaulting to company-mode on text buffers. I do think flyspell is a good default, but a better spellchecking installation experience would be quite nice (though this is probably largely a platform-dependent doc issue).

In terms of languages, I use hunspell for my own multilingual spellchecking needs.

josteink commented 7 years ago

hunspell is indeed nice and I use it... For the languages it supports, which sadly doesn't include my own native language (Norwegian).

Emacs also tends to assume that whatever system-locale you have is the language you'd like to edit/spell-check in. That's a major fallacy.

Like many people, I like my system in English, but that doesn't mean I never write stuff in any other language.

Without a footer-button (ala MS Word) where you can quickly, and for the section of the document you are editing, select the language you want... A automatic spell-checking (or spell-completion.. yuck) will be mostly a nuisance.

And Emacs doesn't have that footer, and in that regard I'm against any and all automatic spell-checker features.

Basically, I think that's a clear point where we are crossing the point from "improving a default" to being opinionated ("people will only edit things in one language, and that's whatever their system locale is set to").

It's a big world out there. This "feature" will cater to fewer than it will annoy.

a better spellchecking installation experience would be quite nice (though this is probably largely a platform-dependent doc issue).

This is indeed platform specific, and not something Emacs can provide on its own. Another reason for not including it in this patch-set.

So yeah. If it's OK for anyone else, I'd like to put the auto spelling-checking thing (and spell-completion) dead as rock right here and now.

angrybacon commented 7 years ago

Not even for file paths then?

josteink commented 7 years ago

File paths are different. They will probably not be intrusive and pop up all the time, causing annoyances or confusion to the same degrees.

And as long as CSS and XML is considered "text-modes" by core Emacs, I can see file-name completion being a useful feature here.

And just to clarify my previous comment:

I'd like to put the auto spelling-checking thing (and completion) dead as rock right here and now.

By this I meant:

I'd like to put the auto spelling-checking thing (and spellling-completion) dead as rock right here and now.

Just to ensure there are no confusion about what I wanted to put dead :)

angrybacon commented 7 years ago

css-mode is an interactive autoloaded compiled Lisp function in ‘css-mode.el’.

(css-mode)

Parent mode: ‘prog-mode’.

Major mode to edit Cascading Style Sheets.

What am I missing here?

josteink commented 7 years ago

What am I missing here?

% find . -name css-mode.el
./lisp/textmodes/css-mode.el

css-mode has traditionally been a text-mode. It seems this was changed back in 2015. Good to know :)

That still leaves nxml-mode:

(define-derived-mode nxml-mode text-mode "nXML"

But with css-mode fixed, it leaves me hope we can fix nxml-mode too :)

Translated into TLDR plain-speak: I can see useful cases for company-mode outside prog-mode, so I'm no longer entirely against it :)

Edit: I've emailed emacs-devel about changing nxml-mode. TLDR still applies.

jackrusher commented 7 years ago

@josteink I've written text in four different languages within emacs this week. I feel your pain. But I think it's fair to say that most people write in one or two languages most of the time, and they almost all want spell checking turned on when they do so. If we don't enable flyspell by default, I'd very much like to see some additional hand-holding around getting it set up (including help with the installation of some or another external spelling tool).

josteink commented 1 year ago

I think recent changes to Emacs (eglot, tree-sitter, etc) has helped make Emacs much more usable OOB. Considering repo-purpose obsolete.

Closing all issues and archiving repo. Thanks to all contributors!