Function: markdown-ts--table-abutting-pos

markdown-ts--table-abutting-pos is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts--table-abutting-pos POS)

Documentation

Adjust POS to abut its closest text.

If POS is already in a table, return POS. If not, adjust POS to the nearest non-blank character, looking first forward and then backward adjusting, if it is in a table, return the adjusted POS. Otherwise return nil, for example, if the line is empty.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--table-abutting-pos (pos)
  "Adjust POS to abut its closest text.
If POS is already in a table, return POS.  If not, adjust POS to the
nearest non-blank character, looking first forward and then backward
adjusting, if it is in a table, return the adjusted POS.  Otherwise
return nil, for example, if the line is empty."
  (save-excursion
    (goto-char pos)
    (if (markdown-ts--table-node-row nil pos)
        pos
      (skip-chars-forward "[[:blank:]]" (pos-eol))
      (if (markdown-ts--table-node-row)
          (point)
        (goto-char pos)
        (skip-chars-backward "[[:blank:]]" (pos-bol))
        (unless (eq (point) (pos-bol))
          (if (markdown-ts--table-node-row nil (1- (point)))
              (1- (point))))))))