Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to provide a "double prefix argument" programmatically?

Tags:

emacs

In some code, I want to set the mark.

The documentation for set-mark-command says,

With C-u C-u as prefix argument, unconditionally set mark where point is.

So how do I call set-mark-command in this way?

EDIT: I see I should be using push-mark instead, in this particular case. But the general question of how to provide a double-prefix argument programmatically remains.

like image 515
Matt Avatar asked Mar 21 '23 08:03

Matt


1 Answers

Like this:

(set-mark-command '(16))

Small explanation to find this info:

  1. f1 f set-mark-command
  2. jump to definition in simple.el from the *Help* window.
  3. C-uC-M-x will call eval-defun with a prefix argument, which instruments the code for debugging when the function is called.
  4. C-u C-u M-x set-mark-command.
  5. You should now be in the debugger. e arg will give (16).
like image 121
abo-abo Avatar answered Apr 02 '23 07:04

abo-abo