Function: org-table--make-shrinking-overlay

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

Signature

(org-table--make-shrinking-overlay START END DISPLAY FIELD &optional PRE)

Documentation

Create an overlay to shrink text between START and END.

Use string DISPLAY instead of the real text between the two buffer positions. FIELD is the real contents of the field, as a string, or nil. It is meant to be displayed upon moving the mouse onto the overlay.

When optional argument PRE is non-nil, assume the overlay is located at the beginning of the field, and prepend org-table--separator-space-pre to it. Otherwise, concatenate org-table-shrunk-column-indicator at its end.

Return the overlay.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun org-table--make-shrinking-overlay (start end display field &optional pre)
  "Create an overlay to shrink text between START and END.

Use string DISPLAY instead of the real text between the two
buffer positions.  FIELD is the real contents of the field, as
a string, or nil.  It is meant to be displayed upon moving the
mouse onto the overlay.

When optional argument PRE is non-nil, assume the overlay is
located at the beginning of the field, and prepend
`org-table--separator-space-pre' to it.  Otherwise, concatenate
`org-table-shrunk-column-indicator' at its end.

Return the overlay."
  (let ((show-before-edit
	 (lambda (o &rest _)
	   ;; Removing one overlay removes all other overlays in the
	   ;; same column.
	   (mapc #'delete-overlay
		 (cdr (overlay-get o 'org-table-column-overlays)))))
	(o (make-overlay start end)))
    (overlay-put o 'insert-behind-hooks (list show-before-edit))
    (overlay-put o 'insert-in-front-hooks (list show-before-edit))
    (overlay-put o 'modification-hooks (list show-before-edit))
    (overlay-put o 'org-overlay-type 'table-column-hide)
    (when (stringp field) (overlay-put o 'help-echo field))
    ;; Make sure overlays stays on top of table coordinates overlays.
    ;; See `org-table-overlay-coordinates'.
    (overlay-put o 'priority 1)
    (let ((d (if pre (concat org-table--separator-space-pre display)
	       (concat display org-table-shrunk-column-indicator))))
      (org-overlay-display o d 'org-table t))
    o))