You can open two Arduino IDE windows, and use Tools / Board to set each of them to one of the two kinds of boards you are programming. Ie, you can have multiple IDE windows open, with different options selected in each. I've programmed an Uno and a Nano device with the same program from two different windows simultaneously (ie, RX lights blinking on both boards at the same time) without problems.
You can use one USB cable and one port, or can use a separate USB cable for each window. You might need to use Tools / Port occasionally if the port number changes when you recable things.
I have the external editor option selected. Text in each Arduino IDE window updates when I click Verify or Load, rather than each time I save the file in emacs. I don't know how it works if you aren't using an external editor and have the same file open in two IDE windows.