branch: externals/shell-command+ commit 7540f9809e3e88b19124958efa427e5fb0dbfefd Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Ensure that point gets placed after the replaced output --- shell-command+.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shell-command+.el b/shell-command+.el index 67a6866d51..2056a30b36 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -150,7 +150,8 @@ For PARSE, FORM and CONTEXT see `shell-command+-features'." (eq mode 'output) (eq mode 'input)) (lambda (input beg end) (delete-region beg end) - (shell-command input t shell-command-default-error-buffer))) + (shell-command input t shell-command-default-error-buffer) + (exchange-point-and-mark))) ((if shell-command+-flip-redirection (eq mode 'input) (eq mode 'output)) (lambda (input beg end) @@ -161,7 +162,8 @@ For PARSE, FORM and CONTEXT see `shell-command+-features'." (lambda (input beg end) (shell-command-on-region beg end input t t - shell-command-default-error-buffer t))) + shell-command-default-error-buffer t) + (exchange-point-and-mark))) (t form)) context))) @@ -528,10 +530,9 @@ can be combined but will be processed in the following order:" (setq parse (nth 0 step) form (nth 1 step) context (nth 2 step)))) - (save-excursion - (funcall context form (nth 3 parse) - (or beg (point-min)) - (or end (point-max)))))) + (funcall context form (nth 3 parse) + (or beg (point-min)) + (or end (point-max))))) (provide 'shell-command+)