on the page:
brew cask install emacs
should be replaced with:
brew install --cask emacs
as the cask subcommand has been removed from homebrew, in favor of a --cask flag.
relevant commit removing the cask subcommand from the usage instructions on the official homebrew github:
2E69 E7FB 5F0E 1C0F 1D62 5C36 BA76 979F AA8D 36E6