diff options
| author | Stefan Monnier | 2007-08-10 04:16:21 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-08-10 04:16:21 +0000 |
| commit | 0e1627a71cd4a90232be9db9b696eb5ff9bdbe62 (patch) | |
| tree | 99c89414f2ce35356667633c0cd0bdb0d796b406 /lisp/textmodes | |
| parent | 021035a85a6ba433ca48ca6f108daa0322a153ba (diff) | |
| download | emacs-0e1627a71cd4a90232be9db9b696eb5ff9bdbe62.tar.gz emacs-0e1627a71cd4a90232be9db9b696eb5ff9bdbe62.zip | |
(tex-font-lock-unfontify-region): Take tex-font-script-display into account.
(tex-font-script-display, tex-font-lock-suscript): Change from a cons
cell to a list of 2 elements to simplify the unfontify code.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 240ebbcb229..44bc31d36d6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -249,14 +249,12 @@ Normally set to either `plain-tex-mode' or `latex-mode'." | |||
| 249 | :group 'tex) | 249 | :group 'tex) |
| 250 | (put 'tex-fontify-script 'safe-local-variable 'booleanp) | 250 | (put 'tex-fontify-script 'safe-local-variable 'booleanp) |
| 251 | 251 | ||
| 252 | (defcustom tex-font-script-display '(-0.2 . 0.2) | 252 | (defcustom tex-font-script-display '(-0.2 0.2) |
| 253 | "Display specification for subscript and superscript content. | 253 | "Display specification for subscript and superscript content. |
| 254 | The car is used for subscript, the cdr is used for superscripts." | 254 | The first is used for subscript, the second is used for superscripts." |
| 255 | :group 'tex | 255 | :group 'tex |
| 256 | :type '(cons (choice (float :tag "Subscript") | 256 | :type '(list (float :tag "Subscript") |
| 257 | (const :tag "No lowering" nil)) | 257 | (float :tag "Superscript"))) |
| 258 | (choice (float :tag "Superscript") | ||
| 259 | (const :tag "No raising" nil)))) | ||
| 260 | 258 | ||
| 261 | (defvar tex-last-temp-file nil | 259 | (defvar tex-last-temp-file nil |
| 262 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. | 260 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. |
| @@ -609,7 +607,7 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 609 | odd)) | 607 | odd)) |
| 610 | (if (eq (char-after pos) ?_) | 608 | (if (eq (char-after pos) ?_) |
| 611 | `(face subscript display (raise ,(car tex-font-script-display))) | 609 | `(face subscript display (raise ,(car tex-font-script-display))) |
| 612 | `(face superscript display (raise ,(cdr tex-font-script-display)))))) | 610 | `(face superscript display (raise ,(cadr tex-font-script-display)))))) |
| 613 | 611 | ||
| 614 | (defun tex-font-lock-match-suscript (limit) | 612 | (defun tex-font-lock-match-suscript (limit) |
| 615 | "Match subscript and superscript patterns up to LIMIT." | 613 | "Match subscript and superscript patterns up to LIMIT." |
| @@ -669,7 +667,7 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 669 | (let ((next (next-single-property-change beg 'display nil end)) | 667 | (let ((next (next-single-property-change beg 'display nil end)) |
| 670 | (prop (get-text-property beg 'display))) | 668 | (prop (get-text-property beg 'display))) |
| 671 | (if (and (eq (car-safe prop) 'raise) | 669 | (if (and (eq (car-safe prop) 'raise) |
| 672 | (member (car-safe (cdr prop)) '(-0.3 +0.3)) | 670 | (member (car-safe (cdr prop)) tex-font-script-display) |
| 673 | (null (cddr prop))) | 671 | (null (cddr prop))) |
| 674 | (put-text-property beg next 'display nil)) | 672 | (put-text-property beg next 'display nil)) |
| 675 | (setq beg next)))) | 673 | (setq beg next)))) |