Hi Ron, tab completion is controlled by the cmd.auto_arg variable, which is a list of dictionaries.
http://pymolwiki.org/index.php/auto_arg For all arguments which do not have an entry in auto_arg, the default is to auto-complete file names. For your purpose you need to define something like this: python import glob cmd.auto_arg[0]['save'] = [ lambda: cmd.Shortcut(cmd.get_names() + glob.glob('*')), 'filename or object name', ''] python end Cheers, Thomas Ron Jacak wrote, On 10/17/12 22:25: > PyMOL-users, > > I'm wondering if there's a way to make the tab completion engine use > the currently loaded (or visible) object names rather than (or in > addition to) the files in the filesystem? I usually have sessions > with very long object names that I want to include in custom selection > expressions and the tab completion doesn't work because oftentimes the > PDB files are not in the same directory as the session. I found the > function complete() in modules/pymol/parsing.py that seems to be what > figures out how to complete the command that's been entered. I think > if I just added a list of the currently loaded objects to the list > obtained by globbing the filesystem, it would do what I'm looking for. > Any ideas on the best way to do that? > > Best, > -Ron -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net