0

I want to set a key binding for the following function: 'multi-occur-in-matching-buffers. This what I added to my .emacs:

(global-set-key (kbd "C-p") 'multi-occur-in-matching-buffers)

This works fine but I would like to have the default behaviour to look up in all the buffers. This is done by passing . as a default argument. How do I change the line in my config so it does that?

Gracias!

eaglefreeman
  • 824
  • 2
  • 9
  • 20
  • This question is not a duplicate as it is not asking how to search. It is asking how to pass arguments to a function which is being mapped. I believe the answer can be found in [this answer](http://stackoverflow.com/a/3434098/155299), but the questions are fundamentally different. – Randy Morris Mar 08 '17 at 14:37
  • I don't want it to be interactive. And my question is not necessarily about searching buffers but how to define a key-binding with a default argument. – eaglefreeman Mar 08 '17 at 15:23
  • 1
    It would have to be interactive though. If the function is non-interactive then it wouldn't be able to be bound to a key. Create an interactive wrapper function that sets the default values you want and passing the remainder to the original function. – Jonathan Leech-Pepin Mar 08 '17 at 16:49
  • I've marked this as a duplicate partly because the *intent* of the question is identical (a key binding to search all buffers for a given regexp), and partly because one of the answers to that question is *exactly* what was being asked for. If the question was a generic "how to define a key-binding which passes a default argument to some arbitrary function" it would not have been a duplicate of this (although IIRC there are duplicates for that question too), but this question was actually very specific. – phils Mar 08 '17 at 22:01

0 Answers0