Author Topic: Select or close non workspace buffer(s)  (Read 3996 times)

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
Select or close non workspace buffer(s)
« on: April 03, 2010, 04:25:59 pm »
oky,

I have been cooking a macro to help me quickly select and close files that are not related to current workspace.

It happens often i end up with several files open and must manually close each one or must close all and try to open what is important again, but this macro will help do it neatly.

This macro was not possible without the help of the wizard <Graeme> which i owe a lot of gratitude.

any updates are welcome.

This example is a good starter for dialog example handling.
« Last Edit: April 09, 2010, 04:54:42 pm by ehab »

Graeme

  • Senior Community Member
  • Posts: 2300
  • Hero Points: 302
Re: select or close non workspace buffer
« Reply #1 on: April 03, 2010, 11:01:18 pm »
Hi ehab

In close_buffers_nonworkspace, cycling round the buffer ring probably won't work because the call to _save_non_active modifies the buffer ring unpredictably.  You should probably use the for_each_buffer mechanism and make a list of the files you want to close.

Graeme

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
Re: Select or close non workspace buffer(s)
« Reply #2 on: April 06, 2010, 11:37:24 am »
updated and should be working.