Hi Jan, I don't have a Vim solution for your problem, but I would suggest to pass the output of "vim -r" to a Gawk script, that can process it, and (using the "system" function) take whatever action you may wish to take, "automagically".
Antonio PS Here is a small MS-DOS example (messages are in Italian): d:\aca>vim -r|gawk " { print } " Swap file trovati: Nella directory in uso: 1. .hilldigr.old.swp datato: Sat Feb 08 00:42:02 2014 nome file: /d/aca/hilldigr.old modificato: no nome utente: azc10 nome computer: slj ID del processo: 5337 2. .hillgril.awk.swp datato: Sun Jul 27 21:18:38 2014 (...) On Thu, Feb 12, 2015 at 8:46 AM, Jan Larres <li...@majutsushi.net> wrote: > Hi, > > I am currently writing a plugin to handle existing swapfiles in a smart > way. > Unfortunately there is not much information about existing swapfiles > directly > available to plugins; as far as I can see only the filename is through the > v:swapname variable. Everything else that may be relevant like the pid of > the > process that is currently using the swapfile, or whether the file has been > modified since the last swapfile update, does not have similar > functionality > to access it. > > The information is available in the output of "vim -r", but this requires > spawing a new Vim process and parsing the output manually. It would be > handy > if this information were available for example with a function that takes a > filename as an argument and returns a dictionary with all of the relevant > information. If possible and available it could also return the servername > of > the appropriate Vim instance to help with sending commands to it. > > -Jan > > -- > -[ OpenPGP key ID: 00A0FD5F ]- > Travel is fatal to prejudice, bigotry, and narrow-mindedness, and many of > our people need it sorely on these accounts. > -- Mark Twain > > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- /||\ | Antonio Colombo / || \ | azc...@gmail.com / () \ | anto...@geekcorp.com (___||___) | az...@yahoo.com -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.