While setting up autocomplete in Emacs irb (inferior-ruby-mode), I ran into a problem of not being able to add only Ruby mode buffers as AC sources. I can eg. add files in the current directory by
(setq ac-sources '(ac-source-files-in-current-dir))
or I can add all buffers (which I resorted to in the end) by
(setq ac-sources '(ac-source-words-in-all-buffer))
but what I would really like is to only add Ruby mode buffers. ^^
look to
ac-source-words-in-same-mode-buffers… We can re-use this approach to build our own completion sources, for example:will give us
ac-source-words-in-ruby-bufferscompletion source.P.S. I hadn’t tested it, but it should work 😉