But then I noticed this comment in 'query-replace': ;; These are done separately here ;; so that command-history will record these expressions ;; rather than the values they had this time. And indeed this patch broke this feature, so region boundaries are saved as numbers in command-history for repeat-complex-command instead of such code: C-x M-: (query-replace "a" "z" nil (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) nil nil) But anyway this feature was broken by design and never worked: with a compiled replace.el it saves region boundaries as numbers, and only when 'query-replace' is manually evaluated with 'eval-defun', only then region boundaries are saved as code to command-history. So we could just delete 'fix_command' from callint.c, and don't worry about such cases.