How do I find the elisp code for the major mode in use in the current buffer?
major-mode will be set to a symbol describing the mode.
If the mode was written anytime in recent history, that symbol will be a function that activates the mode.
So you can simply "find" the major mode's code.
Or interactively, run M-x
describe-mode and click the link to the source file.