I'm trying to write a plugin that calls a function (icalendar-import-file)
which has the nasty side effect of opening between 1 and 3 buffers every time it is called, and sometimes I want to call it a whole bunch of times.
I can't even find a function that will list buffers without popping up a new buffer, which is a little frustrating.
As far as I can tell that defun (ical...
) doesn't return anything useful, so the two obvious solutions to me are to either: (1) set a variable to a list of buffers before I run the function, and then sweep through the buffers that exist after the function exits and delete the new ones, (something like save-excursion, but for buffers) or (2) somehow suppress the creation. It looks like ical...
is pretty heavily dependent on this, though, so I'm not sure that that's feasible.