+2000-11-22 Stefan Monnier <monnier@cs.yale.edu>
+
+ * textmodes/tex-mode.el (tex-font-lock-keywords-1):
+ Fix ARG regexp to skip quoted braces.
+ (tex-font-lock-keywords-2): Fix ARG regexp to skip quoted braces.
+ Remove `bf' and `it' from `bold' and `italic' (they were wrong and
+ are (correctly) handled separately).
+ Remove `caption' and `footnote' from `citations': they contain text.
+ Don't highlight `textmd', `texttt' and `textrm' with bold-italic.
+ (latex-skeleton-end-hook): New function.
+ (latex-mode): Use it.
+ (tex-start-tex-marker): Remove.
+ (tex-send-tex-command): Don't set tex-start-tex-marker.
+ (tex-error-parse-syntax-table): New var.
+ (tex-compilation-parse-errors): Use it.
+ Ignore tex-start-tex-marker. Don't bother with marker-position.
+ (tex-validate-buffer): Don't bother with marker-position.
+
+ * textmodes/flyspell.el (flyspell-prog-text-faces): New var.
+ (flyspell-generic-progmode-verify): Use it.n
+
2000-11-22 Sam Steingold <sds@gnu.org>
* simple.el (delete-trailing-whitespace): New interactive function.
`ada-remove-trailing-spaces'
(ada-remove-trailing-spaces): Removed.
* textmodes/two-column.el (2C-merge): Recommend it in the doc.
- * textmodes/picture.el (picture-mode-exit): Call it instead of
- `picture-clean'.
- (picture-clean): Removed.
+ * textmodes/picture.el (picture-clean): Removed.
+ (picture-mode-exit): Call it instead of `picture-clean'.
2000-11-22 Gerd Moellmann <gerd@gnu.org>
column-number items. Add help-echo for the background.
(mode-line-mule-info): Modify help-echo.
- * avoid.el (mouse-avoidance-mode): Add autoload cookie to
- defcustom.
+ * avoid.el (mouse-avoidance-mode): Add autoload cookie to defcustom.
* files.el (load-file): Allow completion to .elc.
;; Miscellany.
(slash "\\\\")
(opt "\\(\\[[^]]*\\]\\)?")
- (arg "{\\(\\(?:[^{}]+\\(?:{[^}]*}\\)?\\)+\\)"))
+ (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
(list
;; Heading args.
(list (concat slash headings "\\*?" opt arg)
(eval-when-compile
(let* (;;
;; Names of commands whose arg should be fontified with fonts.
- (bold (regexp-opt '("bf" "textbf" "textsc" "textup"
+ (bold (regexp-opt '("textbf" "textsc" "textup"
"boldsymbol" "pmb") t))
- (italic (regexp-opt '("it" "textit" "textsl" "emph") t))
+ (italic (regexp-opt '("textit" "textsl" "emph") t))
(type (regexp-opt '("texttt" "textmd" "textrm" "textsf") t))
;;
;; Names of commands whose arg should be fontified as a citation.
(citations (regexp-opt
'("label" "ref" "pageref" "vref" "eqref"
- "cite" "nocite" "caption" "index" "glossary"
- "footnote" "footnotemark" "footnotetext")
+ "cite" "nocite" "index" "glossary"
+ ;; These are text, rather than citations.
+ ;; "caption" "footnote" "footnotemark" "footnotetext"
+ )
t))
;;
;; Names of commands that should be fontified.
;; Miscellany.
(slash "\\\\")
(opt "\\(\\[[^]]*\\]\\)?")
- (arg "{\\(\\(?:[^{}]+\\(?:{[^}]*}\\)?\\)+\\)"))
+ (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
(list
;;
;; Citation args.
;; since we might not be able to display those fonts.
(list (concat slash bold arg) 2 '(quote bold) 'append)
(list (concat slash italic arg) 2 '(quote italic) 'append)
- (list (concat slash type arg) 2 '(quote bold-italic) 'append)
+ ;; (list (concat slash type arg) 2 '(quote bold-italic) 'append)
;;
;; Old-style bf/em/it/sl. Stop at `\\' and un-escaped `&', for tables.
(list (concat "\\\\\\(\\(bf\\)\\|em\\|it\\|sl\\)\\>"
(set (make-local-variable 'outline-regexp) latex-outline-regexp)
(set (make-local-variable 'outline-level) 'latex-outline-level)
(set (make-local-variable 'forward-sexp-function) 'latex-forward-sexp)
+ (set (make-local-variable 'skeleton-end-hook) 'latex-skeleton-end-hook)
(run-hooks 'tex-mode-hook))
;;;###autoload
(forward-char (- start end))
(setq text-beg (point-marker))
(insert (format "%3d: " linenum))
- (put-text-property (marker-position text-beg)
- (- (marker-position text-end) 1)
+ (put-text-property text-beg (- text-end 1)
'mouse-face 'highlight)
- (put-text-property (marker-position text-beg)
- (- (marker-position text-end) 1)
+ (put-text-property text-beg (- text-end 1)
'occur tem)))))
(goto-char prev-end))))
(with-current-buffer standard-output
(defvar latex-block-default "enumerate")
+(defun latex-skeleton-end-hook ()
+ (unless (or (eolp) (save-excursion (move-to-left-margin)
+ (not (looking-at paragraph-separate))))
+ (newline-and-indent)))
+
;;; Like tex-insert-braces, but for LaTeX.
(define-skeleton tex-latex-block
"Create a matching pair of lines \\begin[OPT]{NAME} and \\end{NAME} at point.
(add-hook 'kill-emacs-hook 'tex-delete-last-temp-files)
-(defvar tex-start-tex-marker nil
- "Marker pointing after last TeX-running command in the TeX shell buffer.")
-
(defun tex-guess-main-file (&optional all)
"Find a likely `tex-main-file'.
Looks for hints in other buffers in the same directory or in
(let (shell-dirtrack-verbose)
(tex-send-command tex-shell-cd-command dir)))
(with-current-buffer (process-buffer (tex-send-command cmd))
- (save-excursion
- (forward-line -1)
- (setq tex-start-tex-marker (point-marker)))
(make-local-variable 'compilation-parse-errors-function)
(setq compilation-parse-errors-function 'tex-compilation-parse-errors)
(setq compilation-last-buffer (current-buffer))
(compilation-forget-errors)
+ ;; Don't parse previous compilations.
(set-marker compilation-parsing-end (1- (point-max))))
(tex-display-shell)
(setq tex-last-buffer-texed (current-buffer)))
\f
+(defvar tex-error-parse-syntax-table
+ (let ((st (make-syntax-table)))
+ (modify-syntax-entry ?\( "()" st)
+ (modify-syntax-entry ?\) ")(" st)
+ (modify-syntax-entry ?\\ "\\" st)
+ (modify-syntax-entry ?\{ "_" st)
+ (modify-syntax-entry ?\} "_" st)
+ (modify-syntax-entry ?\[ "_" st)
+ (modify-syntax-entry ?\] "_" st)
+ ;; Single quotations may appear in errors
+ (modify-syntax-entry ?\" "_" st)
+ st)
+ "Syntax-table used while parsing TeX error messages.")
+
(defun tex-compilation-parse-errors (limit-search find-at-least)
"Parse the current buffer as TeX error messages.
See the variable `compilation-parse-errors-function' for the interface it uses.
(message "Parsing error messages...")
(let ((default-directory ; Perhaps dir has changed meanwhile.
(file-name-directory (buffer-file-name tex-last-buffer-texed)))
- (old-syntax-table (syntax-table))
- (tex-error-parse-syntax-table (copy-syntax-table (syntax-table)))
found-desired (num-errors-found 0)
last-filename last-linenum last-position
begin-of-error end-of-error)
- (modify-syntax-entry ?\{ "_" tex-error-parse-syntax-table)
- (modify-syntax-entry ?\} "_" tex-error-parse-syntax-table)
- (modify-syntax-entry ?\[ "_" tex-error-parse-syntax-table)
- (modify-syntax-entry ?\] "_" tex-error-parse-syntax-table)
- ;; Single quotations may appear in errors
- (modify-syntax-entry ?\" "_" tex-error-parse-syntax-table)
- ;; Don't parse previous compilations.
- (set-marker compilation-parsing-end
- (max compilation-parsing-end tex-start-tex-marker))
;; Don't reparse messages already seen at last parse.
(goto-char compilation-parsing-end)
;; Parse messages.
(set-buffer tex-last-buffer-texed)
(set-buffer (find-file-noselect filename)))
(if new-file
- (goto-line linenum)
+ (progn (goto-line linenum) (setq last-position nil))
(goto-char last-position)
(forward-line (- linenum last-linenum)))
;; first try a forward search for the error text,
;; then a backward search limited by the last error.
(let ((starting-point (point)))
(or (re-search-forward error-text nil t)
- (re-search-backward
- error-text
- (marker-position last-position) t)
+ (re-search-backward error-text last-position t)
(goto-char starting-point)))
(point-marker))))
(goto-char this-error)