Function: orgtbl-toggle-comment
orgtbl-toggle-comment is an interactive and byte-compiled function
defined in org-table.el.gz.
Signature
(orgtbl-toggle-comment)
Documentation
Comment or uncomment the orgtbl at point.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun orgtbl-toggle-comment ()
"Comment or uncomment the orgtbl at point."
(interactive)
(let* ((case-fold-search t)
(re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp))
(re2 (concat "^" orgtbl-line-start-regexp))
(commented (save-excursion (forward-line 0)
(cond ((looking-at re1) t)
((looking-at re2) nil)
(t (user-error "Not at an org table")))))
(re (if commented re1 re2))
beg end)
(save-excursion
(forward-line 0)
(while (and (not (eq (point) (point-min)))
(looking-at re))
(forward-line -1))
(unless (eq (point) (point-min)) (forward-line 1))
(setq beg (point))
(while (and (not (eq (point) (point-max)))
(looking-at re))
(forward-line 1))
(setq end (point)))
(comment-region beg end (if commented '(4) nil))))