0

I have a function that calls global-company-mode with argument 1 (enable) or -1 (disable).

A user can enable and disable however many times he wants. Do I have to set the configuration variables for company-mode every time I enable global-company-mode? Or would emacs remember the settings done before the first call that enables global-company-mode?

7
  • They are global variables so they will keep their values for ever.
    – NickD
    Aug 2 at 21:37
  • They became available upon package installation, whether the mode is enabled or not?
    – Ephram
    Aug 2 at 22:34
  • It depends on what you mean by installation. From my POV, they become available generally when the package is initialized (loaded into Emacs), although you can set options before that (in which case they are "available" but they are not of much use). But in any case, you don't need to reset them before every enablement of the mode.
    – NickD
    Aug 2 at 23:33
  • Yes, by require if I have the source code, or with install with list-packages.
    – Ephram
    Aug 2 at 23:44
  • You have some strange ideas: require ultimately does a load and it does not care if the file it loads is a .el file or a .elc file. Package initialization (not installation) does the same thing: it's just that in most cases, package installation compiles the .el files and produces .elc files, so package initialization ends up loading .elc files. That's all.
    – NickD
    Aug 3 at 1:46

1 Answer 1

0

Quoting from company mode manual:

To activate the company-mode, execute the command M-x company-mode that toggles the mode on and off. When it is switched on, the mode line (see (emacs)Mode line) should indicate its presence with an indicator ‘company’.

So do not play with global-company-mode at all, just use the function company-mode to do that. You may write a small function for that and bind it to some key(s).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.