I have tried to search Google and look in the manual, but still cannot find how to get major mode of a buffer object. Can you help me with an example or a reference. Thank
Another way, apart from directly readind the major-mode variable would be by directly readind the mode-name variable.
major-mode
mode-name