The simplest way I know to debug the current Python script is: 1. Copy the name of the current file (C-x C-j C-0 w) 2. M-x pdb RET yank RET (possibly after deleting previous file name) This seems like a good place to introduce a "future history" operation. The attached patch does so, via a new optional argument to gud-query-cmdline. The above then simplifies to M-x pdb RET M-n RET. Existing behavior is unchanged. I added the same feature to other gdb commands for which it seemed to make sense (perldb, guiler). Feedback or other suggestions would be welcome.