C-c %
跑
TeX-comment-or-uncomment-paragraph
. 关于此处的段落,请参见
manual
:
命令:
tex注释或取消注释段落
(
C-C%
)添加或删除
%
从当前段落中每行的开头开始。拆卸时
%
字符段被认为由前面和后面的所有行组成,以
%
,直到第一行非注释。
这里有一个评论功能,可以或多或少地满足您的需求。取消环境注释仅在以下情况下有效
LaTeX-syntactic-comments
是
t
(即使那样也不总是很好)。
(defun LaTeX-comment-environment-or-line (arg)
"Comment or uncomment the current line.
If the current line is the \\begin or \\end line of an environment, comment
or uncomment the whole environment."
(interactive "*P")
(save-match-data
(save-excursion
(beginning-of-line)
(cond
((looking-at (concat "\\s-*\\(" TeX-comment-start-regexp "\\)?\\s-*"
(regexp-quote TeX-esc) "begin"))
(let ((begin (point)))
(goto-char (match-end 0))
(LaTeX-find-matching-end)
(TeX-comment-or-uncomment-region begin (point) arg)))
((looking-at (concat "\\s-*\\(" TeX-comment-start-regexp "\\)?\\s-*"
(regexp-quote TeX-esc) "end"))
(let ((end (save-excursion (end-of-line) (point))))
(LaTeX-find-matching-begin)
(beginning-of-line)
(TeX-comment-or-uncomment-region (point) end arg)))
(t
(TeX-comment-or-uncomment-region
(point) (save-excursion (end-of-line) (point)) arg))))))