Author Topic: Select or close non workspace buffer(s)  (Read 6933 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: 2796
  • Hero Points: 347
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.