]> git.eshelyaron.com Git - emacs.git/commitdiff
(uncomment-region): Allow non-terminated comment.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 4 Mar 2004 19:20:35 +0000 (19:20 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 4 Mar 2004 19:20:35 +0000 (19:20 +0000)
lisp/newcomment.el

index 91943503f5e46a54650789d598c67ce659195404..9f0aeabe21f86933db62567ff813b8f81b0e2347 100644 (file)
@@ -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 <monnier@cs.yale.edu>
@@ -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)