From 2720770c5821135393676ef26924a20afac340cd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 4 Mar 2004 19:20:35 +0000 Subject: [PATCH] (uncomment-region): Allow non-terminated comment. --- lisp/newcomment.el | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 91943503f5e..9f0aeabe21f 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1,6 +1,6 @@ ;;; newcomment.el --- (un)comment regions of buffers -;; Copyright (C) 1999,2000,2003 Free Software Foundation Inc. +;; Copyright (C) 1999,2000,2003,2004 Free Software Foundation Inc. ;; Author: code extracted from Emacs-20's simple.el ;; Maintainer: Stefan Monnier @@ -716,35 +716,9 @@ comment markers." ;; Find the end of the comment. (ept (progn (goto-char spt) - (unless - (or - (comment-forward) - ;; Allow eob as comment-end instead of \n. - (and - (eobp) - (let ((s1 (aref (syntax-table) (char-after spt))) - (s2 (aref (syntax-table) - (or (char-after (1+ spt)) 0))) - (sn (aref (syntax-table) ?\n)) - (flag->b (car (string-to-syntax "> b"))) - (flag-1b (car (string-to-syntax " 1b"))) - (flag-2b (car (string-to-syntax " 2b")))) - (cond - ;; One-character comment-start terminated by - ;; \n. - ((and - (equal sn (string-to-syntax ">")) - (equal s1 (string-to-syntax "<"))) - (insert-char ?\n 1) - t) - ;; Two-character type b comment-start - ;; terminated by \n. - ((and - (= (logand (car sn) flag->b) flag->b) - (= (logand (car s1) flag-1b) flag-1b) - (= (logand (car s2) flag-2b) flag-2b)) - (insert-char ?\n 1) - t))))) + (unless (or (comment-forward) + ;; Allow non-terminated comments. + (eobp)) (error "Can't find the comment end")) (point))) (box nil) -- 2.39.5