Function: org-table-header-set-header

org-table-header-set-header is a byte-compiled function defined in org-table.el.gz.

Signature

(org-table-header-set-header)

Documentation

Display the header of the table at point.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun org-table-header-set-header ()
  "Display the header of the table at point."
  (let ((gcol temporary-goal-column))
    (unwind-protect
        (progn
          (when (overlayp org-table-header-overlay)
            (delete-overlay org-table-header-overlay))
          ;; We might be called after scrolling but before display is
          ;; updated. Make sure that any queued redisplay is executed
          ;; before we look into `window-start'.
          (redisplay)
          (let* ((ws (window-start))
                 (beg (save-excursion
                        ;; Check table at window start, not at point.
                        ;; Point might be after the table, or at
                        ;; another table located below the one visible
                        ;; on top.
                        (goto-char ws)
                        (goto-char (org-table-begin))
                        (while (or (org-at-table-hline-p)
                                   (looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>"))
                          (move-beginning-of-line 2))
                        (line-beginning-position))))
            (if (pos-visible-in-window-p beg)
                (when (overlayp org-table-header-overlay)
                  (delete-overlay org-table-header-overlay))
              (setq org-table-header-overlay
                    (make-overlay
                     (save-excursion (goto-char ws) (line-beginning-position))
                     (save-excursion (goto-char ws) (line-end-position))))
              (org-overlay-display
               org-table-header-overlay
               (org-table-row-get-visible-string beg)
               'org-table-header))))
      (setq temporary-goal-column gcol))))