Function: cua-set-mark

cua-set-mark is an interactive and byte-compiled function defined in cua-base.el.gz.

Signature

(cua-set-mark &optional ARG)

Documentation

Set mark at where point is, clear mark, or jump to mark.

With no prefix argument, clear mark if already set. Otherwise, set mark, and push old mark position on local mark ring; also push mark on global mark ring if last mark was set in another buffer.

With argument, jump to mark, and pop a new position for mark off the local mark ring (this does not affect the global mark ring). Use C-x C-@ (pop-global-mark) to jump to a mark off the global mark ring
(see pop-global-mark).

If cua-auto-mark-last-change is non-nil, this command behaves as if there was an implicit mark at the position of the last buffer change.

Repeating the command without the prefix jumps to the next position off the local (or global) mark ring.

With a double C-u (universal-argument) prefix argument, unconditionally set mark.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/cua-base.el.gz
(defun cua-set-mark (&optional arg)
  "Set mark at where point is, clear mark, or jump to mark.

With no prefix argument, clear mark if already set.  Otherwise, set
mark, and push old mark position on local mark ring; also push mark on
global mark ring if last mark was set in another buffer.

With argument, jump to mark, and pop a new position for mark off
the local mark ring (this does not affect the global mark ring).
Use \\[pop-global-mark] to jump to a mark off the global mark ring
\(see `pop-global-mark').

If `cua-auto-mark-last-change' is non-nil, this command behaves as if there
was an implicit mark at the position of the last buffer change.

Repeating the command without the prefix jumps to the next position
off the local (or global) mark ring.

With a double \\[universal-argument] prefix argument, unconditionally set mark."
  (interactive "P")
  (cond
   ((and (consp arg) (> (prefix-numeric-value arg) 4))
    (push-mark-command nil))
   ((eq last-command 'pop-to-mark-command)
    (setq this-command 'pop-to-mark-command)
    (pop-to-mark-command))
   ((and (eq last-command 'pop-global-mark) (not arg))
    (setq this-command 'pop-global-mark)
    (pop-global-mark))
   (arg
    (setq this-command 'pop-to-mark-command)
    (or (and cua-auto-mark-last-change
	     (cua-pop-to-last-change))
	(pop-to-mark-command)))
   ((and cua-toggle-set-mark (region-active-p))
    (cua--deactivate)
    (message "Mark cleared"))
   (t
    (push-mark-command nil nil)
    (if cua-enable-region-auto-help
	(cua-help-for-region t)))))