1

I just got started with Emacs for around 1 week or so and I have the following question: can I make Auto Complete ignore a certain word (in a certain major mode)?

Concrete example: I was writing in a file in Org mode a sort of "tutorial" for my use and I wrote about the <sTAB command which inserts a code snippet. Now whenever I open a file in Org mode and write <s, it offers the completion.

As I prefer commiting completions with the TAB key, my only choice is to C-g the completion list and then TAB.

Moreover, I think that this could serve me well for other cases also. So is it possible to make auto-complete-mode always ignore a certain word in a certain major mode?

If it's difficult enough to implement, where can I find the actual list of completions which is created? I could visit it and erase <sTAB. I'll never write it again. :)

1 Answer 1

1

I think ac-stop-words will be what you are searching for.

cf. https://github.com/auto-complete/auto-complete/blob/master/doc/manual.md#stop-completion-automatically-after-inserting-specific-words

4
  • Thanks, I was looking for that, actually I read about the feature in the manual. But I was thinking that the stop words stop the service overall, just like disabling the minor mode. Will test and revert. Apr 3, 2017 at 4:27
  • Nope, doesn't work. I edited the example in the manual for the org-mode-hook, tried my "<s" word and even a general one like "this" but doesn't do anything, in fact. Maybe a bug. I'm thinking about switching to company, for other reasons as well. Apr 3, 2017 at 4:33
  • hmm..while you are switching, for the record, this variable seems to work. With "th" input pops candidates like "the" in my emacs org-mode, and setting (add-to-list 'ac-stop-words "th") makes it silent. ("<S" doesn't pops any candidates for me, maybe some ac-sources difference...?)
    – lurdan
    Apr 3, 2017 at 5:13
  • Alright. "th" doesn't work for me either. For ac-sources I have words-in-the-same-mode-buffers. I don't know, there may be other conflicting options in my init file, due to my lack of experience. But nevertheless, I'll be accepting the answer, since you helped me find the appropriate variable. Thanks! Apr 3, 2017 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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