mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 18:41:25 -08:00
Revert "Allow commenting out white space lines in latex-mode"
This reverts commit 0870ebb3cb.
This was the wrong way to try to fix this -- see bug#55716.
This commit is contained in:
parent
89404b4f69
commit
6a2cc870d2
2 changed files with 10 additions and 27 deletions
|
|
@ -1235,33 +1235,21 @@ changed with `comment-style'."
|
||||||
;; FIXME: maybe we should call uncomment depending on ARG.
|
;; FIXME: maybe we should call uncomment depending on ARG.
|
||||||
(funcall comment-region-function beg end arg)))
|
(funcall comment-region-function beg end arg)))
|
||||||
|
|
||||||
(defun comment-region-default-1 (beg end &optional arg noadjust)
|
(defun comment-region-default-1 (beg end &optional arg)
|
||||||
"Comment region between BEG and END.
|
|
||||||
See `comment-region' for ARG. If NOADJUST, do not skip past
|
|
||||||
leading/trailing space when determining the region to comment
|
|
||||||
out."
|
|
||||||
(let* ((numarg (prefix-numeric-value arg))
|
(let* ((numarg (prefix-numeric-value arg))
|
||||||
(style (cdr (assoc comment-style comment-styles)))
|
(style (cdr (assoc comment-style comment-styles)))
|
||||||
(lines (nth 2 style))
|
(lines (nth 2 style))
|
||||||
(block (nth 1 style))
|
(block (nth 1 style))
|
||||||
(multi (nth 0 style)))
|
(multi (nth 0 style)))
|
||||||
|
|
||||||
(if noadjust
|
;; We use `chars' instead of `syntax' because `\n' might be
|
||||||
(when (bolp)
|
;; of end-comment syntax rather than of whitespace syntax.
|
||||||
(setq end (1- end)))
|
;; sanitize BEG and END
|
||||||
;; We use `chars' instead of `syntax' because `\n' might be
|
(goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line)
|
||||||
;; of end-comment syntax rather than of whitespace syntax.
|
(setq beg (max beg (point)))
|
||||||
;; sanitize BEG and END
|
(goto-char end) (skip-chars-backward " \t\n\r") (end-of-line)
|
||||||
(goto-char beg)
|
(setq end (min end (point)))
|
||||||
(skip-chars-forward " \t\n\r")
|
(if (>= beg end) (error "Nothing to comment"))
|
||||||
(beginning-of-line)
|
|
||||||
(setq beg (max beg (point)))
|
|
||||||
(goto-char end)
|
|
||||||
(skip-chars-backward " \t\n\r")
|
|
||||||
(end-of-line)
|
|
||||||
(setq end (min end (point)))
|
|
||||||
(when (>= beg end)
|
|
||||||
(error "Nothing to comment")))
|
|
||||||
|
|
||||||
;; sanitize LINES
|
;; sanitize LINES
|
||||||
(setq lines
|
(setq lines
|
||||||
|
|
|
||||||
|
|
@ -1178,12 +1178,7 @@ subshell is initiated, `tex-shell-hook' is run."
|
||||||
(setq-local outline-regexp latex-outline-regexp)
|
(setq-local outline-regexp latex-outline-regexp)
|
||||||
(setq-local outline-level #'latex-outline-level)
|
(setq-local outline-level #'latex-outline-level)
|
||||||
(setq-local forward-sexp-function #'latex-forward-sexp)
|
(setq-local forward-sexp-function #'latex-forward-sexp)
|
||||||
(setq-local skeleton-end-hook nil)
|
(setq-local skeleton-end-hook nil))
|
||||||
(setq-local comment-region-function #'latex--comment-region)
|
|
||||||
(setq-local comment-style 'plain))
|
|
||||||
|
|
||||||
(defun latex--comment-region (beg end &optional arg)
|
|
||||||
(comment-region-default-1 beg end arg t))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-derived-mode slitex-mode latex-mode "SliTeX"
|
(define-derived-mode slitex-mode latex-mode "SliTeX"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue