Function: org-num--make-overlay

org-num--make-overlay is a byte-compiled function defined in org-num.el.gz.

Signature

(org-num--make-overlay NUMBERING LEVEL SKIP)

Documentation

Return overlay for numbering headline at point.

NUMBERING is the numbering to use, as a list of integers, or nil if nothing should be displayed. LEVEL is the level of the headline. SKIP is its skip value.

Assume point is at a headline.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-num.el.gz
(defun org-num--make-overlay (numbering level skip)
  "Return overlay for numbering headline at point.

NUMBERING is the numbering to use, as a list of integers, or nil
if nothing should be displayed.  LEVEL is the level of the
headline.  SKIP is its skip value.

Assume point is at a headline."
  (let ((after-edit-functions
         (list (lambda (o &rest _) (org-num--invalidate-overlay o))))
        (o (save-excursion
             (forward-line 0)
             (skip-chars-forward "*")
             (make-overlay (line-beginning-position) (1+ (point))))))
    (overlay-put o 'org-num t)
    (overlay-put o 'skip skip)
    (overlay-put o 'level level)
    (overlay-put o 'numbering-face
                 (or org-num-face
                     ;; Compute face that would be used at the
                     ;; headline.  We cannot extract it from the
                     ;; buffer: at the time the overlay is created,
                     ;; Font Lock has not proceeded yet.
                     (nth (if org-cycle-level-faces
                              (% (1- level) org-n-level-faces)
                            (1- (min level org-n-level-faces)))
                          org-level-faces)))
    (overlay-put o 'modification-hooks after-edit-functions)
    (overlay-put o 'insert-in-front-hooks after-edit-functions)
    (org-num--refresh-display o numbering)
    o))