]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/tex-mode.el
Fix commit 2013-02-15T09:41:31Z!eliz@gnu.org for bug #13546.
[gnu-emacs] / lisp / textmodes / tex-mode.el
index 5571af1ad9bc320545df8856534b2d60688e9bc4..db012e5cf9b27b8d9a9ef64f7f5f90eadf137f32 100644 (file)
@@ -1,7 +1,7 @@
 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*-
 
-;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2013 Free
+;; Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: tex
@@ -860,10 +860,6 @@ START is the position of the \\ and DELIM is the delimiter char."
     (set-keymap-parent map text-mode-map)
     (tex-define-common-keys map)
     (define-key map "\"" 'tex-insert-quote)
-    (define-key map "(" 'skeleton-pair-insert-maybe)
-    (define-key map "{" 'skeleton-pair-insert-maybe)
-    (define-key map "[" 'skeleton-pair-insert-maybe)
-    (define-key map "$" 'skeleton-pair-insert-maybe)
     (define-key map "\n" 'tex-terminate-paragraph)
     (define-key map "\M-\r" 'latex-insert-item)
     (define-key map "\C-c}" 'up-list)
@@ -1286,7 +1282,8 @@ inserts \" characters."
              (delete-char (length tex-open-quote))
              t)))
       (self-insert-command (prefix-numeric-value arg))
-    (insert (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+    (insert (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+                    (memq (preceding-char) '(?~)))
                tex-open-quote tex-close-quote))))
 
 (defun tex-validate-buffer ()
@@ -1498,7 +1495,7 @@ Puts point on a blank line between them."
 (defvar latex-complete-bibtex-cache nil)
 
 (define-obsolete-function-alias 'latex-string-prefix-p
-  'string-prefix-p "24.2")
+  'string-prefix-p "24.3")
 
 (defvar bibtex-reference-key)
 (declare-function reftex-get-bibfile-list "reftex-cite.el" ())
@@ -1722,9 +1719,12 @@ Mark is left at original location."
   "Like `forward-sexp' but aware of multi-char elements and escaped parens."
   (interactive "P")
   (unless arg (setq arg 1))
-  (let ((pos (point)))
+  (let ((pos (point))
+       (opoint 0))
     (condition-case err
-       (while (/= arg 0)
+       (while (and (/= (point) opoint)
+                   (/= arg 0))
+         (setq opoint (point))
          (setq arg
                (if (> arg 0)
                    (progn (latex-forward-sexp-1) (1- arg))
@@ -2055,7 +2055,7 @@ IN can be either a string (with the same % escapes in it) indicating
 OUT describes the output file and is either a %-escaped string
   or nil to indicate that there is no output file.")
 
-(define-obsolete-function-alias 'tex-string-prefix-p 'string-prefix-p "24.2")
+(define-obsolete-function-alias 'tex-string-prefix-p 'string-prefix-p "24.3")
 
 (defun tex-guess-main-file (&optional all)
   "Find a likely `tex-main-file'.
@@ -2565,8 +2565,7 @@ line LINE of the window, or centered if LINE is nil."
     (if (null tex-shell)
        (message "No TeX output buffer")
       (setq window (display-buffer tex-shell))
-      (save-selected-window
-       (select-window window)
+      (with-selected-window window
        (bury-buffer tex-shell)
        (goto-char (point-max))
        (recenter (if linenum