These patches come from http://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00520.html There are two patches to fix some deficiencies in comint-insert-previous-argument: 1. a prefix argument to comint-insert-previous-argument inserts the INDEX-th argument, not just the last one. bash counts from the beginning of the argument list, but zsh counts from the end. A new variable is added to allow the user to choose the zsh behavior 2. comint-insert-previous-argument had logic to find trailing &, which was buggy and got confused if && was encountered. This logic is not present in bash or zsh, so it was removed, and the bug went away with it.