If I'm understanding you right, you're trying to make a keybinding that will act like you typed C-u M-x grep <ENTER>
. Try this:
(global-set-key (kbd "C-c m g")
(lambda () (interactive)
(setq current-prefix-arg '(4)) ; C-u
(call-interactively 'grep)))
Although I would probably make a named function for this:
(defun grep-with-prefix-arg ()
(interactive)
(setq current-prefix-arg '(4)) ; C-u
(call-interactively 'grep))
(global-set-key (kbd "C-c m g") 'grep-with-prefix-arg)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…