
Your hand movements are probably really fast and interesting for a pup. How old is he? Unless it has been taught to be a certain command 'No' doesn't mean anything to a pup, and if you use it all the time he probably just thinks it's an every day noise.
The grabbing your ankles and trousers is probably also something that looks like a really fun game to him! My pup (a ten week old GSD) does the same thing and I simply stop dead in my tracks, or distract him with a toy if there is one to hand (my pockets now regularly have 'N]'ylabones and soft toys in them! lol) and I can already notice a major difference after doing this just a few times. The trousers flapping about must be so exciting for a young pup so if you stop dead and make them as uninteresting as possible to him, he'll soon learn that they're boring.
Unless there are obvious signs of aggression I would say that your pup isn't being aggressive or feeling threatened, simply getting over-worked from trying to dig into the sofa and then losing his self control that he has been taught earlier. In the future, instead of letting the digging behaviour escalate to a point he gets out of control, try to notice the signs that he is about to do it and distract him with a high pitched voice or a toy.