Skip to main content

Let'sthe case: Let's say I did a query-replace is foo1 with foo2, and now I want to query-replace foo2 with foo1.

In earlier versions of emacsIn earlier versions of emacs (emacs 24, and every other version I remember)(emacs 24, and every other version I remember), everyeach previous entry into query-replace canquery-replace could be accessed via up-arrow. Sothe up-arrow:

I used to go ESC-% ESC-% (query-replacequery-replace), up-arrow once up-arrow ** x1, it then shows ("foo2"), RETURNRETURN, then up-arrow 3 timesup-arrow x3 ("foo1"), RETURNRETURN.

In my new emacsIn my new Emacs (emacs 25)(emacs 25), up-arrow nowup-arrow gives me the entire previous query-replacequery-replace ("foo1 -> foo2"), instead of each field separately. 

So I've got to do a rather convoluted edit which involves putting either foo1 or foo2 onto the clipboard. e.g. put foo1 onto clip board (which involves many keystrokes if foo1 is long and complicated), 3 deletes (to remove the arrow and spaces), RETURN, ctrl-Y, RETURN.:

  • putting either foo1 or foo2 onto the clipboard. e.g. put foo1 onto clip board (which involves many keystrokes if foo1 is long and complicated)
  • 3 x delete (to remove the arrow and spaces),
  • RETURN ctrl-Y, RETURN.

I've no idea why emacs 25 "improved" query`query-replace up-arrow like that, but I find it a pain. 

Is there any way to get the old, simpler, query-replace up-arrow functionality?

Let's say I did a query-replace is foo1 with foo2, and now I want to query-replace foo2 with foo1.

In earlier versions of emacs (emacs 24, and every other version I remember), every previous entry into query-replace can be accessed via up-arrow. So I go ESC-% (query-replace), up-arrow once ("foo2"), RETURN, then up-arrow 3 times ("foo1"), RETURN.

In my new emacs (emacs 25), up-arrow now gives me the entire previous query-replace ("foo1 -> foo2"), instead of each field separately. So I've got to do a rather convoluted edit which involves putting either foo1 or foo2 onto the clipboard. e.g. put foo1 onto clip board (which involves many keystrokes if foo1 is long and complicated), 3 deletes (to remove the arrow and spaces), RETURN, ctrl-Y, RETURN.

I've no idea why emacs 25 "improved" query-replace up-arrow like that, but I find it a pain. Is there any way to get the old, simpler, query-replace up-arrow functionality?

the case: Let's say I did a query-replace is foo1 with foo2, and now I want to query-replace foo2 with foo1.

In earlier versions of emacs (emacs 24, and every other version I remember), each previous entry into query-replace could be accessed via the up-arrow:

I used to go ESC-% (query-replace), up-arrow ** x1, it then shows ("foo2"), RETURN, then up-arrow x3 ("foo1"), RETURN.

In my new Emacs (emacs 25), up-arrow gives me the entire previous query-replace ("foo1 -> foo2"), instead of each field separately. 

So I've got to do a rather convoluted edit which involves:

  • putting either foo1 or foo2 onto the clipboard. e.g. put foo1 onto clip board (which involves many keystrokes if foo1 is long and complicated)
  • 3 x delete (to remove the arrow and spaces),
  • RETURN ctrl-Y, RETURN.

I've no idea why emacs 25 "improved" `query-replace up-arrow like that, but I find it a pain. 

Is there any way to get the old, simpler, query-replace up-arrow functionality?

Source Link
Peter B
  • 181
  • 4

How do I get the old query-replace up-arrow functionality back?

Let's say I did a query-replace is foo1 with foo2, and now I want to query-replace foo2 with foo1.

In earlier versions of emacs (emacs 24, and every other version I remember), every previous entry into query-replace can be accessed via up-arrow. So I go ESC-% (query-replace), up-arrow once ("foo2"), RETURN, then up-arrow 3 times ("foo1"), RETURN.

In my new emacs (emacs 25), up-arrow now gives me the entire previous query-replace ("foo1 -> foo2"), instead of each field separately. So I've got to do a rather convoluted edit which involves putting either foo1 or foo2 onto the clipboard. e.g. put foo1 onto clip board (which involves many keystrokes if foo1 is long and complicated), 3 deletes (to remove the arrow and spaces), RETURN, ctrl-Y, RETURN.

I've no idea why emacs 25 "improved" query-replace up-arrow like that, but I find it a pain. Is there any way to get the old, simpler, query-replace up-arrow functionality?