unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Notmuch-Company overrides other company backends?
@ 2022-01-08 18:28 Igor Sosa Mayor
  2022-01-08 18:42 ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Sosa Mayor @ 2022-01-08 18:28 UTC (permalink / raw)
  To: notmuch

Hi,

as far as I see, notmuch-company overrides other company backends. Other
is it maybe something with my configuration?

If I look into company-backends I only see company-notmuch instead of
my usual backends (ispell, dabbrev, etc.).

Any hints?

Many thanks in advance.

Igor 

-- 
:: Igor Sosa Mayor     :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/      ::
:: jabberid: rogorido  ::                            ::

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

* Re: Notmuch-Company overrides other company backends?
  2022-01-08 18:28 Notmuch-Company overrides other company backends? Igor Sosa Mayor
@ 2022-01-08 18:42 ` David Bremner
  2022-01-08 19:02   ` Igor Sosa Mayor
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2022-01-08 18:42 UTC (permalink / raw)
  To: Igor Sosa Mayor, notmuch

Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:

> Hi,
>
> as far as I see, notmuch-company overrides other company backends. Other
> is it maybe something with my configuration?
>
> If I look into company-backends I only see company-notmuch instead of
> my usual backends (ispell, dabbrev, etc.).
>
> Any hints?
>
> Many thanks in advance.
>
> Igor 

I guess you mean that it overrides it in a buffer-local way, in
notmuch-message-mode? Or do you see some kind of global overiding going
on?

d

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

* Re: Notmuch-Company overrides other company backends?
  2022-01-08 18:42 ` David Bremner
@ 2022-01-08 19:02   ` Igor Sosa Mayor
  2022-01-08 20:19     ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Sosa Mayor @ 2022-01-08 19:02 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:
>
>> Hi,
>>
>> as far as I see, notmuch-company overrides other company backends. Other
>> is it maybe something with my configuration?
>>
>> If I look into company-backends I only see company-notmuch instead of
>> my usual backends (ispell, dabbrev, etc.).
>>
>> Any hints?
>>
>> Many thanks in advance.
>>
>> Igor 
>
> I guess you mean that it overrides it in a buffer-local way, in
> notmuch-message-mode? Or do you see some kind of global overiding going
> on?
>
> d

thanks for your reply. Yes, sorry for not being clear enough. I see in
the code

  (make-local-variable 'company-backends)
  (setq company-backends '(notmuch-company))

https://github.com/kootenpv/emp/blob/master/.emacs.d/notmuch/notmuch-company.el

What is the best method to get the other backends back?

Many thanks in advance.

Best,

Igor
-- 
:: Igor Sosa Mayor     :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/      ::
:: jabberid: rogorido  ::                            ::

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

* Re: Notmuch-Company overrides other company backends?
  2022-01-08 19:02   ` Igor Sosa Mayor
@ 2022-01-08 20:19     ` David Bremner
  2022-01-08 21:17       ` Igor Sosa Mayor
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2022-01-08 20:19 UTC (permalink / raw)
  To: Igor Sosa Mayor, notmuch

Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:

>>
>> I guess you mean that it overrides it in a buffer-local way, in
>> notmuch-message-mode? Or do you see some kind of global overiding going
>> on?
>>
>> d
>
> thanks for your reply. Yes, sorry for not being clear enough. I see in
> the code
>
>   (make-local-variable 'company-backends)
>   (setq company-backends '(notmuch-company))
>
> https://github.com/kootenpv/emp/blob/master/.emacs.d/notmuch/notmuch-company.el

That's kind of an odd reference, since it seems to be some old copy of
our code, possibly mutated.

> What is the best method to get the other backends back?

I would try replacing the (setq company-backends '(notmuch-local)) with
(push 'notmuch-company company-backends)

In the case of the current code, you'd have to unwind the setq-default
into the two-lines in the old copy you linked to.

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

* Re: Notmuch-Company overrides other company backends?
  2022-01-08 20:19     ` David Bremner
@ 2022-01-08 21:17       ` Igor Sosa Mayor
  2022-01-09  0:35         ` Igor Sosa Mayor
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Sosa Mayor @ 2022-01-08 21:17 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:
>
>>>
>>> I guess you mean that it overrides it in a buffer-local way, in
>>> notmuch-message-mode? Or do you see some kind of global overiding going
>>> on?
>>>
>>> d
>>
>> thanks for your reply. Yes, sorry for not being clear enough. I see in
>> the code
>>
>>   (make-local-variable 'company-backends)
>>   (setq company-backends '(notmuch-company))
>>
>> https://github.com/kootenpv/emp/blob/master/.emacs.d/notmuch/notmuch-company.el
>
> That's kind of an odd reference, since it seems to be some old copy of
> our code, possibly mutated.

yes, sorry. I think it was google who gave me the reference. I see in
the present code there is
(setq-local company-backends '(notmuch-company))

https://git.notmuchmail.org/git?p=notmuch;a=blob;f=emacs/notmuch-company.el;h=7e05dc8f2a796aaf2c664fdcc4be63f6a443057f;hb=HEAD

>> What is the best method to get the other backends back?
>
> I would try replacing the (setq company-backends '(notmuch-local)) with
> (push 'notmuch-company company-backends)
>
> In the case of the current code, you'd have to unwind the setq-default
> into the two-lines in the old copy you linked to.

OK, thanks. I will give it a try!

Best,

Igor 

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

* Re: Notmuch-Company overrides other company backends?
  2022-01-08 21:17       ` Igor Sosa Mayor
@ 2022-01-09  0:35         ` Igor Sosa Mayor
  2022-01-10 12:27           ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Sosa Mayor @ 2022-01-09  0:35 UTC (permalink / raw)
  To: notmuch

Igor Sosa Mayor
<joseleopoldo1792@gmail.com> writes:

> David Bremner <david@tethera.net> writes:
>
>> Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:
>>
>>>>
>>>> I guess you mean that it overrides it in a buffer-local way, in
>>>> notmuch-message-mode? Or do you see some kind of global overiding going
>>>> on?
>>>>
>>>> d
>>>
>>> thanks for your reply. Yes, sorry for not being clear enough. I see in
>>> the code
>>>
>>>   (make-local-variable 'company-backends)
>>>   (setq company-backends '(notmuch-company))
>>>
>>> https://github.com/kootenpv/emp/blob/master/.emacs.d/notmuch/notmuch-company.el
>>
>> That's kind of an odd reference, since it seems to be some old copy of
>> our code, possibly mutated.
>
> yes, sorry. I think it was google who gave me the reference. I see in
> the present code there is
> (setq-local company-backends '(notmuch-company))
>
> https://git.notmuchmail.org/git?p=notmuch;a=blob;f=emacs/notmuch-company.el;h=7e05dc8f2a796aaf2c664fdcc4be63f6a443057f;hb=HEAD
>
>>> What is the best method to get the other backends back?
>>
>> I would try replacing the (setq company-backends '(notmuch-local)) with
>> (push 'notmuch-company company-backends)
>>

Just for the records in case someone in the future has the same problem.
This seems to work:

(defun my-notmuch-messagemode-hook ()
  (add-to-list 'company-backends '(company-ispell company-dabbrev) t)
  )
(add-hook 'notmuch-message-mode-hook 'my-notmuch-messagemode-hook)




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

* Re: Notmuch-Company overrides other company backends?
  2022-01-09  0:35         ` Igor Sosa Mayor
@ 2022-01-10 12:27           ` David Bremner
  0 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-01-10 12:27 UTC (permalink / raw)
  To: Igor Sosa Mayor, notmuch

Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:

>
> Just for the records in case someone in the future has the same problem.
> This seems to work:
>
> (defun my-notmuch-messagemode-hook ()
>   (add-to-list 'company-backends '(company-ispell company-dabbrev) t)
>   )
> (add-hook 'notmuch-message-mode-hook 'my-notmuch-messagemode-hook)

Glad you got it working. I'm not really clear on why the current code
uses setq-local as opposed to push, maybe someone more expert with
company-mode can comment on whether we should change it to preserve the
users company-backends by default.

d

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

end of thread, other threads:[~2022-01-10 12:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 18:28 Notmuch-Company overrides other company backends? Igor Sosa Mayor
2022-01-08 18:42 ` David Bremner
2022-01-08 19:02   ` Igor Sosa Mayor
2022-01-08 20:19     ` David Bremner
2022-01-08 21:17       ` Igor Sosa Mayor
2022-01-09  0:35         ` Igor Sosa Mayor
2022-01-10 12:27           ` David Bremner

Code repositories for project(s) associated with this inbox:

	notmuch.git.git (no URL configured)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).