Hi Bram, On Mon, Jul 18, 2016 at 2:11 PM, Bram Moolenaar <[email protected]> wrote: > > Yegappan Lakshmanan wrote: > >> >> >> >> I am attaching a patch to add the following functions to store and >> >> retrieve a context from a location/quickfix list: >> >> >> >> Let me know if you have any comments/suggestions on these functions. >> > >> > Since you ask: in my opinion this is designed from the perspective >> > of a Vim's patcher, not from that of a Vim's user. The "ancillary" data >> > should be a special field in the location/quickfix list, and it should >> > be accessible as such, not through special getters and setters. >> > >> >> The 'ancillary' data is a special field in the internal location/quickfix >> list. >> >> Are you looking for setting the context using the setqflist() and >> setloclist() functions? These functions can be extended to take >> the context. >> >> But it will be difficult to extend the getqflist() function to return the >> context though. The getqflist() function currently returns a list. >> I am not sure how to extend this function to return the entries and >> context without breaking backward compatibility. > > The number of commands and functions for quickfix functionality keeps > growing. It would be good to reduce this a bit. > > getqflist() currently does not take an argument. It could use an > argument to specify what to get, instead of the whole list. > So how about passing a dictionary? One of the items could be to get the > aux data instead of the list of errors. >
What about adding a optional 'detail' flag to getqflist()? When this flag is specified, it returns a dictionary with the following items: 1. title - Quickfix title 2. nr - Quickfix list number (in the quickfix stack) 3. items - List of quickfix entries 4. context - Context information set by setqflist() Another alternative is to pass a dictionary (as you suggested) with the following items: 1. title:1 2. context:1 3. items:1 4. nr:1 5. all:1 > > For setqflist() it's a bit more tricky, since it already has a second > "action" argument. But we can add the dictionary as the third argument. > Yes. The dictionary can contain the following items: 1. title - Quickfix title 2. context - Context information (can be any Vim variable type) > > Perhaps getting and setting the quickfix title would also fit in here? > > And it allows for the filtering that we had a patch for? > As we have ex commands for creating and managing the quickfix entries, I think the filtering functionality should have an ex command instead of a function. - Yegappan > > Would be good to get an overview before making more changes. > -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
