]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/tex-mode.el
Fix byte-compiler warnings about looking-back.
[gnu-emacs] / lisp / textmodes / tex-mode.el
index d54c78b683a28d33dee22f917c55a3a25baacd2e..c26c6098364e1632e46d4c2de13d2c440ba0048d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*-
 
-;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2014 Free
+;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2015 Free
 ;; Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -1304,7 +1304,7 @@ inserts \" characters."
   ;;
   (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\))
           (eq (get-text-property (point) 'face) 'tex-verbatim)
-          ;; Discover if a preceding occurance of `tex-open-quote'
+          ;; Discover if a preceding occurrence of `tex-open-quote'
           ;; should be morphed to a normal double quote.
           ;;
           (and (>= (point) (+ (point-min) (length tex-open-quote)))
@@ -1321,7 +1321,7 @@ inserts \" characters."
       ;;
       (self-insert-command (prefix-numeric-value arg))
     ;; We'll be inserting fancy TeX quotes, but consider and imitate
-    ;; `electric-pair-mode''s two behaviours: pair-insertion and
+    ;; `electric-pair-mode''s two behaviors: pair-insertion and
     ;; region wrapping.
     ;;
     (if (and electric-pair-mode (use-region-p))
@@ -1761,13 +1761,13 @@ Mark is left at original location."
        ;; A better way to handle this, \( .. \) etc, is probably to
        ;; temporarily change the syntax of the \ in \( to punctuation.
        ((and latex-handle-escaped-parens
-            (looking-back "\\\\[])}]"))
+            (looking-back "\\\\[])}]" (- (point) 2)))
        (signal 'scan-error
                (list "Containing expression ends prematurely"
                      (- (point) 2) (prog1 (point)
                                      (goto-char pos)))))
        ((and latex-handle-escaped-parens
-            (looking-back "\\\\\\([({[]\\)"))
+            (looking-back "\\\\\\([({[]\\)" (- (point) 2)))
        (tex-next-unmatched-eparen (match-string 1)))
        (t (goto-char newpos))))))