auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] Changes to auctex/tex.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/tex.el,v
Date: Sat, 31 Oct 2009 17:03:06 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    09/10/31 17:03:06

Index: tex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex.el,v
retrieving revision 5.656
retrieving revision 5.657
diff -u -b -r5.656 -r5.657
--- tex.el      25 Oct 2009 18:25:12 -0000      5.656
+++ tex.el      31 Oct 2009 17:03:05 -0000      5.657
@@ -4339,6 +4339,21 @@
   (TeX-set-mode-name))
 
 
+;;; Verbatim constructs
+
+(defvar TeX-verbatim-p-function nil
+  "Mode-specific function to be called by `TeX-verbatim-p'.")
+(make-variable-buffer-local 'TeX-verbatim-p-function)
+
+;; XXX: We only have an implementation for LaTeX mode at the moment (Oct 2009).
+(defun TeX-verbatim-p (&optional pos)
+  "Return non-nil if position POS is in a verbatim-like construct.
+A mode-specific implementation is required.  If it is not
+available, the function always returns nil."
+  (when TeX-verbatim-p-function
+    (funcall TeX-verbatim-p-function)))
+
+
 ;;; Comments
 
 (defvar TeX-comment-start-regexp "%"
@@ -4444,10 +4459,12 @@
          (eq (preceding-char) ?\r))
       nil
     (save-excursion
+      (save-match-data
       (let ((pos (point)))
-       (re-search-backward "^\\|\r" nil t)
-       (or (looking-at comment-start-skip)
-           (re-search-forward comment-start-skip pos t))))))
+         (beginning-of-line)
+         (and (or (looking-at comment-start-skip)
+                  (re-search-forward comment-start-skip pos t))
+              (not (TeX-verbatim-p))))))))
 
 (defun TeX-in-commented-line ()
   "Return non-nil if point is in a line consisting only of a comment.
@@ -4597,8 +4614,8 @@
   (save-excursion
     (let ((count 0) (limit (line-end-position)) char)
       (while (progn
-              (skip-chars-forward "^%{}\\\\" limit)
-              (when (< (point) limit)
+              (skip-chars-forward "^{}\\\\" limit)
+              (when (and (< (point) limit) (not (TeX-in-comment)))
                 (setq char (char-after))
                 (forward-char)
                 (cond ((eq char ?\{)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]