Specifically this problem arises when working in LaTeX (auctex) for me, but I think it must have a general emacs solution.
To every doc.tex file, I have an associated and oft-edited doc.sty file in the same folder.
Is there a way that whenever I open the doc.tex file I can have emacs open the doc.sty file in that folder? I'm not proficient at all in elisp, so something very simple---it doesn't need to be robust code: it can work on the assumption that both files are named doc.* and that both exist.