diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-03-04 19:20:35 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-03-04 19:20:35 +0000 |
commit | 2720770c5821135393676ef26924a20afac340cd (patch) | |
tree | 3989aa5bb0c2d8695994935bca25ebdda7d0b675 /lisp/newcomment.el | |
parent | 01ff91367762acf46e2e138ae6168d1e2db75002 (diff) | |
download | emacs-2720770c5821135393676ef26924a20afac340cd.tar.gz |
(uncomment-region): Allow non-terminated comment.
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r-- | lisp/newcomment.el | 34 |
1 files 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 <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) |