diff --git a/config.org b/config.org index d44b000..ca912c3 100644 --- a/config.org +++ b/config.org @@ -1291,8 +1291,8 @@ (defun clang-format-region-or-buffer () "Format the region if it's active, otherwise format the entire buffer." (interactive) - (if (region-active-p) - (clang-format-region) + (if (use-region-p) + (clang-format-region (region-beginning) (region-end)) (clang-format-buffer))) #+end_src @@ -1302,7 +1302,7 @@ (add-hook 'c-mode-hook (lambda () - (define-key c-mode-map (kbd "C-M-f") + (define-key c-mode-map (kbd "C-c f") 'clang-format-region-or-buffer))) #+end_src