From 0e1627a71cd4a90232be9db9b696eb5ff9bdbe62 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Aug 2007 04:16:21 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 22 ++++++++++++++-------- lisp/textmodes/tex-mode.el | 14 ++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 783281b3012..35f5480f480 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,14 @@ +2007-08-10 Stefan Monnier + + * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to + 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. + 2007-08-09 Edward O'Connor (tiny change) - * url/url-auth.el (url-basic-auth): When prompting for username - and password, default to the username and password in the URL. + * url/url-auth.el (url-basic-auth): When prompting for username + and password, default to the username and password in the URL. 2007-08-08 Vinicius Jose Latorre @@ -285,16 +292,15 @@ (fortran-mode): Use fortran-line-length, and fortran-font-lock-syntactic-keywords as a function. Add a hack-local-variables-hook function. - (fortran-line-length, fortran-hack-local-variables): New - functions. - (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use - fortran-line-length rather than 72. + (fortran-line-length, fortran-hack-local-variables): New functions. + (fortran-window-create, fortran-strip-sequence-nos): Doc fix. + Use fortran-line-length rather than 72. (fortran-window-create-momentarily): Doc fix. 2007-07-31 Drew Adams (tiny change) - * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix - parent groups link. + * cus-edit.el (custom-group-value-create, custom-goto-parent): + Fix parent groups link. 2007-07-31 Paul Pogonyshev 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'." :group 'tex) (put 'tex-fontify-script 'safe-local-variable 'booleanp) -(defcustom tex-font-script-display '(-0.2 . 0.2) +(defcustom tex-font-script-display '(-0.2 0.2) "Display specification for subscript and superscript content. -The car is used for subscript, the cdr is used for superscripts." +The first is used for subscript, the second is used for superscripts." :group 'tex - :type '(cons (choice (float :tag "Subscript") - (const :tag "No lowering" nil)) - (choice (float :tag "Superscript") - (const :tag "No raising" nil)))) + :type '(list (float :tag "Subscript") + (float :tag "Superscript"))) (defvar tex-last-temp-file nil "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." odd)) (if (eq (char-after pos) ?_) `(face subscript display (raise ,(car tex-font-script-display))) - `(face superscript display (raise ,(cdr tex-font-script-display)))))) + `(face superscript display (raise ,(cadr tex-font-script-display)))))) (defun tex-font-lock-match-suscript (limit) "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." (let ((next (next-single-property-change beg 'display nil end)) (prop (get-text-property beg 'display))) (if (and (eq (car-safe prop) 'raise) - (member (car-safe (cdr prop)) '(-0.3 +0.3)) + (member (car-safe (cdr prop)) tex-font-script-display) (null (cddr prop))) (put-text-property beg next 'display nil)) (setq beg next)))) -- 2.39.2