>> Neither one is very good. However, to do any better >> we would need to maintain a separate history of pairs to suggest. >> This would be disconnected from the history list of strings. > > This patch should implement this behavior. > > + (defvar query-replace-defaults nil > + "Default values of FROM-STRING and TO-STRING for `query-replace'. > + This is a cons cell (FROM-STRING . TO-STRING), or nil if there is > + no default value.")
What about having a list of cons cells (FROM-STRING . TO-STRING) of all previous replacements and using new keys (e.g. M-P and M-N) to access previous/next replacements pairs from the replacement pair history? > ! (if (and (zerop (length from)) query-replace-defaults) > (progn > (set query-replace-from-history-variable > (cdr (symbol-value query-replace-from-history-variable))) We don't need this `set' anymore. -- Juri Linkov http://www.jurta.org/emacs/ _______________________________________________ emacs-pretest-bug mailing list [email protected] http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
