* faces.el (tty-set-up-initial-frame-faces):
* env.el (setenv): Don't set display-environment-variable.
-2007-09-21 Glenn Morris <rgm@gnu.org>
-
- * emacs-lisp/bytecomp.el (byte-compile-warnings)
- (byte-compile-warnings-safe-p): Add `mapcar'.
- (byte-compile-normal-call): Add option to suppress mapcar warning.
- (top-level): Use mapc rather than mapcar in eval-when-compile.
- (byte-compile-warning-types): Add mapcar and make-local.
-
-2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca>
-
* server.el (server-getenv-from): Remove. Use getenv-internal instead.
(server-create-tty-frame): Don't set unused `tty' property.
Set `display' instead of display-environment-variable.
* term/sun-mouse.el (suspend-emacstool): Remove.
* term/sun.el: Remove emacstool-related code.
-2007-09-21 Kevin Ryde <user42@zip.com.au>
-
- * international/mule.el (sgml-html-meta-auto-coding-function):
- Bind `case-fold-search' to t.
-
-2007-09-21 Glenn Morris <rgm@gnu.org>
+ * emacs-lisp/bytecomp.el (byte-compile-warnings)
+ (byte-compile-warnings-safe-p): Add `mapcar'.
+ (byte-compile-normal-call): Add option to suppress mapcar warning.
+ (top-level): Use mapc rather than mapcar in eval-when-compile.
+ (byte-compile-warning-types): Add mapcar and make-local.
* textmodes/tex-mode.el (tex-validate-region): Handle escaped parens.
- (tex-next-unmatched-eparen): New function.
- (latex-forward-sexp-1): Doc fix. Handle escaped parens.
+ (tex-next-unmatched-eparen, tex-last-unended-eparen): New functions.
+ (latex-forward-sexp-1, latex-backward-sexp-1): Doc fix.
+ Handle escaped parens.
(latex-forward-sexp): Doc fix.
* eshell/esh-mode.el (eshell-output-filter-functions): Add
* loadup.el: Remove termdev.
+2007-09-21 Kevin Ryde <user42@zip.com.au>
+
+ * international/mule.el (sgml-html-meta-auto-coding-function):
+ Bind `case-fold-search' to t.
+
2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
* termdev.el: Remove.
(defun tex-next-unmatched-eparen (otype)
"Leave point after the next unmatched escaped closing parenthesis.
-The string OPAREN is an opening parenthesis type: `(', `{', or `['."
+The string OTYPE is an opening parenthesis type: `(', `{', or `['."
(condition-case nil
(let ((ctype (char-to-string (cdr (aref (syntax-table)
(string-to-char otype))))))
(wrong-type-argument (error "Unknown opening parenthesis type: %s" otype))
(search-failed (error "Couldn't find closing escaped paren"))))
+(defun tex-last-unended-eparen (ctype)
+ "Leave point at the start of the last unended escaped opening parenthesis.
+The string CTYPE is a closing parenthesis type: `)', `}', or `]'."
+ (condition-case nil
+ (let ((otype (char-to-string (cdr (aref (syntax-table)
+ (string-to-char ctype))))))
+ (while (and (tex-search-noncomment
+ (re-search-backward (format "\\\\[%s%s]" ctype otype)))
+ (looking-at (format "\\\\%s" (regexp-quote ctype))))
+ (tex-last-unended-eparen ctype)))
+ (wrong-type-argument (error "Unknown opening parenthesis type: %s" ctype))
+ (search-failed (error "Couldn't find unended escaped paren"))))
+
(defun tex-goto-last-unclosed-latex-block ()
"Move point to the last unclosed \\begin{...}.
Mark is left at original location."
(push-mark)
(goto-char spot)))
+;; Don't think this one actually _needs_ (for the purposes of
+;; tex-mode) to handle escaped parens.
(defun latex-backward-sexp-1 ()
- "Like (backward-sexp 1) but aware of multi-char elements."
+ "Like (backward-sexp 1) but aware of multi-char elements and escaped parens."
(let ((pos (point))
(forward-sexp-function))
(backward-sexp 1)
- (if (looking-at "\\\\begin\\>")
- (signal 'scan-error
- (list "Containing expression ends prematurely"
- (point) (prog1 (point) (goto-char pos))))
- (when (eq (char-after) ?{)
- (let ((newpos (point)))
- (when (ignore-errors (backward-sexp 1) t)
- (if (or (looking-at "\\\\end\\>")
- ;; In case the \\ ends a verbatim section.
- (and (looking-at "end\\>") (eq (char-before) ?\\)))
- (tex-last-unended-begin)
- (goto-char newpos))))))))
+ (cond ((looking-at "\\\\\\(begin\\>\\|[[({]\\)")
+ (signal 'scan-error
+ (list "Containing expression ends prematurely"
+ (point) (prog1 (point) (goto-char pos)))))
+ ((looking-at "\\\\\\([])}]\\)")
+ (tex-last-unended-eparen (match-string 1)))
+ ((eq (char-after) ?{)
+ (let ((newpos (point)))
+ (when (ignore-errors (backward-sexp 1) t)
+ (if (or (looking-at "\\\\end\\>")
+ ;; In case the \\ ends a verbatim section.
+ (and (looking-at "end\\>") (eq (char-before) ?\\)))
+ (tex-last-unended-begin)
+ (goto-char newpos))))))))
;; Note this does not handle things like mismatched brackets inside
;; begin/end blocks.
+;; Needs to handle escaped parens for tex-validate-*.
+;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00038.html
(defun latex-forward-sexp-1 ()
"Like (forward-sexp 1) but aware of multi-char elements and escaped parens."
(let ((pos (point))
((looking-at "\\\\begin\\>")
(goto-char (match-end 0))
(tex-next-unmatched-end))
+ ;; A better way to handle this, \( .. \) etc, is probably to
+ ;; temporarily change the syntax of the \ in \( to punctuation.
((looking-back "\\\\[])}]")
(signal 'scan-error
(list "Containing expression ends prematurely"