When I double-click on a window in Aquamacs, it keeps the same width but maximises its height. A second double-click maximises the width as well. A third double-click returns it to its original size and position.
I would like to tell Aquamacs (http://aquamacs.org) to act more like an ordinary Mac app, so the intermediate step with the height is omitted, and a second double-click will restore the window to the original size.
A sort of work around is to use the green button at the top left of the window, taking the window to its own space, which is usually not ideal.
I can write Emacs Lisp routines to manipulate windows (a.k.a. "frames" in Aquamacs and Emacs), but I don't know how to get Emacs to run my elisp routine on the title bar double click.
Unlike a lot of user actions in Aquamacs, typing control-H control-K before the double click does not give me help on the action. So I have done some searching on the net and in the Aquamacs help. I have looked through the Preferences, options, and Customise as well. Having said that, there are a lot of things there, and I may have missed the answer.
I suspect a solution will be in the C or Objective-C source code rather than the elisp code. I suppose I can hunt through the source code to find out how to change this, but I hope I can ask for help at Ask Different.
I have Aquamacs 3.2 and macOS Sierra 10.2.3. I've also tried on some different Macs with slight version variations.