[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/newcomment.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/newcomment.el |
Date: |
Wed, 23 Apr 2003 10:55:19 -0400 |
Index: emacs/lisp/newcomment.el
diff -c emacs/lisp/newcomment.el:1.58 emacs/lisp/newcomment.el:1.59
*** emacs/lisp/newcomment.el:1.58 Sat Apr 19 00:20:58 2003
--- emacs/lisp/newcomment.el Wed Apr 23 10:55:19 2003
***************
*** 211,217 ****
;;;###autoload
(defun comment-normalize-vars (&optional noerror)
! (if (not comment-start) (or noerror (error "No comment syntax is defined"))
;; comment-use-syntax
(when (eq comment-use-syntax 'undecided)
(set (make-local-variable 'comment-use-syntax)
--- 211,220 ----
;;;###autoload
(defun comment-normalize-vars (&optional noerror)
! (if (not comment-start)
! (unless noerror
! (set (make-local-variable 'comment-start)
! (read-string "No comment syntax is defined. Use: ")))
;; comment-use-syntax
(when (eq comment-use-syntax 'undecided)
(set (make-local-variable 'comment-use-syntax)
***************
*** 246,252 ****
;; In case comment-start has changed since last time.
(string-match comment-start-skip comment-start))
(set (make-local-variable 'comment-start-skip)
! (concat "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|"
(regexp-quote (comment-string-strip comment-start t t))
;; Let's not allow any \s- but only [ \t] since \n
;; might be both a comment-end marker and \s-.
--- 249,255 ----
;; In case comment-start has changed since last time.
(string-match comment-start-skip comment-start))
(set (make-local-variable 'comment-start-skip)
! (concat "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|"
(regexp-quote (comment-string-strip comment-start t t))
;; Let's not allow any \s- but only [ \t] since \n
;; might be both a comment-end marker and \s-.
***************
*** 664,670 ****
(goto-char (match-end 0)))
(if (null arg) (delete-region (point-min) (point))
(skip-syntax-backward " ")
! (delete-char (- numarg)))
;; Remove the end-comment (and leading padding and such).
(goto-char (point-max)) (comment-enter-backward)
--- 667,679 ----
(goto-char (match-end 0)))
(if (null arg) (delete-region (point-min) (point))
(skip-syntax-backward " ")
! (delete-char (- numarg))
! (unless (or (bobp)
! (save-excursion (goto-char (point-min))
! (looking-at comment-start-skip)))
! ;; If there's something left but it doesn't look like
! ;; a comment-start any more, just remove it.
! (delete-region (point-min) (point))))
;; Remove the end-comment (and leading padding and such).
(goto-char (point-max)) (comment-enter-backward)
***************
*** 677,683 ****
(when (and (bolp) (not (bobp))) (backward-char))
(if (null arg) (delete-region (point) (point-max))
(skip-syntax-forward " ")
! (delete-char numarg)))
;; Unquote any nested end-comment.
(comment-quote-nested comment-start comment-end t)
--- 686,696 ----
(when (and (bolp) (not (bobp))) (backward-char))
(if (null arg) (delete-region (point) (point-max))
(skip-syntax-forward " ")
! (delete-char numarg)
! (unless (or (eobp) (looking-at comment-end-skip))
! ;; If there's something left but it doesn't look like
! ;; a comment-end any more, just remove it.
! (delete-region (point) (point-max)))))
;; Unquote any nested end-comment.
(comment-quote-nested comment-start comment-end t)