This macro will revive your pet if it's dead or you hold down shift, call it if it's dismissed, mend it if it's alive, feed it if you press alt at the same time and dismiss it if you right click the button.
#show [modifier:alt] Mutton Chop
/cast [nopet] Call Pet
/cast [@pet,dead][mod:shift] Revive Pet
/cast [pet,nomod,button:1] Mend Pet
/cast [pet,nomod,button:2] Dismiss Pet
/cast [pet,mod:alt] Feed Pet
/use [pet,mod:alt] <food item>