Function: position-symbol

position-symbol is a function defined in data.c.

Signature

(position-symbol SYM POS)

Documentation

Create a new symbol with position.

SYM is a symbol, with or without position, the symbol to position. POS, the position, is either a fixnum or a symbol with position from which the position will be taken.

View in manual

Source Code

// Defined in /usr/src/emacs/src/data.c
{
  Lisp_Object bare;
  Lisp_Object position;

  if (BARE_SYMBOL_P (sym))
    bare = sym;
  else if (SYMBOL_WITH_POS_P (sym))
    bare = XSYMBOL_WITH_POS (sym)->sym;
  else
    wrong_type_argument (Qsymbolp, sym);

  if (FIXNUMP (pos))
    position = pos;
  else if (SYMBOL_WITH_POS_P (pos))
    position = XSYMBOL_WITH_POS (pos)->pos;
  else
    wrong_type_argument (Qfixnum_or_symbol_with_pos_p, pos);

  return build_symbol_with_pos (bare, position);
}