Subject: bug#24873: 26.0.50; isearch-query-replace from regexp isearch doesn't add to replace-regexp history list

From: Noam Postavsky <[email-masked]>
Date: Fri, 4 Nov 2016 20:58:27 -0400

On Fri, Nov 4, 2016 at 8:34 PM, Mark Oteiza <[email-masked]> wrote:
> Does the following fix it for you?
>
> diff --git a/lisp/replace.el b/lisp/replace.el
> index 4fc48d4..60948ef 100644
> --- a/lisp/replace.el
> +++ b/lisp/replace.el
> @@ -198,7 +198,7 @@ query-replace-read-from
>                      (setq-local text-property-default-nonsticky
>                                  (cons '(separator . t) text-property-default-nonsticky)))
>                  (if regexp-flag
> -                    (read-regexp prompt)
> +                    (read-regexp prompt nil 'minibuffer-history)

I think you need make minibuffer-history into a dynamic variable for
this to work.