summaryrefslogtreecommitdiff
path: root/lisp/newcomment.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-31 20:20:23 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-31 20:20:23 +0200
commit6a2cc870d23485a8f440a8b58768eefdf16c8912 (patch)
tree571ec8cc876017e5abeb94e77f6da7680b619877 /lisp/newcomment.el
parent89404b4f69f9677189b55d9914bccf3ba0ef0c18 (diff)
downloademacs-6a2cc870d23485a8f440a8b58768eefdf16c8912.tar.gz
Revert "Allow commenting out white space lines in latex-mode"
This reverts commit 0870ebb3cbfcb097d85eea5eacaf992dd88ed204. This was the wrong way to try to fix this -- see bug#55716.
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r--lisp/newcomment.el30
1 files changed, 9 insertions, 21 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 95adf9f90a1..385dd80beba 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -1235,33 +1235,21 @@ changed with `comment-style'."
;; FIXME: maybe we should call uncomment depending on ARG.
(funcall comment-region-function beg end arg)))
-(defun comment-region-default-1 (beg end &optional arg noadjust)
- "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."
+(defun comment-region-default-1 (beg end &optional arg)
(let* ((numarg (prefix-numeric-value arg))
(style (cdr (assoc comment-style comment-styles)))
(lines (nth 2 style))
(block (nth 1 style))
(multi (nth 0 style)))
- (if noadjust
- (when (bolp)
- (setq end (1- end)))
- ;; We use `chars' instead of `syntax' because `\n' might be
- ;; of end-comment syntax rather than of whitespace syntax.
- ;; sanitize BEG and END
- (goto-char beg)
- (skip-chars-forward " \t\n\r")
- (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")))
+ ;; We use `chars' instead of `syntax' because `\n' might be
+ ;; of end-comment syntax rather than of whitespace syntax.
+ ;; sanitize BEG and END
+ (goto-char beg) (skip-chars-forward " \t\n\r") (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)))
+ (if (>= beg end) (error "Nothing to comment"))
;; sanitize LINES
(setq lines