Function: abbrev-prefix-mark

abbrev-prefix-mark is an interactive and byte-compiled function defined in abbrev.el.gz.

Signature

(abbrev-prefix-mark &optional ARG)

Documentation

Mark point as the beginning of an abbreviation.

The abbrev to be expanded starts at point rather than at the beginning of a word. This way, you can expand an abbrev with a prefix: insert the prefix, use this command, then insert the abbrev.

This command inserts a hyphen after the prefix, and if the abbrev is subsequently expanded, this hyphen will be removed.

If the prefix is itself an abbrev, this command expands it, unless ARG is non-nil. Interactively, ARG is the prefix argument.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/abbrev.el.gz
(defun abbrev-prefix-mark (&optional arg)
  "Mark point as the beginning of an abbreviation.
The abbrev to be expanded starts at point rather than at the
beginning of a word.  This way, you can expand an abbrev with
a prefix: insert the prefix, use this command, then insert the
abbrev.

This command inserts a hyphen after the prefix, and if the abbrev
is subsequently expanded, this hyphen will be removed.

If the prefix is itself an abbrev, this command expands it,
unless ARG is non-nil.  Interactively, ARG is the prefix
argument."
  (interactive "P")
  (or arg (expand-abbrev))
  (setq abbrev-start-location (point-marker)
	abbrev-start-location-buffer (current-buffer))
  (insert "-"))