First, look at TeX-command-list to ensure that it has an entry for latexmk. If not, you need to add a line to this variable to allow the executable to be invoked by Auctex; unfortunately this variable is not well-documented (see the manual); I explain a little later.
Second, the default program is specified by the variable TeX-command-default. Change this to the identifier used by TeX-command-list, that is, the string just before the specification of the latexmk command.
E.g., if one of the elements in TeX-command-list is shown (which you can see using C-h v):
("Latex Make" "latexmk %(-pdf) %t" TeX-run-TeX)
then TeX-command-default needs to be "Latex Make".
The Auctex variable TeX-command-default
This variable isn't, as I said, well-documented. It should be a list of lists, each of which takes the form:
'("Handle" "external-command %(switches) %(arguments)" Auctex-handler)
where Handle introduces a handle for facility to be run from the C-c C-c dialog, so the list of handles in TeX-command-default is the list of possible completions at this prompt. The second option is a form specifying the executable to be run, and Auctex-handler is an Elisp function that handles the process and invokes the external command. TeX-run-TeX and TeX-run-command are the most common handlers, but there are special handlers for Bibtex, the spell checkers, etc.
AUCTeX Group->TeX Command->TeX Command ListI added (at the beginning of the list) an entry namedLaTeXmkwith commandlatexmk -pdf %tand valueTeX-run-command. Then, afterC-c C-cI could typeLaTeXmkand it ran the right script and produced the right result. How can I make it the default? Assign a some key shortcut? – Dror Feb 09 '11 at 08:43AUCTeX Group->TeX Command... – Dror Feb 09 '11 at 12:11H-v?C-h v? – SabreWolfy Dec 15 '12 at 23:51TeX-run-commandandTeX-run-TeX?%(-pdf)(doesn't work for me) and just-pdfby itself (which works)? How do I get latexmk to jump to an error in my document like the other commands do? – Andrew Mao Jan 10 '13 at 19:35