indent-line-function is a variable defined in ‘indent.el’. ... Setting this function is all you need to make TAB indent appropriately. ...