Macros to make /petattack your default that can be cancelled
I expect most max-level hunters won't have a need for these macros, especially those who routinely like to focus cc targets.
But if you're say, leveling a hunter, and want to make /petattack your default, but one that can be cancelled if you join a bg or something, here is how to do it. You make two macros. Macro 1 is your main damage ability or some other ability you use all the time (I use chimera shot). The second is your pet passive macro.
Macro 1 makes it so, anytime you haven't set a focus target, your pet attacks your target when you use your damaging ability. So if you're out leveling and don't want to have to manually press /petattack every time you attack a new target, this does it for you. But if you decide to enter a bg and want to have your pet on passive most of the time, you just use macro 2 when you first acquire a target. You'll also need a /clearfocus macro to get rid of the previous focus, but I assume most hunters have one of those already.
The macro basically gives your pet a "memory" that he's never supposed to attack this particular target. If you're fighting a ret 1v1, for example, and you see he tries to attack your pet, you'll likely want to use the focus/passive macro and your pet will never attack him again unless you tell him otherwise. At the same time, some rets are focused on attacking you, not your pet, and you may find that you can "get away" with keeping your pet on him. So I like having /petattack as my default in 1v1 situations, until my opponent "proves" that he can benefit from attacking my pet. Even arena players may find it useful if they use arena1,2, and 3 to cc targets. I personally use focus macros to scatter trap in arena, so I wouldn't use this there, but to each his own.
Incidentally, the /stopmacro command is a very useful way to tailor your macros. For example, you can say /stopmacro [nocombat] at the start of the macro and everything below it will only occur if you are in combat. If you want to use a macro or a part of a macro that only works in arena, I seem to recall that /stopmacro [@arena1,exists] works as to parts of the macro below that line. There are other examples like /stopmacro [nogroup], which makes the part below the command only work if you are in a group.
Another macro trick if you have a macro that is too long is to use the /click command and make a second macro.
E.g. /click ActionButton8
And then put a macro on your eighth action bar - one I use for some macros is a burst command, e.g.:
/castsequence reset=1 !Aspect of the Dragonhawk,nul
/use [combat] Name of DPS trinket
/use [combat] Name of DPS potion
Just put that macro on your action button #8, add /click ActionButton8 to some separate macro, and you've given yourself a way around the character limit for macros. There are addons that perform that function, but I've found them to be unreliable.