How to define a command that works on the selected region in Emacs Lisp? Sep 21, 2023 (defun command-on-region (beg end) "..." (interactive "r") (message "beg: %s\nend: %s" beg end) (deactivate-mark)) (global-set-key (kbd "C-<f1>") #'command-on-region)