Function: capitalize-dwim

capitalize-dwim is an interactive and byte-compiled function defined in simple.el.gz.

Signature

(capitalize-dwim ARG)

Documentation

Capitalize words in the region, if active; if not, capitalize word at point.

If the region is active, this function calls capitalize-region. Otherwise, it calls capitalize-word, with prefix argument passed to it to capitalize ARG words.

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun capitalize-dwim (arg)
  "Capitalize words in the region, if active; if not, capitalize word at point.
If the region is active, this function calls `capitalize-region'.
Otherwise, it calls `capitalize-word', with prefix argument passed to it
to capitalize ARG words."
  (interactive "*p")
  (if (use-region-p)
      (capitalize-region (region-beginning) (region-end) (region-noncontiguous-p))
    (capitalize-word arg)))