diff options
| author | Reiner Steib | 2007-07-09 19:14:48 +0000 |
|---|---|---|
| committer | Reiner Steib | 2007-07-09 19:14:48 +0000 |
| commit | 2b1567a532c70cf9bd729aa0b5b0a2f8121ca78e (patch) | |
| tree | d8cf110d3ad56fa8d73fe88fbbd276ef50ec9234 | |
| parent | ccbbae2c439f132be89e4203cde8803da7beab25 (diff) | |
| download | emacs-2b1567a532c70cf9bd729aa0b5b0a2f8121ca78e.tar.gz emacs-2b1567a532c70cf9bd729aa0b5b0a2f8121ca78e.zip | |
(tex-fontify-script)
(tex-font-script-display): New variables to make display of
superscripts and subscripts customizable.
(tex-font-lock-suscript, tex-font-lock-match-suscript): Use them.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 24 |
2 files changed, 28 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 048c6634c83..f8d08998d6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-07-09 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2 | |||
| 3 | * textmodes/tex-mode.el (tex-fontify-script) | ||
| 4 | (tex-font-script-display): New variables to make display of | ||
| 5 | superscripts and subscripts customizable. | ||
| 6 | (tex-font-lock-suscript, tex-font-lock-match-suscript): Use them. | ||
| 7 | |||
| 1 | 2007-07-09 Richard Stallman <rms@gnu.org> | 8 | 2007-07-09 Richard Stallman <rms@gnu.org> |
| 2 | 9 | ||
| 3 | * isearch.el (isearch-edit-string): Call to isearch-push-state | 10 | * isearch.el (isearch-edit-string): Call to isearch-push-state |
| @@ -372,6 +379,7 @@ | |||
| 372 | * font-lock.el (lisp-font-lock-keywords-2): Recognize the new \(?1:..\) | 379 | * font-lock.el (lisp-font-lock-keywords-2): Recognize the new \(?1:..\) |
| 373 | syntax as well. Reported by Juri Linkov <juri@jurta.org>. | 380 | syntax as well. Reported by Juri Linkov <juri@jurta.org>. |
| 374 | 381 | ||
| 382 | >>>>>>> 1.11328 | ||
| 375 | 2007-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 383 | 2007-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 376 | 384 | ||
| 377 | * dnd.el (dnd-get-local-file-name): Set fixcase to t in call to | 385 | * dnd.el (dnd-get-local-file-name): Set fixcase to t in call to |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 5757100468b..034caeee702 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -243,6 +243,21 @@ Normally set to either `plain-tex-mode' or `latex-mode'." | |||
| 243 | :options '("''" "\">" "\"'" ">>" "»") | 243 | :options '("''" "\">" "\"'" ">>" "»") |
| 244 | :group 'tex) | 244 | :group 'tex) |
| 245 | 245 | ||
| 246 | (defcustom tex-fontify-script t | ||
| 247 | "If non-nil, fontify subscript and superscript strings." | ||
| 248 | :type 'boolean | ||
| 249 | :group 'tex) | ||
| 250 | (put 'tex-fontify-script 'safe-local-variable 'booleanp) | ||
| 251 | |||
| 252 | (defcustom tex-font-script-display '(-0.3 . 0.3) | ||
| 253 | "Display specification for subscript and superscript content. | ||
| 254 | The car is used for subscript, the cdr is used for superscripts." | ||
| 255 | :group 'tex | ||
| 256 | :type '(cons (choice (float :tag "Subscript") | ||
| 257 | (const :tag "No lowering" nil)) | ||
| 258 | (choice (float :tag "Superscript") | ||
| 259 | (const :tag "No raising" nil)))) | ||
| 260 | |||
| 246 | (defvar tex-last-temp-file nil | 261 | (defvar tex-last-temp-file nil |
| 247 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. | 262 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. |
| 248 | Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the | 263 | Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the |
| @@ -593,13 +608,14 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 593 | (setq pos (1- pos) odd (not odd))) | 608 | (setq pos (1- pos) odd (not odd))) |
| 594 | odd)) | 609 | odd)) |
| 595 | (if (eq (char-after pos) ?_) | 610 | (if (eq (char-after pos) ?_) |
| 596 | '(face subscript display (raise -0.3)) | 611 | `(face subscript display (raise ,(car tex-font-script-display))) |
| 597 | '(face superscript display (raise +0.3))))) | 612 | `(face superscript display (raise ,(cdr tex-font-script-display)))))) |
| 598 | 613 | ||
| 599 | (defun tex-font-lock-match-suscript (limit) | 614 | (defun tex-font-lock-match-suscript (limit) |
| 600 | "Match subscript and superscript patterns up to LIMIT." | 615 | "Match subscript and superscript patterns up to LIMIT." |
| 601 | (when (re-search-forward "[_^] *\\([^\n\\{}]\\|\ | 616 | (when (and tex-fontify-script |
| 602 | \\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t) | 617 | (re-search-forward "[_^] *\\([^\n\\{}]\\|\ |
| 618 | \\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t)) | ||
| 603 | (when (match-end 3) | 619 | (when (match-end 3) |
| 604 | (let ((beg (match-beginning 3)) | 620 | (let ((beg (match-beginning 3)) |
| 605 | (end (save-restriction | 621 | (end (save-restriction |