Function: vera-get-offset

vera-get-offset is a byte-compiled function defined in vera-mode.el.gz.

Signature

(vera-get-offset LANGELEM)

Documentation

Get offset from LANGELEM which is a cons cell of the form:
(SYMBOL . RELPOS). The symbol is matched against
vera-offsets-alist and the offset found there is either returned, or added to the indentation at RELPOS. If RELPOS is nil, then the offset is simply returned.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vera-mode.el.gz
(defun vera-get-offset (langelem)
  "Get offset from LANGELEM which is a cons cell of the form:
\(SYMBOL . RELPOS).  The symbol is matched against
vera-offsets-alist and the offset found there is either returned,
or added to the indentation at RELPOS.  If RELPOS is nil, then
the offset is simply returned."
  (let* ((symbol (car langelem))
	 (relpos (cdr langelem))
	 (match  (assq symbol vera-offsets-alist))
	 (offset (cdr-safe match)))
    (if (not match)
	(setq offset 0
	      relpos 0)
      (setq offset (vera-evaluate-offset offset langelem symbol)))
    (+ (if (and relpos
		(< relpos (line-beginning-position)))
	   (save-excursion
	     (goto-char relpos)
	     (current-column))
	 0)
       (vera-evaluate-offset offset langelem symbol))))