]> git.eshelyaron.com Git - emacs.git/commit
comint-insert-previous-argument counts args from start or from end
authorDima Kogan <dima@secretsauce.net>
Sun, 25 Dec 2016 19:35:26 +0000 (11:35 -0800)
committerDima Kogan <dima@secretsauce.net>
Mon, 18 Jun 2018 05:58:46 +0000 (22:58 -0700)
commit74f377b3955198d6f66afa34bbbf6d004aad134a
tree20b81a85d4f8d25113618157795c6b600ca08e54
parent2d1b774dbc31b753527321ae1e441d5e424a5265
comint-insert-previous-argument counts args from start or from end

This function is invoked in shell-mode by the user, and is meant to
emulate what M-. does in zsh and bash: it inserts an argument from a
previous command.  Without a prefix argument, it inserts the last arg
from the previous command; with an argument INDEX, it inserts the
INDEX-th argument.  bash counts from the start, while zsh counts from
the end.  This patch adds a variable
`comint-insert-previous-argument-from-end' that emulates the zsh
behavior if non-nil.

* lisp/comint.el (comint-arguments): can take in negative arguments to count
  from the end, same as indexing in python.
  (comint-insert-previous-argument): if
  comint-insert-previous-argument-from-end is non-nil, INDEX counts
  arguments from the end; if nil, from the beginning
  (Bug#25271)
* etc/NEWS: Document this.
etc/NEWS
lisp/comint.el